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 /Driver/PrintPreprocessedOutput.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 'Driver/PrintPreprocessedOutput.cpp')
-rw-r--r-- | Driver/PrintPreprocessedOutput.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/Driver/PrintPreprocessedOutput.cpp b/Driver/PrintPreprocessedOutput.cpp index deb005ca4f..8c2ea707d8 100644 --- a/Driver/PrintPreprocessedOutput.cpp +++ b/Driver/PrintPreprocessedOutput.cpp @@ -124,7 +124,7 @@ bool PrintPPOutputPPCallbacks::MoveToLine(SourceLocation Loc) { if (LineNo-CurLine == 1) OS << '\n'; else if (LineNo == CurLine) - return false; // Phys line moved, but logical line didn't. + return false; // Spelling line moved, but logical line didn't. else { const char *NewLines = "\n\n\n\n\n\n\n\n"; OS.write(NewLines, LineNo-CurLine); @@ -200,7 +200,7 @@ void PrintPPOutputPPCallbacks::Ident(SourceLocation Loc, const std::string &S) { /// is called for the first token on each new line. If this really is the start /// of a new logical line, handle it and return true, otherwise return false. /// This may not be the start of a logical line because the "start of line" -/// marker is set for physical lines, not logical ones. +/// marker is set for spelling lines, not logical ones. bool PrintPPOutputPPCallbacks::HandleFirstTokOnLine(Token &Tok) { // Figure out what line we went to and insert the appropriate number of // newline characters. @@ -319,7 +319,7 @@ static void InitAvoidConcatTokenInfo() { static bool StartsWithL(const Token &Tok, Preprocessor &PP) { if (!Tok.needsCleaning()) { SourceManager &SrcMgr = PP.getSourceManager(); - return *SrcMgr.getCharacterData(SrcMgr.getPhysicalLoc(Tok.getLocation())) + return *SrcMgr.getCharacterData(SrcMgr.getSpellingLoc(Tok.getLocation())) == 'L'; } @@ -339,7 +339,7 @@ static bool IsIdentifierL(const Token &Tok, Preprocessor &PP) { if (Tok.getLength() != 1) return false; SourceManager &SrcMgr = PP.getSourceManager(); - return *SrcMgr.getCharacterData(SrcMgr.getPhysicalLoc(Tok.getLocation())) + return *SrcMgr.getCharacterData(SrcMgr.getSpellingLoc(Tok.getLocation())) == 'L'; } @@ -403,7 +403,7 @@ bool PrintPPOutputPPCallbacks::AvoidConcat(const Token &PrevTok, } else if (!Tok.needsCleaning()) { SourceManager &SrcMgr = PP.getSourceManager(); FirstChar = - *SrcMgr.getCharacterData(SrcMgr.getPhysicalLoc(Tok.getLocation())); + *SrcMgr.getCharacterData(SrcMgr.getSpellingLoc(Tok.getLocation())); } else if (Tok.getLength() < 256) { const char *TokPtr = Buffer; PP.getSpelling(Tok, TokPtr); |