From: Argyrios Kyrtzidis Date: Fri, 19 Aug 2011 22:34:14 +0000 (+0000) Subject: Rename TokenLexer::getMacroExpansionLocation -> getExpansionLocForMacroDefLoc, no... X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ec3b5389a5032433116ec2f2ee266b9666ad2eb4;p=clang Rename TokenLexer::getMacroExpansionLocation -> getExpansionLocForMacroDefLoc, no functionality change. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138128 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/Lex/TokenLexer.h b/include/clang/Lex/TokenLexer.h index 45ff8a0344..24aed76db4 100644 --- a/include/clang/Lex/TokenLexer.h +++ b/include/clang/Lex/TokenLexer.h @@ -169,7 +169,7 @@ private: /// \brief If \arg loc is a FileID and points inside the current macro /// definition, returns the appropriate source location pointing at the /// macro expansion source location entry. - SourceLocation getMacroExpansionLocation(SourceLocation loc) const; + SourceLocation getExpansionLocForMacroDefLoc(SourceLocation loc) const; }; } // end namespace clang diff --git a/lib/Lex/TokenLexer.cpp b/lib/Lex/TokenLexer.cpp index 985b2a068e..befd12af39 100644 --- a/lib/Lex/TokenLexer.cpp +++ b/lib/Lex/TokenLexer.cpp @@ -146,7 +146,7 @@ void TokenLexer::ExpandFunctionArguments() { SourceLocation hashInstLoc; if(ExpandLocStart.isValid()) { - hashInstLoc = getMacroExpansionLocation(CurTok.getLocation()); + hashInstLoc = getExpansionLocForMacroDefLoc(CurTok.getLocation()); assert(hashInstLoc.isValid() && "Expected '#' to come from definition"); } @@ -226,7 +226,7 @@ void TokenLexer::ExpandFunctionArguments() { if(ExpandLocStart.isValid()) { SourceLocation curInst = - getMacroExpansionLocation(CurTok.getLocation()); + getExpansionLocForMacroDefLoc(CurTok.getLocation()); assert(curInst.isValid() && "Expected arg identifier to come from definition"); for (unsigned i = FirstResult, e = ResultToks.size(); i != e; ++i) { @@ -283,7 +283,7 @@ void TokenLexer::ExpandFunctionArguments() { if (ExpandLocStart.isValid()) { SourceLocation curInst = - getMacroExpansionLocation(CurTok.getLocation()); + getExpansionLocForMacroDefLoc(CurTok.getLocation()); assert(curInst.isValid() && "Expected arg identifier to come from definition"); for (unsigned i = ResultToks.size() - NumToks, e = ResultToks.size(); @@ -426,7 +426,7 @@ void TokenLexer::Lex(Token &Tok) { ExpandLocEnd, Tok.getLength()); } else { - instLoc = getMacroExpansionLocation(Tok.getLocation()); + instLoc = getExpansionLocForMacroDefLoc(Tok.getLocation()); assert(instLoc.isValid() && "Location for token not coming from definition was not set!"); } @@ -611,7 +611,7 @@ bool TokenLexer::PasteTokens(Token &Tok) { if (ExpandLocStart.isValid()) { SourceManager &SM = PP.getSourceManager(); SourceLocation pasteLocInst = - getMacroExpansionLocation(PasteOpLoc); + getExpansionLocForMacroDefLoc(PasteOpLoc); assert(pasteLocInst.isValid() && "Expected '##' to come from definition"); @@ -665,10 +665,12 @@ void TokenLexer::HandleMicrosoftCommentPaste(Token &Tok) { PP.HandleMicrosoftCommentPaste(Tok); } -/// \brief If \arg loc is a FileID and points inside the current macro +/// \brief If \arg loc is a file ID and points inside the current macro /// definition, returns the appropriate source location pointing at the -/// macro expansion source location entry. -SourceLocation TokenLexer::getMacroExpansionLocation(SourceLocation loc) const { +/// macro expansion source location entry, otherwise it returns an invalid +/// SourceLocation. +SourceLocation +TokenLexer::getExpansionLocForMacroDefLoc(SourceLocation loc) const { assert(ExpandLocStart.isValid() && MacroExpansionStart.isValid() && "Not appropriate for token streams"); assert(loc.isValid());