diff options
author | Peter Collingbourne <peter@pcc.me.uk> | 2011-02-22 13:49:00 +0000 |
---|---|---|
committer | Peter Collingbourne <peter@pcc.me.uk> | 2011-02-22 13:49:00 +0000 |
commit | 2c9f966600da37ea87a1497a7c0d71f51d953760 (patch) | |
tree | 5dd52c92d6ba5e3488cdcc6c96a90e72457d2412 /clang/lib/Lex/PPDirectives.cpp | |
parent | e16dc2a6e7641b228f6b41d01a62f93f77f86457 (diff) | |
download | bcm5719-llvm-2c9f966600da37ea87a1497a7c0d71f51d953760.tar.gz bcm5719-llvm-2c9f966600da37ea87a1497a7c0d71f51d953760.zip |
Make TokenLexer capable of storing preprocessor directive tokens
llvm-svn: 126220
Diffstat (limited to 'clang/lib/Lex/PPDirectives.cpp')
-rw-r--r-- | clang/lib/Lex/PPDirectives.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/clang/lib/Lex/PPDirectives.cpp b/clang/lib/Lex/PPDirectives.cpp index 0f0d25b887a..f92fa038a30 100644 --- a/clang/lib/Lex/PPDirectives.cpp +++ b/clang/lib/Lex/PPDirectives.cpp @@ -167,10 +167,12 @@ void Preprocessor::CheckEndOfDirective(const char *DirType, bool EnableMacros) { if (Tmp.isNot(tok::eom)) { // Add a fixit in GNU/C99/C++ mode. Don't offer a fixit for strict-C89, - // because it is more trouble than it is worth to insert /**/ and check that - // there is no /**/ in the range also. + // or if this is a macro-style preprocessing directive, because it is more + // trouble than it is worth to insert /**/ and check that there is no /**/ + // in the range also. FixItHint Hint; - if (Features.GNUMode || Features.C99 || Features.CPlusPlus) + if ((Features.GNUMode || Features.C99 || Features.CPlusPlus) && + !CurTokenLexer) Hint = FixItHint::CreateInsertion(Tmp.getLocation(),"//"); Diag(Tmp, diag::ext_pp_extra_tokens_at_eol) << DirType << Hint; DiscardUntilEndOfDirective(); |