[PATCH] D13322: Add -f[no-]declspec to control recognition of __declspec as a keyword

Warren Ristow via cfe-commits cfe-commits at lists.llvm.org
Wed Sep 30 18:41:52 PDT 2015


wristow created this revision.
wristow added reviewers: aaron.ballman, ygao, alexr, silvas, compnerd, cfe-commits.

In versions of clang prior to r238238, __declspec was recognized as a
keyword in all modes.  It was then changed to only be enabled when
Microsoft or Borland extensions were enabled (and for CUDA, as a
temporary measure).  There is a desire to support __declspec in
Playstation code, and possibly other environments.  This commit adds a
command-line switch to allow explicit enabling/disabling of the
recognition of __declspec as a keyword.  Recognition is enabled by
default in Microsoft, Borland, CUDA and PS4 environments, and disabled
in all other environments.

This proposed change supersedes D11207.  In D11207, it was proposed that a new language-dialect be added to Clang, to support extensions used in the Playstation environment.  The primary motivation of that language-dialect was the recognition of __declspec as a keyword.  After consideration, it was suggested that adding a switch to independently control the recognition of __declspec was an alternative to consider.  See:

http://lists.llvm.org/pipermail/cfe-commits/Week-of-Mon-20150713/133310.html

As a result of that, this proposed change adds a switch to control the recognition of __declspec.

Can someone review, and if OK then commit this patch for me, please?

-Warren Ristow
SN Systems - Sony Computer Entertainment Group

http://reviews.llvm.org/D13322

Files:
  include/clang/Basic/LangOptions.def
  include/clang/Basic/TokenKinds.def
  include/clang/Driver/Options.td
  include/clang/Parse/Parser.h
  lib/Basic/IdentifierTable.cpp
  lib/Driver/Tools.cpp
  lib/Frontend/CompilerInvocation.cpp
  lib/Parse/ParseDecl.cpp
  test/Lexer/keywords_test.c
  test/Lexer/keywords_test.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D13322.36171.patch
Type: text/x-patch
Size: 9505 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20151001/6df8d3b6/attachment.bin>


More information about the cfe-commits mailing list