[cfe-commits] r136053 - in /cfe/trunk: include/clang/Basic/SourceManager.h lib/Basic/SourceManager.cpp lib/Frontend/TextDiagnosticPrinter.cpp
Chandler Carruth
chandlerc at gmail.com
Mon Jul 25 20:03:00 PDT 2011
Author: chandlerc
Date: Mon Jul 25 22:03:00 2011
New Revision: 136053
URL: http://llvm.org/viewvc/llvm-project?rev=136053&view=rev
Log:
Rename SourceManager (and InstantiationInfo) isMacroArgInstantiation API
to isMacroArgExpansion.
Modified:
cfe/trunk/include/clang/Basic/SourceManager.h
cfe/trunk/lib/Basic/SourceManager.cpp
cfe/trunk/lib/Frontend/TextDiagnosticPrinter.cpp
Modified: cfe/trunk/include/clang/Basic/SourceManager.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/SourceManager.h?rev=136053&r1=136052&r2=136053&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/SourceManager.h (original)
+++ cfe/trunk/include/clang/Basic/SourceManager.h Mon Jul 25 22:03:00 2011
@@ -259,7 +259,7 @@
getInstantiationLocEnd());
}
- bool isMacroArgInstantiation() const {
+ bool isMacroArgExpansion() const {
// Note that this needs to return false for default constructed objects.
return getInstantiationLocStart().isValid() &&
SourceLocation::getFromRawEncoding(InstantiationLocEnd).isInvalid();
@@ -803,12 +803,12 @@
return getDecomposedLoc(SpellingLoc).second;
}
- /// isMacroArgInstantiation - This method tests whether the given source
- /// location represents a macro argument's instantiation into the
- /// function-like macro definition. Such source locations only appear inside
- /// of the instantiation locations representing where a particular
- /// function-like macro was expanded.
- bool isMacroArgInstantiation(SourceLocation Loc) const;
+ /// isMacroArgExpansion - This method tests whether the given source location
+ /// represents a macro argument's expansion into the function-like macro
+ /// definition. Such source locations only appear inside of the expansion
+ /// locations representing where a particular function-like macro was
+ /// expanded.
+ bool isMacroArgExpansion(SourceLocation Loc) const;
//===--------------------------------------------------------------------===//
// Queries about the code at a SourceLocation.
Modified: cfe/trunk/lib/Basic/SourceManager.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/SourceManager.cpp?rev=136053&r1=136052&r2=136053&view=diff
==============================================================================
--- cfe/trunk/lib/Basic/SourceManager.cpp (original)
+++ cfe/trunk/lib/Basic/SourceManager.cpp Mon Jul 25 22:03:00 2011
@@ -884,13 +884,13 @@
return Res;
}
-bool SourceManager::isMacroArgInstantiation(SourceLocation Loc) const {
+bool SourceManager::isMacroArgExpansion(SourceLocation Loc) const {
if (!Loc.isMacroID()) return false;
FileID FID = getFileID(Loc);
const SrcMgr::SLocEntry *E = &getSLocEntry(FID);
const SrcMgr::InstantiationInfo &II = E->getInstantiation();
- return II.isMacroArgInstantiation();
+ return II.isMacroArgExpansion();
}
Modified: cfe/trunk/lib/Frontend/TextDiagnosticPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/TextDiagnosticPrinter.cpp?rev=136053&r1=136052&r2=136053&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/TextDiagnosticPrinter.cpp (original)
+++ cfe/trunk/lib/Frontend/TextDiagnosticPrinter.cpp Mon Jul 25 22:03:00 2011
@@ -300,7 +300,7 @@
SourceLocation StartLoc) {
for (SourceLocation L = StartLoc; L.isMacroID();
L = SM.getImmediateSpellingLoc(L)) {
- if (SM.isMacroArgInstantiation(L))
+ if (SM.isMacroArgExpansion(L))
return L;
}
@@ -317,7 +317,7 @@
// When we have the location of (part of) an expanded parameter, its spelling
// location points to the argument as typed into the macro call, and
// therefore is used to locate the macro caller.
- if (SM.isMacroArgInstantiation(Loc))
+ if (SM.isMacroArgExpansion(Loc))
return SM.getImmediateSpellingLoc(Loc);
// Otherwise, the caller of the macro is located where this macro is
@@ -334,7 +334,7 @@
// When we have the location of (part of) an expanded parameter, its
// expansion location points to the unexpanded paramater reference within
// the macro definition (or callee).
- if (SM.isMacroArgInstantiation(Loc))
+ if (SM.isMacroArgExpansion(Loc))
return SM.getImmediateExpansionRange(Loc).first;
// Otherwise, the callee of the macro is located where this location was
More information about the cfe-commits
mailing list