diff options
author | Eugene Zelenko <eugene.zelenko@gmail.com> | 2016-02-12 22:53:10 +0000 |
---|---|---|
committer | Eugene Zelenko <eugene.zelenko@gmail.com> | 2016-02-12 22:53:10 +0000 |
commit | 1ced5095e4c621373ec4d24927216af67a28fe37 (patch) | |
tree | 8303fc76bead3a0ac79d1df61e095bc34f44ee0b /clang/lib/Lex/PPDirectives.cpp | |
parent | b534ce46bd40eaa909a20f40ae576a2627da4f90 (diff) | |
download | bcm5719-llvm-1ced5095e4c621373ec4d24927216af67a28fe37.tar.gz bcm5719-llvm-1ced5095e4c621373ec4d24927216af67a28fe37.zip |
Fix remaining Clang-tidy readability-redundant-control-flow warnings; other minor fixes.
Differential revision: http://reviews.llvm.org/D17218
llvm-svn: 260757
Diffstat (limited to 'clang/lib/Lex/PPDirectives.cpp')
-rw-r--r-- | clang/lib/Lex/PPDirectives.cpp | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/clang/lib/Lex/PPDirectives.cpp b/clang/lib/Lex/PPDirectives.cpp index 1c74a1702a7..cbb079c5186 100644 --- a/clang/lib/Lex/PPDirectives.cpp +++ b/clang/lib/Lex/PPDirectives.cpp @@ -27,6 +27,7 @@ #include "llvm/Support/ErrorHandling.h" #include "llvm/Support/Path.h" #include "llvm/Support/SaveAndRestore.h" + using namespace clang; //===----------------------------------------------------------------------===// @@ -272,8 +273,6 @@ void Preprocessor::CheckEndOfDirective(const char *DirType, bool EnableMacros) { } } - - /// SkipExcludedConditionalBlock - We just read a \#if or related directive and /// decided that the subsequent tokens are in the \#if'd out portion of the /// file. Lex the rest of the file, until we see an \#endif. If @@ -497,7 +496,6 @@ void Preprocessor::SkipExcludedConditionalBlock(SourceLocation IfTokenLoc, } void Preprocessor::PTHSkipExcludedConditionalBlock() { - while (1) { assert(CurPTHLexer); assert(CurPTHLexer->LexingRawMode == false); @@ -571,7 +569,6 @@ void Preprocessor::PTHSkipExcludedConditionalBlock() { } // Otherwise, skip this block and go to the next one. - continue; } } @@ -728,7 +725,6 @@ const FileEntry *Preprocessor::LookupFile( return nullptr; } - //===----------------------------------------------------------------------===// // Preprocessor Directive Handling. //===----------------------------------------------------------------------===// @@ -740,9 +736,11 @@ public: if (pp->MacroExpansionInDirectivesOverride) pp->DisableMacroExpansion = false; } + ~ResetMacroExpansionHelper() { PP->DisableMacroExpansion = save; } + private: Preprocessor *PP; bool save; @@ -1210,7 +1208,6 @@ void Preprocessor::HandleDigitDirective(Token &DigitTok) { } } - /// HandleUserDiagnosticDirective - Handle a #warning or #error directive. /// void Preprocessor::HandleUserDiagnosticDirective(Token &Tok, @@ -1506,7 +1503,6 @@ void Preprocessor::HandleIncludeDirective(SourceLocation HashLoc, const DirectoryLookup *LookupFrom, const FileEntry *LookupFromFile, bool isImport) { - Token FilenameTok; CurPPLexer->LexIncludeFilename(FilenameTok); @@ -2147,7 +2143,6 @@ void Preprocessor::HandleDefineDirective(Token &DefineTok, // Get the next token of the macro. LexUnexpandedToken(Tok); } - } else { // Otherwise, read the body of a function-like macro. While we are at it, // check C99 6.10.3.2p1: ensure that # operators are followed by macro @@ -2176,7 +2171,6 @@ void Preprocessor::HandleDefineDirective(Token &DefineTok, } if (Tok.is(tok::hashhash)) { - // If we see token pasting, check if it looks like the gcc comma // pasting extension. We'll use this information to suppress // diagnostics later on. @@ -2365,7 +2359,6 @@ void Preprocessor::HandleUndefDirective(Token &UndefTok) { AllocateUndefMacroDirective(MacroNameTok.getLocation())); } - //===----------------------------------------------------------------------===// // Preprocessor Conditional Directive Handling. //===----------------------------------------------------------------------===// |