diff options
author | Chandler Carruth <chandlerc@gmail.com> | 2011-07-26 03:03:05 +0000 |
---|---|---|
committer | Chandler Carruth <chandlerc@gmail.com> | 2011-07-26 03:03:05 +0000 |
commit | bf340e452339e374ea6eef78c1f0a2abdd16c5a3 (patch) | |
tree | 8c1f55248e74ac8a70ebc51ef84cde8bd51e20f9 /lib/Lex | |
parent | 96d3589e523a04f4ff2058a7919226ce60696ae8 (diff) |
Rename create(MacroArg)InstantiationLoc to create(MacroArg)ExpansionLoc.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136054 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Lex')
-rw-r--r-- | lib/Lex/Lexer.cpp | 8 | ||||
-rw-r--r-- | lib/Lex/PPMacroExpansion.cpp | 16 | ||||
-rw-r--r-- | lib/Lex/Preprocessor.cpp | 3 | ||||
-rw-r--r-- | lib/Lex/TokenLexer.cpp | 39 |
4 files changed, 32 insertions, 34 deletions
diff --git a/lib/Lex/Lexer.cpp b/lib/Lex/Lexer.cpp index faa1d9dab4..f5aa134788 100644 --- a/lib/Lex/Lexer.cpp +++ b/lib/Lex/Lexer.cpp @@ -187,9 +187,9 @@ Lexer *Lexer::Create_PragmaLexer(SourceLocation SpellingLoc, // Set the SourceLocation with the remapping information. This ensures that // GetMappedTokenLoc will remap the tokens as they are lexed. - L->FileLoc = SM.createInstantiationLoc(SM.getLocForStartOfFile(SpellingFID), - ExpansionLocStart, - ExpansionLocEnd, TokLen); + L->FileLoc = SM.createExpansionLoc(SM.getLocForStartOfFile(SpellingFID), + ExpansionLocStart, + ExpansionLocEnd, TokLen); // Ensure that the lexer thinks it is inside a directive, so that end \n will // return an EOD token. @@ -914,7 +914,7 @@ static SourceLocation GetMappedTokenLoc(Preprocessor &PP, std::pair<SourceLocation,SourceLocation> II = SM.getImmediateExpansionRange(FileLoc); - return SM.createInstantiationLoc(SpellingLoc, II.first, II.second, TokLen); + return SM.createExpansionLoc(SpellingLoc, II.first, II.second, TokLen); } /// getSourceLocation - Return a source location identifier for the specified diff --git a/lib/Lex/PPMacroExpansion.cpp b/lib/Lex/PPMacroExpansion.cpp index 52b1fd22da..5a88e5ff98 100644 --- a/lib/Lex/PPMacroExpansion.cpp +++ b/lib/Lex/PPMacroExpansion.cpp @@ -284,8 +284,8 @@ bool Preprocessor::HandleMacroExpandedIdentifier(Token &Identifier, // Update the tokens location to include both its expansion and physical // locations. SourceLocation Loc = - SourceMgr.createInstantiationLoc(Identifier.getLocation(), ExpandLoc, - ExpansionEnd,Identifier.getLength()); + SourceMgr.createExpansionLoc(Identifier.getLocation(), ExpandLoc, + ExpansionEnd,Identifier.getLength()); Identifier.setLocation(Loc); // If this is a disabled macro or #define X X, we must mark the result as @@ -875,18 +875,18 @@ void Preprocessor::ExpandBuiltinMacro(Token &Tok) { ComputeDATE_TIME(DATELoc, TIMELoc, *this); Tok.setKind(tok::string_literal); Tok.setLength(strlen("\"Mmm dd yyyy\"")); - Tok.setLocation(SourceMgr.createInstantiationLoc(DATELoc, Tok.getLocation(), - Tok.getLocation(), - Tok.getLength())); + Tok.setLocation(SourceMgr.createExpansionLoc(DATELoc, Tok.getLocation(), + Tok.getLocation(), + Tok.getLength())); return; } else if (II == Ident__TIME__) { if (!TIMELoc.isValid()) ComputeDATE_TIME(DATELoc, TIMELoc, *this); Tok.setKind(tok::string_literal); Tok.setLength(strlen("\"hh:mm:ss\"")); - Tok.setLocation(SourceMgr.createInstantiationLoc(TIMELoc, Tok.getLocation(), - Tok.getLocation(), - Tok.getLength())); + Tok.setLocation(SourceMgr.createExpansionLoc(TIMELoc, Tok.getLocation(), + Tok.getLocation(), + Tok.getLength())); return; } else if (II == Ident__INCLUDE_LEVEL__) { // Compute the presumed include depth of this token. This can be affected diff --git a/lib/Lex/Preprocessor.cpp b/lib/Lex/Preprocessor.cpp index fbdb903598..a5e86bdfe7 100644 --- a/lib/Lex/Preprocessor.cpp +++ b/lib/Lex/Preprocessor.cpp @@ -335,8 +335,7 @@ void Preprocessor::CreateString(const char *Buf, unsigned Len, Token &Tok, SourceLocation Loc = ScratchBuf->getToken(Buf, Len, DestPtr); if (ExpansionLoc.isValid()) - Loc = SourceMgr.createInstantiationLoc(Loc, ExpansionLoc, - ExpansionLoc, Len); + Loc = SourceMgr.createExpansionLoc(Loc, ExpansionLoc, ExpansionLoc, Len); Tok.setLocation(Loc); // If this is a raw identifier or a literal token, set the pointer data. diff --git a/lib/Lex/TokenLexer.cpp b/lib/Lex/TokenLexer.cpp index 22f94e097e..985b2a068e 100644 --- a/lib/Lex/TokenLexer.cpp +++ b/lib/Lex/TokenLexer.cpp @@ -57,10 +57,10 @@ void TokenLexer::Init(Token &Tok, SourceLocation ELEnd, MacroArgs *Actuals) { // creating separate source location entries for each token. SourceLocation macroStart = SM.getExpansionLoc(Tokens[0].getLocation()); MacroDefStartInfo = SM.getDecomposedLoc(macroStart); - MacroExpansionStart = SM.createInstantiationLoc(macroStart, - ExpandLocStart, - ExpandLocEnd, - Macro->getDefinitionLength(SM)); + MacroExpansionStart = SM.createExpansionLoc(macroStart, + ExpandLocStart, + ExpandLocEnd, + Macro->getDefinitionLength(SM)); } // If this is a function-like macro, expand the arguments and change @@ -231,9 +231,9 @@ void TokenLexer::ExpandFunctionArguments() { "Expected arg identifier to come from definition"); for (unsigned i = FirstResult, e = ResultToks.size(); i != e; ++i) { Token &Tok = ResultToks[i]; - Tok.setLocation(SM.createMacroArgInstantiationLoc(Tok.getLocation(), - curInst, - Tok.getLength())); + Tok.setLocation(SM.createMacroArgExpansionLoc(Tok.getLocation(), + curInst, + Tok.getLength())); } } @@ -289,9 +289,9 @@ void TokenLexer::ExpandFunctionArguments() { for (unsigned i = ResultToks.size() - NumToks, e = ResultToks.size(); i != e; ++i) { Token &Tok = ResultToks[i]; - Tok.setLocation(SM.createMacroArgInstantiationLoc(Tok.getLocation(), - curInst, - Tok.getLength())); + Tok.setLocation(SM.createMacroArgExpansionLoc(Tok.getLocation(), + curInst, + Tok.getLength())); } } @@ -421,10 +421,10 @@ void TokenLexer::Lex(Token &Tok) { MacroStartSLocOffset)) { SourceLocation instLoc; if (Tok.is(tok::comment)) { - instLoc = SM.createInstantiationLoc(Tok.getLocation(), - ExpandLocStart, - ExpandLocEnd, - Tok.getLength()); + instLoc = SM.createExpansionLoc(Tok.getLocation(), + ExpandLocStart, + ExpandLocEnd, + Tok.getLength()); } else { instLoc = getMacroExpansionLocation(Tok.getLocation()); assert(instLoc.isValid() && @@ -574,8 +574,7 @@ bool TokenLexer::PasteTokens(Token &Tok) { // information so that the user knows where it came from. SourceManager &SM = PP.getSourceManager(); SourceLocation Loc = - SM.createInstantiationLoc(PasteOpLoc, ExpandLocStart, - ExpandLocEnd, 2); + SM.createExpansionLoc(PasteOpLoc, ExpandLocStart, ExpandLocEnd, 2); // If we're in microsoft extensions mode, downgrade this from a hard // error to a warning that defaults to an error. This allows // disabling it. @@ -616,10 +615,10 @@ bool TokenLexer::PasteTokens(Token &Tok) { assert(pasteLocInst.isValid() && "Expected '##' to come from definition"); - Tok.setLocation(SM.createInstantiationLoc(Tok.getLocation(), - pasteLocInst, - pasteLocInst, - Tok.getLength())); + Tok.setLocation(SM.createExpansionLoc(Tok.getLocation(), + pasteLocInst, + pasteLocInst, + Tok.getLength())); } // Now that we got the result token, it will be subject to expansion. Since |