diff options
author | Chris Lattner <sabre@nondot.org> | 2009-01-16 07:36:28 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-01-16 07:36:28 +0000 |
commit | f7cf85b330bedd2877e1371fb0a83e99751ae162 (patch) | |
tree | 6674dd8f06d3c395ab61ad9770934c49572e200c /lib/Lex | |
parent | 88054dee0402e4d3c1f64e6b697acc47195c0d72 (diff) |
more SourceLocation lexicon change: instead of referring to the
"logical" location, refer to the "instantiation" location.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62316 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 | 6 | ||||
-rw-r--r-- | lib/Lex/Preprocessor.cpp | 4 |
3 files changed, 9 insertions, 9 deletions
diff --git a/lib/Lex/Lexer.cpp b/lib/Lex/Lexer.cpp index 96295d042f..0eb439a27b 100644 --- a/lib/Lex/Lexer.cpp +++ b/lib/Lex/Lexer.cpp @@ -179,7 +179,7 @@ unsigned Lexer::MeasureTokenLength(SourceLocation Loc, const SourceManager &SM) { // If this comes from a macro expansion, we really do want the macro name, not // the token this macro expanded to. - Loc = SM.getLogicalLoc(Loc); + Loc = SM.getInstantiationLoc(Loc); const char *StrData = SM.getCharacterData(Loc); @@ -284,12 +284,12 @@ static SourceLocation GetMappedTokenLoc(Preprocessor &PP, // spelling location. SourceManager &SourceMgr = PP.getSourceManager(); - // Create a new SLoc which is expanded from logical(FileLoc) but whose + // Create a new SLoc which is expanded from Instantiation(FileLoc) but whose // characters come from spelling(FileLoc)+Offset. - SourceLocation VirtLoc = SourceMgr.getLogicalLoc(FileLoc); + SourceLocation InstLoc = SourceMgr.getInstantiationLoc(FileLoc); SourceLocation SpellingLoc = SourceMgr.getSpellingLoc(FileLoc); SpellingLoc = SourceLocation::getFileLoc(SpellingLoc.getFileID(), CharNo); - return SourceMgr.getInstantiationLoc(SpellingLoc, VirtLoc); + return SourceMgr.getInstantiationLoc(SpellingLoc, InstLoc); } /// getSourceLocation - Return a source location identifier for the specified diff --git a/lib/Lex/PPMacroExpansion.cpp b/lib/Lex/PPMacroExpansion.cpp index 81e44f4823..6c4096de6c 100644 --- a/lib/Lex/PPMacroExpansion.cpp +++ b/lib/Lex/PPMacroExpansion.cpp @@ -244,7 +244,7 @@ bool Preprocessor::HandleMacroExpandedIdentifier(Token &Identifier, Identifier.setFlagValue(Token::StartOfLine , isAtStartOfLine); Identifier.setFlagValue(Token::LeadingSpace, hasLeadingSpace); - // Update the tokens location to include both its logical and physical + // Update the tokens location to include both its instantiation and physical // locations. SourceLocation Loc = SourceMgr.getInstantiationLoc(Identifier.getLocation(), InstantiateLoc); @@ -453,7 +453,7 @@ void Preprocessor::ExpandBuiltinMacro(Token &Tok) { // it will tokenize as a number (and not run into stuff after it in the temp // buffer). sprintf(TmpBuffer, "%u ", - SourceMgr.getLogicalLineNumber(Tok.getLocation())); + SourceMgr.getInstantiationLineNumber(Tok.getLocation())); unsigned Length = strlen(TmpBuffer)-1; Tok.setKind(tok::numeric_constant); Tok.setLength(Length); @@ -470,7 +470,7 @@ void Preprocessor::ExpandBuiltinMacro(Token &Tok) { } // Escape this filename. Turn '\' -> '\\' '"' -> '\"' - std::string FN = SourceMgr.getSourceName(SourceMgr.getLogicalLoc(Loc)); + std::string FN =SourceMgr.getSourceName(SourceMgr.getInstantiationLoc(Loc)); FN = '"' + Lexer::Stringify(FN) + '"'; Tok.setKind(tok::string_literal); Tok.setLength(FN.size()); diff --git a/lib/Lex/Preprocessor.cpp b/lib/Lex/Preprocessor.cpp index 59632edaae..bbe0f5c0f9 100644 --- a/lib/Lex/Preprocessor.cpp +++ b/lib/Lex/Preprocessor.cpp @@ -140,7 +140,7 @@ void Preprocessor::DumpToken(const Token &Tok, bool DumpFlags) const { } void Preprocessor::DumpLocation(SourceLocation Loc) const { - SourceLocation LogLoc = SourceMgr.getLogicalLoc(Loc); + SourceLocation LogLoc = SourceMgr.getInstantiationLoc(Loc); llvm::cerr << SourceMgr.getSourceName(LogLoc) << ':' << SourceMgr.getLineNumber(LogLoc) << ':' << SourceMgr.getColumnNumber(LogLoc); @@ -314,7 +314,7 @@ SourceLocation Preprocessor::AdvanceToTokenCharacter(SourceLocation TokStart, // confusing. if (CharNo == 0 || TokStart.isMacroID()) return TokStart; - // Figure out how many physical characters away the specified logical + // Figure out how many physical characters away the specified instantiation // character is. This needs to take into consideration newlines and // trigraphs. const char *TokPtr = SourceMgr.getCharacterData(TokStart); |