diff options
author | Fangrui Song <i@maskray.me> | 2022-08-08 09:12:46 -0700 |
---|---|---|
committer | Fangrui Song <i@maskray.me> | 2022-08-08 09:12:46 -0700 |
commit | 3f18f7c0072b642f5fe88d2fb7bb8ccf69a6c6f5 (patch) | |
tree | 2ed06fc833ad0fee4f6de6904ee1b828c14a7d48 /clang/lib/Lex | |
parent | 521a5c11acb45fe4672ed63e3f6aa1f22b0e9fbe (diff) | |
download | llvm-3f18f7c0072b642f5fe88d2fb7bb8ccf69a6c6f5.zip llvm-3f18f7c0072b642f5fe88d2fb7bb8ccf69a6c6f5.tar.gz llvm-3f18f7c0072b642f5fe88d2fb7bb8ccf69a6c6f5.tar.bz2 |
[clang] LLVM_FALLTHROUGH => [[fallthrough]]. NFC
With C++17 there is no Clang pedantic warning or MSVC C5051.
Reviewed By: aaron.ballman
Differential Revision: https://reviews.llvm.org/D131346
Diffstat (limited to 'clang/lib/Lex')
-rw-r--r-- | clang/lib/Lex/InitHeaderSearch.cpp | 2 | ||||
-rw-r--r-- | clang/lib/Lex/Lexer.cpp | 6 | ||||
-rw-r--r-- | clang/lib/Lex/LiteralSupport.cpp | 8 | ||||
-rw-r--r-- | clang/lib/Lex/ModuleMap.cpp | 2 | ||||
-rw-r--r-- | clang/lib/Lex/Preprocessor.cpp | 4 | ||||
-rw-r--r-- | clang/lib/Lex/TokenConcatenation.cpp | 2 |
6 files changed, 12 insertions, 12 deletions
diff --git a/clang/lib/Lex/InitHeaderSearch.cpp b/clang/lib/Lex/InitHeaderSearch.cpp index 158b566..cd32763 100644 --- a/clang/lib/Lex/InitHeaderSearch.cpp +++ b/clang/lib/Lex/InitHeaderSearch.cpp @@ -246,7 +246,7 @@ void InitHeaderSearch::AddDefaultCIncludePaths(const llvm::Triple &triple, case llvm::Triple::Win32: if (triple.getEnvironment() != llvm::Triple::Cygnus) break; - LLVM_FALLTHROUGH; + [[fallthrough]]; default: // FIXME: temporary hack: hard-coded paths. AddPath("/usr/local/include", System, false); diff --git a/clang/lib/Lex/Lexer.cpp b/clang/lib/Lex/Lexer.cpp index 64655b9..83c31bc 100644 --- a/clang/lib/Lex/Lexer.cpp +++ b/clang/lib/Lex/Lexer.cpp @@ -2905,7 +2905,7 @@ void Lexer::ReadToEndOfLine(SmallVectorImpl<char> *Result) { break; } // FALL THROUGH. - LLVM_FALLTHROUGH; + [[fallthrough]]; case '\r': case '\n': // Okay, we found the end of the line. First, back up past the \0, \r, \n. @@ -3591,7 +3591,7 @@ LexNextToken: case '\r': if (CurPtr[0] == '\n') (void)getAndAdvanceChar(CurPtr, Result); - LLVM_FALLTHROUGH; + [[fallthrough]]; case '\n': // If we are inside a preprocessor directive and we see the end of line, // we know we are done with the directive, so return an EOD token. @@ -3788,7 +3788,7 @@ LexNextToken: return LexCharConstant(Result, ConsumeChar(CurPtr, SizeTmp, Result), tok::wide_char_constant); // FALL THROUGH, treating L like the start of an identifier. - LLVM_FALLTHROUGH; + [[fallthrough]]; // C99 6.4.2: Identifiers. case 'A': case 'B': case 'C': case 'D': case 'E': case 'F': case 'G': diff --git a/clang/lib/Lex/LiteralSupport.cpp b/clang/lib/Lex/LiteralSupport.cpp index 53635a7..1a48a68 100644 --- a/clang/lib/Lex/LiteralSupport.cpp +++ b/clang/lib/Lex/LiteralSupport.cpp @@ -766,13 +766,13 @@ static void EncodeUCNEscape(const char *ThisTokBegin, const char *&ThisTokBuf, switch (bytesToWrite) { // note: everything falls through. case 4: *--ResultBuf = (UTF8)((UcnVal | byteMark) & byteMask); UcnVal >>= 6; - LLVM_FALLTHROUGH; + [[fallthrough]]; case 3: *--ResultBuf = (UTF8)((UcnVal | byteMark) & byteMask); UcnVal >>= 6; - LLVM_FALLTHROUGH; + [[fallthrough]]; case 2: *--ResultBuf = (UTF8)((UcnVal | byteMark) & byteMask); UcnVal >>= 6; - LLVM_FALLTHROUGH; + [[fallthrough]]; case 1: *--ResultBuf = (UTF8) (UcnVal | firstByteMark[bytesToWrite]); } @@ -1037,7 +1037,7 @@ NumericLiteralParser::NumericLiteralParser(StringRef TokSpelling, break; } } - LLVM_FALLTHROUGH; + [[fallthrough]]; case 'j': case 'J': if (isImaginary) break; // Cannot be repeated. diff --git a/clang/lib/Lex/ModuleMap.cpp b/clang/lib/Lex/ModuleMap.cpp index 47d6f58..3698a8c 100644 --- a/clang/lib/Lex/ModuleMap.cpp +++ b/clang/lib/Lex/ModuleMap.cpp @@ -1668,7 +1668,7 @@ retry: break; } } - LLVM_FALLTHROUGH; + [[fallthrough]]; default: Diags.Report(Tok.getLocation(), diag::err_mmap_unknown_token); diff --git a/clang/lib/Lex/Preprocessor.cpp b/clang/lib/Lex/Preprocessor.cpp index 5310db3..8c4859d 100644 --- a/clang/lib/Lex/Preprocessor.cpp +++ b/clang/lib/Lex/Preprocessor.cpp @@ -986,7 +986,7 @@ void Preprocessor::Lex(Token &Result) { TrackGMFState.handleModule(ImportSeqState.afterTopLevelSeq()); break; } - LLVM_FALLTHROUGH; + [[fallthrough]]; default: TrackGMFState.handleMisc(); ImportSeqState.handleMisc(); @@ -1232,7 +1232,7 @@ bool Preprocessor::LexAfterModuleImport(Token &Result) { Suffix.back().setLocation(SemiLoc); Suffix.back().setAnnotationEndLoc(SemiLoc); Suffix.back().setAnnotationValue(Action.ModuleForHeader); - LLVM_FALLTHROUGH; + [[fallthrough]]; case ImportAction::ModuleImport: case ImportAction::HeaderUnitImport: diff --git a/clang/lib/Lex/TokenConcatenation.cpp b/clang/lib/Lex/TokenConcatenation.cpp index f6b005d..1b3201b 100644 --- a/clang/lib/Lex/TokenConcatenation.cpp +++ b/clang/lib/Lex/TokenConcatenation.cpp @@ -240,7 +240,7 @@ bool TokenConcatenation::AvoidConcat(const Token &PrevPrevTok, // it as an identifier. if (!PrevTok.hasUDSuffix()) return false; - LLVM_FALLTHROUGH; + [[fallthrough]]; case tok::identifier: // id+id or id+number or id+L"foo". // id+'.'... will not append. if (Tok.is(tok::numeric_constant)) |