diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2011-01-17 18:58:44 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2011-01-17 18:58:44 +0000 |
commit | b918d0f5d8f147e1e26c34e6cf42a79af2d2ec41 (patch) | |
tree | a489c8f3cb7caf6a65709f39cf40a9f448aa16d7 /lib/Parse/Parser.cpp | |
parent | b266a1fce09ab4ee7033268199509aacfbef056a (diff) |
Convert "#pragma unused(...)" into tokens for the parser.
This allows us to cache a "#pragma unused" that occurs inside an inline C++ member function.
Fixes rdar://8829590&8770988.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123666 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Parse/Parser.cpp')
-rw-r--r-- | lib/Parse/Parser.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/Parse/Parser.cpp b/lib/Parse/Parser.cpp index 473c6ad7b0..47c62377c2 100644 --- a/lib/Parse/Parser.cpp +++ b/lib/Parse/Parser.cpp @@ -404,6 +404,10 @@ void Parser::Initialize() { /// ParseTopLevelDecl - Parse one top-level declaration, return whatever the /// action tells us to. This returns true if the EOF was encountered. bool Parser::ParseTopLevelDecl(DeclGroupPtrTy &Result) { + + while (Tok.is(tok::annot_pragma_unused)) + HandlePragmaUnused(); + Result = DeclGroupPtrTy(); if (Tok.is(tok::eof)) { Actions.ActOnEndOfTranslationUnit(); |