[cfe-commits] r135960 - in /cfe/trunk: include/clang/Basic/SourceManager.h lib/Basic/SourceManager.cpp lib/Frontend/TextDiagnosticPrinter.cpp lib/Lex/Lexer.cpp

Chandler Carruth chandlerc at gmail.com
Mon Jul 25 13:52:21 PDT 2011


Author: chandlerc
Date: Mon Jul 25 15:52:21 2011
New Revision: 135960

URL: http://llvm.org/viewvc/llvm-project?rev=135960&view=rev
Log:
Rename SourceManager::getImmediateInstantiationRange to
getImmediateExpansionRange.

Modified:
    cfe/trunk/include/clang/Basic/SourceManager.h
    cfe/trunk/lib/Basic/SourceManager.cpp
    cfe/trunk/lib/Frontend/TextDiagnosticPrinter.cpp
    cfe/trunk/lib/Lex/Lexer.cpp

Modified: cfe/trunk/include/clang/Basic/SourceManager.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/SourceManager.h?rev=135960&r1=135959&r2=135960&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/SourceManager.h (original)
+++ cfe/trunk/include/clang/Basic/SourceManager.h Mon Jul 25 15:52:21 2011
@@ -732,10 +732,10 @@
     return getInstantiationLocSlowCase(Loc);
   }
 
-  /// getImmediateInstantiationRange - Loc is required to be an instantiation
-  /// location.  Return the start/end of the instantiation information.
+  /// getImmediateExpansionRange - Loc is required to be an expansion location.
+  /// Return the start/end of the expansion information.
   std::pair<SourceLocation,SourceLocation>
-  getImmediateInstantiationRange(SourceLocation Loc) const;
+  getImmediateExpansionRange(SourceLocation Loc) const;
 
   /// getExpansionRange - Given a SourceLocation object, return the range of
   /// tokens covered by the expansion the ultimate file.

Modified: cfe/trunk/lib/Basic/SourceManager.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/SourceManager.cpp?rev=135960&r1=135959&r2=135960&view=diff
==============================================================================
--- cfe/trunk/lib/Basic/SourceManager.cpp (original)
+++ cfe/trunk/lib/Basic/SourceManager.cpp Mon Jul 25 15:52:21 2011
@@ -857,10 +857,10 @@
 }
 
 
-/// getImmediateInstantiationRange - Loc is required to be an instantiation
+/// getImmediateExpansionRange - Loc is required to be an instantiation
 /// location.  Return the start/end of the instantiation information.
 std::pair<SourceLocation,SourceLocation>
-SourceManager::getImmediateInstantiationRange(SourceLocation Loc) const {
+SourceManager::getImmediateExpansionRange(SourceLocation Loc) const {
   assert(Loc.isMacroID() && "Not an instantiation loc!");
   const InstantiationInfo &II = getSLocEntry(getFileID(Loc)).getInstantiation();
   return II.getInstantiationLocRange();
@@ -873,14 +873,14 @@
   if (Loc.isFileID()) return std::make_pair(Loc, Loc);
 
   std::pair<SourceLocation,SourceLocation> Res =
-    getImmediateInstantiationRange(Loc);
+    getImmediateExpansionRange(Loc);
 
   // Fully resolve the start and end locations to their ultimate instantiation
   // points.
   while (!Res.first.isFileID())
-    Res.first = getImmediateInstantiationRange(Res.first).first;
+    Res.first = getImmediateExpansionRange(Res.first).first;
   while (!Res.second.isFileID())
-    Res.second = getImmediateInstantiationRange(Res.second).second;
+    Res.second = getImmediateExpansionRange(Res.second).second;
   return Res;
 }
 

Modified: cfe/trunk/lib/Frontend/TextDiagnosticPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/TextDiagnosticPrinter.cpp?rev=135960&r1=135959&r2=135960&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/TextDiagnosticPrinter.cpp (original)
+++ cfe/trunk/lib/Frontend/TextDiagnosticPrinter.cpp Mon Jul 25 15:52:21 2011
@@ -322,7 +322,7 @@
 
   // Otherwise, the caller of the macro is located where this macro is
   // expanded (while the spelling is part of the macro definition).
-  return SM.getImmediateInstantiationRange(Loc).first;
+  return SM.getImmediateExpansionRange(Loc).first;
 }
 
 /// Gets the location of the immediate macro callee, one level down the stack
@@ -335,7 +335,7 @@
   // expansion location points to the unexpanded paramater reference within
   // the macro definition (or callee).
   if (SM.isMacroArgInstantiation(Loc))
-    return SM.getImmediateInstantiationRange(Loc).first;
+    return SM.getImmediateExpansionRange(Loc).first;
 
   // Otherwise, the callee of the macro is located where this location was
   // spelled inside the macro definition.

Modified: cfe/trunk/lib/Lex/Lexer.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Lex/Lexer.cpp?rev=135960&r1=135959&r2=135960&view=diff
==============================================================================
--- cfe/trunk/lib/Lex/Lexer.cpp (original)
+++ cfe/trunk/lib/Lex/Lexer.cpp Mon Jul 25 15:52:21 2011
@@ -912,7 +912,7 @@
   // Figure out the expansion loc range, which is the range covered by the
   // original _Pragma(...) sequence.
   std::pair<SourceLocation,SourceLocation> II =
-    SM.getImmediateInstantiationRange(FileLoc);
+    SM.getImmediateExpansionRange(FileLoc);
 
   return SM.createInstantiationLoc(SpellingLoc, II.first, II.second, TokLen);
 }





More information about the cfe-commits mailing list