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
Im not sure I care for Microsoft here. This is an extension that is supported on more than one compiler suite. How about "Enable support for __declspec extension"?