]> granicus.if.org Git - clang/commitdiff
Rename SourceManager (and InstantiationInfo) isMacroArgInstantiation API
authorChandler Carruth <chandlerc@gmail.com>
Tue, 26 Jul 2011 03:03:00 +0000 (03:03 +0000)
committerChandler Carruth <chandlerc@gmail.com>
Tue, 26 Jul 2011 03:03:00 +0000 (03:03 +0000)
to isMacroArgExpansion.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136053 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Basic/SourceManager.h
lib/Basic/SourceManager.cpp
lib/Frontend/TextDiagnosticPrinter.cpp

index 413233c1d960a8b0a8d6603a67fe9bb22a20b792..74736017366f3323e755bb53a08beb7560c3f128 100644 (file)
@@ -259,7 +259,7 @@ namespace SrcMgr {
                             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 @@ public:
     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.
index 8f74e32ab2a9b0bdd68b3fc887a6275b5bc35dc7..c7de18252a48601cfaf7d1c4c08d689daadc52b7 100644 (file)
@@ -884,13 +884,13 @@ SourceManager::getExpansionRange(SourceLocation Loc) const {
   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();
 }
 
 
index f1659eb295ace42268484c136f050826a85f5d8d..c531ddd846134a2e7baa3c9990944b7873a18ab8 100644 (file)
@@ -300,7 +300,7 @@ static SourceLocation skipToMacroArgExpansion(const SourceManager &SM,
                                                   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 @@ static SourceLocation getImmediateMacroCallerLoc(const SourceManager &SM,
   // 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 @@ static SourceLocation getImmediateMacroCalleeLoc(const SourceManager &SM,
   // 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