Author: Alexander Kornienko Date: 2022-10-23T23:14:40+02:00 New Revision: e86161076e4a0633d7ab845037fe9443363a5a29
URL: https://github.com/llvm/llvm-project/commit/e86161076e4a0633d7ab845037fe9443363a5a29 DIFF: https://github.com/llvm/llvm-project/commit/e86161076e4a0633d7ab845037fe9443363a5a29.diff LOG: Revert "[TokenLexer][NFC] Rename the InstLoc to ExpandLoc" This reverts commit f83347b0bedb22ea676861c8e4e2ed9c31371ade. This is necessary to revert 74e4f778cf16cbf7163b5c6de6027a43f5e9169f, which caused a ~40% increase in SLoc address space utilization on certain cases. See https://reviews.llvm.org/D136539#3877872. Added: Modified: clang/lib/Lex/TokenLexer.cpp Removed: ################################################################################ diff --git a/clang/lib/Lex/TokenLexer.cpp b/clang/lib/Lex/TokenLexer.cpp index 0c35805c8c80..ecbc764a61ac 100644 --- a/clang/lib/Lex/TokenLexer.cpp +++ b/clang/lib/Lex/TokenLexer.cpp @@ -985,7 +985,7 @@ TokenLexer::getExpansionLocForMacroDefLoc(SourceLocation loc) const { /// \arg begin_tokens will be updated to a position past all the found /// consecutive tokens. static void updateConsecutiveMacroArgTokens(SourceManager &SM, - SourceLocation ExpandLoc, + SourceLocation InstLoc, Token *&begin_tokens, Token * end_tokens) { assert(begin_tokens + 1 < end_tokens); @@ -1021,7 +1021,7 @@ static void updateConsecutiveMacroArgTokens(SourceManager &SM, Partition.front().getLocation().getRawEncoding(); // Create a macro expansion SLocEntry that will "contain" all of the tokens. SourceLocation Expansion = - SM.createMacroArgExpansionLoc(BeginLoc, ExpandLoc, FullLength); + SM.createMacroArgExpansionLoc(BeginLoc, InstLoc, FullLength); #ifdef EXPENSIVE_CHECKS assert(llvm::all_of(Partition.drop_front(), @@ -1051,7 +1051,7 @@ void TokenLexer::updateLocForMacroArgTokens(SourceLocation ArgIdSpellLoc, Token *end_tokens) { SourceManager &SM = PP.getSourceManager(); - SourceLocation ExpandLoc = + SourceLocation InstLoc = getExpansionLocForMacroDefLoc(ArgIdSpellLoc); while (begin_tokens < end_tokens) { @@ -1059,12 +1059,12 @@ void TokenLexer::updateLocForMacroArgTokens(SourceLocation ArgIdSpellLoc, if (end_tokens - begin_tokens == 1) { Token &Tok = *begin_tokens; Tok.setLocation(SM.createMacroArgExpansionLoc(Tok.getLocation(), - ExpandLoc, + InstLoc, Tok.getLength())); return; } - updateConsecutiveMacroArgTokens(SM, ExpandLoc, begin_tokens, end_tokens); + updateConsecutiveMacroArgTokens(SM, InstLoc, begin_tokens, end_tokens); } } _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits