summaryrefslogtreecommitdiffstats
path: root/lib/Lex/TokenLexer.cpp
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2011-08-19 22:34:14 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2011-08-19 22:34:14 +0000
commitec3b5389a5032433116ec2f2ee266b9666ad2eb4 (patch)
tree2b6349cbfa047de945cff99080caf812d7cad155 /lib/Lex/TokenLexer.cpp
parent54232ade44d31e98ea83f43ca066128e315dcbda (diff)
Rename TokenLexer::getMacroExpansionLocation -> getExpansionLocForMacroDefLoc, no functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138128 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Lex/TokenLexer.cpp')
-rw-r--r--lib/Lex/TokenLexer.cpp18
1 files changed, 10 insertions, 8 deletions
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());