summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorEli Friedman <eli.friedman@gmail.com>2012-02-23 23:47:16 +0000
committerEli Friedman <eli.friedman@gmail.com>2012-02-23 23:47:16 +0000
commitaa5ab26ed93382b812147f532dcbf4afb5494040 (patch)
tree075b778942e1b8eec6108dd5d5dea37171a0afa3 /include
parent8b9414e868853fc052251455674bf7512261e14a (diff)
downloadclang-aa5ab26ed93382b812147f532dcbf4afb5494040.tar.gz
clang-aa5ab26ed93382b812147f532dcbf4afb5494040.tar.bz2
clang-aa5ab26ed93382b812147f532dcbf4afb5494040.tar.xz
Handle "#pragma GCC visibility" in a few more places. Switch over "#pragma pack" to use the same handling that gcc does. Fixes <rdar://problem/10871094> and <rdar://problem/10893316>.
(Hopefully, common usage of these pragmas isn't irregular enough to break our current handling. Doug has ideas for a more crazy approach if necessary.) git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151307 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/clang/Basic/TokenKinds.def5
-rw-r--r--include/clang/Parse/Parser.h4
2 files changed, 9 insertions, 0 deletions
diff --git a/include/clang/Basic/TokenKinds.def b/include/clang/Basic/TokenKinds.def
index 014e111033..300db4d886 100644
--- a/include/clang/Basic/TokenKinds.def
+++ b/include/clang/Basic/TokenKinds.def
@@ -574,6 +574,11 @@ ANNOTATION(pragma_unused)
// handles them.
ANNOTATION(pragma_vis)
+// Annotation for #pragma pack...
+// The lexer produces these so that they only take effect when the parser
+// handles them.
+ANNOTATION(pragma_pack)
+
#undef ANNOTATION
#undef TESTING_KEYWORD
#undef OBJC2_AT_KEYWORD
diff --git a/include/clang/Parse/Parser.h b/include/clang/Parse/Parser.h
index 079a93fb5b..64736118e1 100644
--- a/include/clang/Parse/Parser.h
+++ b/include/clang/Parse/Parser.h
@@ -410,6 +410,10 @@ private:
/// #pragma GCC visibility...
void HandlePragmaVisibility();
+ /// \brief Handle the annotation token produced for
+ /// #pragma pack...
+ void HandlePragmaPack();
+
/// GetLookAheadToken - This peeks ahead N tokens and returns that token
/// without consuming any tokens. LookAhead(0) returns 'Tok', LookAhead(1)
/// returns the token after Tok, etc.