Author: yronglin Date: 2026-03-21T12:47:00+08:00 New Revision: f0a652e351d83146b252b7b642b7e498f2ea74aa
URL: https://github.com/llvm/llvm-project/commit/f0a652e351d83146b252b7b642b7e498f2ea74aa DIFF: https://github.com/llvm/llvm-project/commit/f0a652e351d83146b252b7b642b7e498f2ea74aa.diff LOG: [NFC][clang] Remove dead code in HandleCXXModuleDirective (#187737) Remove the dead code in `Preprocessor::HandleCXXModuleDirective`. Signed-off-by: yronglin <[email protected]> Added: Modified: clang/lib/Lex/PPDirectives.cpp Removed: ################################################################################ diff --git a/clang/lib/Lex/PPDirectives.cpp b/clang/lib/Lex/PPDirectives.cpp index 2f74199a8e4f3..09f0c3fe8c61e 100644 --- a/clang/lib/Lex/PPDirectives.cpp +++ b/clang/lib/Lex/PPDirectives.cpp @@ -4407,7 +4407,6 @@ void Preprocessor::HandleCXXModuleDirective(Token ModuleTok) { // Consume the pp-import-suffix and expand any macros in it now, if we're not // at the semicolon already. - SourceLocation End = DirToks.back().getLocation(); std::optional<Token> NextPPTok = DirToks.back(); if (DirToks.back().is(tok::eod)) { NextPPTok = peekNextPPToken(); @@ -4425,14 +4424,14 @@ void Preprocessor::HandleCXXModuleDirective(Token ModuleTok) { // Consume the pp-import-suffix and expand any macros in it now. We'll add // it back into the token stream later. CollectPPImportSuffix(DirToks); - End = DirToks.back().getLocation(); } - if (DirToks.back().isNot(tok::eod)) - End = CheckEndOfDirective(ModuleTok.getIdentifierInfo()->getName(), - /*EnableMacros=*/false, &DirToks); - else - End = DirToks.pop_back_val().getLocation(); + SourceLocation End = + DirToks.back().isNot(tok::eod) + ? CheckEndOfDirective(ModuleTok.getIdentifierInfo()->getName(), + /*EnableMacros=*/false, &DirToks) + + : DirToks.pop_back_val().getLocation(); if (!IncludeMacroStack.empty()) { Diag(StartLoc, diag::err_pp_module_decl_in_header) _______________________________________________ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
