diff options
author | Chris Lattner <sabre@nondot.org> | 2009-01-16 07:00:02 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-01-16 07:00:02 +0000 |
commit | df7c17a8d02fe09a3466786bae3e40fc3252687a (patch) | |
tree | 95d529de847149d8b289646aab44be886d019c6f /lib/Lex/Lexer.cpp | |
parent | 860f6d4af5f37a151d5e5ea3538dc4708cab5d68 (diff) |
Change some terminology in SourceLocation: instead of referring to
the "physical" location of tokens, refer to the "spelling" location.
This is more concrete and useful, tokens aren't really physical objects!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62309 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Lex/Lexer.cpp')
-rw-r--r-- | lib/Lex/Lexer.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/Lex/Lexer.cpp b/lib/Lex/Lexer.cpp index e6030ad1d4..96295d042f 100644 --- a/lib/Lex/Lexer.cpp +++ b/lib/Lex/Lexer.cpp @@ -68,7 +68,7 @@ Lexer::Lexer(SourceLocation fileloc, Preprocessor &pp, Features(pp.getLangOptions()) { SourceManager &SourceMgr = PP->getSourceManager(); - unsigned InputFileID = SourceMgr.getPhysicalLoc(FileLoc).getFileID(); + unsigned InputFileID = SourceMgr.getSpellingLoc(FileLoc).getFileID(); const llvm::MemoryBuffer *InputFile = SourceMgr.getBuffer(InputFileID); Is_PragmaLexer = false; @@ -281,15 +281,15 @@ static SourceLocation GetMappedTokenLoc(Preprocessor &PP, unsigned CharNo) { // Otherwise, we're lexing "mapped tokens". This is used for things like // _Pragma handling. Combine the instantiation location of FileLoc with the - // physical location. + // spelling location. SourceManager &SourceMgr = PP.getSourceManager(); // Create a new SLoc which is expanded from logical(FileLoc) but whose - // characters come from phys(FileLoc)+Offset. + // characters come from spelling(FileLoc)+Offset. SourceLocation VirtLoc = SourceMgr.getLogicalLoc(FileLoc); - SourceLocation PhysLoc = SourceMgr.getPhysicalLoc(FileLoc); - PhysLoc = SourceLocation::getFileLoc(PhysLoc.getFileID(), CharNo); - return SourceMgr.getInstantiationLoc(PhysLoc, VirtLoc); + SourceLocation SpellingLoc = SourceMgr.getSpellingLoc(FileLoc); + SpellingLoc = SourceLocation::getFileLoc(SpellingLoc.getFileID(), CharNo); + return SourceMgr.getInstantiationLoc(SpellingLoc, VirtLoc); } /// getSourceLocation - Return a source location identifier for the specified |