[cfe-commits] r138128 - in /cfe/trunk: include/clang/Lex/TokenLexer.h lib/Lex/TokenLexer.cpp
Argyrios Kyrtzidis
akyrtzi at gmail.com
Fri Aug 19 15:34:14 PDT 2011
Author: akirtzidis
Date: Fri Aug 19 17:34:14 2011
New Revision: 138128
URL: http://llvm.org/viewvc/llvm-project?rev=138128&view=rev
Log:
Rename TokenLexer::getMacroExpansionLocation -> getExpansionLocForMacroDefLoc, no functionality change.
Modified:
cfe/trunk/include/clang/Lex/TokenLexer.h
cfe/trunk/lib/Lex/TokenLexer.cpp
Modified: cfe/trunk/include/clang/Lex/TokenLexer.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Lex/TokenLexer.h?rev=138128&r1=138127&r2=138128&view=diff
==============================================================================
--- cfe/trunk/include/clang/Lex/TokenLexer.h (original)
+++ cfe/trunk/include/clang/Lex/TokenLexer.h Fri Aug 19 17:34:14 2011
@@ -169,7 +169,7 @@
/// \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
Modified: cfe/trunk/lib/Lex/TokenLexer.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Lex/TokenLexer.cpp?rev=138128&r1=138127&r2=138128&view=diff
==============================================================================
--- cfe/trunk/lib/Lex/TokenLexer.cpp (original)
+++ cfe/trunk/lib/Lex/TokenLexer.cpp Fri Aug 19 17:34:14 2011
@@ -146,7 +146,7 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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());
More information about the cfe-commits
mailing list