aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Format/Format.cpp
diff options
context:
space:
mode:
authorSaleem Abdulrasool <compnerd@compnerd.org>2015-10-04 17:51:05 +0000
committerSaleem Abdulrasool <compnerd@compnerd.org>2015-10-04 17:51:05 +0000
commitd170c4b57a91adc74ca89c6d4af616a00323b12c (patch)
treebd60d6ac58deaccfba05e60cae9bd94f6aeff62b /clang/lib/Format/Format.cpp
parentf9d71a54391fe07a2f5b308428fa243a228346aa (diff)
downloadllvm-d170c4b57a91adc74ca89c6d4af616a00323b12c.zip
llvm-d170c4b57a91adc74ca89c6d4af616a00323b12c.tar.gz
llvm-d170c4b57a91adc74ca89c6d4af616a00323b12c.tar.bz2
Add -f[no-]declspec to control recognition of __declspec as a keyword
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. Patch by Warren Ristow! llvm-svn: 249279
Diffstat (limited to 'clang/lib/Format/Format.cpp')
-rw-r--r--clang/lib/Format/Format.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/clang/lib/Format/Format.cpp b/clang/lib/Format/Format.cpp
index d8a15e4..fffd80c 100644
--- a/clang/lib/Format/Format.cpp
+++ b/clang/lib/Format/Format.cpp
@@ -1826,6 +1826,7 @@ LangOptions getFormattingLangOpts(const FormatStyle &Style) {
LangOpts.ObjC1 = 1;
LangOpts.ObjC2 = 1;
LangOpts.MicrosoftExt = 1; // To get kw___try, kw___finally.
+ LangOpts.DeclSpecKeyword = 1; // To get __declspec.
return LangOpts;
}