]> granicus.if.org Git - clang/commitdiff
Rename SourceManager::getInstantiationRange to getExpansionRange.
authorChandler Carruth <chandlerc@gmail.com>
Mon, 25 Jul 2011 16:56:02 +0000 (16:56 +0000)
committerChandler Carruth <chandlerc@gmail.com>
Mon, 25 Jul 2011 16:56:02 +0000 (16:56 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135915 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Basic/SourceManager.h
lib/ARCMigrate/TransformActions.cpp
lib/ARCMigrate/Transforms.cpp
lib/Basic/SourceManager.cpp
lib/Frontend/TextDiagnosticPrinter.cpp
lib/Lex/Lexer.cpp
lib/Lex/PPMacroExpansion.cpp
lib/Rewrite/HTMLRewrite.cpp
tools/libclang/CIndex.cpp

index 373125ea05112ea925a64a03465876ce29be0fbb..6ade7b4ed5f1cd893ffbddb6535f2089eb387961 100644 (file)
@@ -737,10 +737,10 @@ public:
   std::pair<SourceLocation,SourceLocation>
   getImmediateInstantiationRange(SourceLocation Loc) const;
 
-  /// getInstantiationRange - Given a SourceLocation object, return the
-  /// range of tokens covered by the instantiation in the ultimate file.
+  /// getExpansionRange - Given a SourceLocation object, return the range of
+  /// tokens covered by the expansion the ultimate file.
   std::pair<SourceLocation,SourceLocation>
-  getInstantiationRange(SourceLocation Loc) const;
+  getExpansionRange(SourceLocation Loc) const;
 
 
   /// getSpellingLoc - Given a SourceLocation object, return the spelling
index 0f498f1c20169127c78c2ada1747f31e724e0e03..65623a1b313abfa8c716cd6669de8800d4dd8dfe 100644 (file)
@@ -589,7 +589,7 @@ SourceLocation TransformActionsImpl::getLocForEndOfToken(SourceLocation loc,
                                                          SourceManager &SM,
                                                          Preprocessor &PP) {
   if (loc.isMacroID())
-    loc = SM.getInstantiationRange(loc).second;
+    loc = SM.getExpansionRange(loc).second;
   return PP.getLocForEndOfToken(loc);
 }
 
index 42bda9c44301322de8c31570f8cfca482810604d..c584d6a24362a1078d4c25a2a04c7cac5308aa8c 100644 (file)
@@ -95,7 +95,7 @@ SourceLocation trans::findLocationAfterSemi(SourceLocation loc,
   if (loc.isMacroID()) {
     if (!Lexer::isAtEndOfMacroExpansion(loc, SM, Ctx.getLangOptions()))
       return SourceLocation();
-    loc = SM.getInstantiationRange(loc).second;
+    loc = SM.getExpansionRange(loc).second;
   }
   loc = Lexer::getLocForEndOfToken(loc, /*Offset=*/0, SM, Ctx.getLangOptions());
 
index cbac7ffa31d4a7df8f5234f5b82afb4b1ff05669..aad23ad6db3714ca1a7e404f4e2ee7edda999c9b 100644 (file)
@@ -866,10 +866,10 @@ SourceManager::getImmediateInstantiationRange(SourceLocation Loc) const {
   return II.getInstantiationLocRange();
 }
 
-/// getInstantiationRange - Given a SourceLocation object, return the
-/// range of tokens covered by the instantiation in the ultimate file.
+/// getExpansionRange - Given a SourceLocation object, return the range of
+/// tokens covered by the expansion in the ultimate file.
 std::pair<SourceLocation,SourceLocation>
-SourceManager::getInstantiationRange(SourceLocation Loc) const {
+SourceManager::getExpansionRange(SourceLocation Loc) const {
   if (Loc.isFileID()) return std::make_pair(Loc, Loc);
 
   std::pair<SourceLocation,SourceLocation> Res =
index 1f766594034a9d69b5ef582329b40a9b2c7153c7..2bd7394c475982a7166d5053f643fc39dc85d57a 100644 (file)
@@ -94,7 +94,7 @@ void TextDiagnosticPrinter::HighlightRange(const CharSourceRange &R,
   // highlight the range.  If this is a function-like macro, we'd also like to
   // highlight the arguments.
   if (Begin == End && R.getEnd().isMacroID())
-    End = SM.getInstantiationRange(R.getEnd()).second;
+    End = SM.getExpansionRange(R.getEnd()).second;
 
   unsigned StartLineNo = SM.getInstantiationLineNumber(Begin);
   if (StartLineNo > LineNo || SM.getFileID(Begin) != FID)
@@ -932,7 +932,7 @@ void TextDiagnosticPrinter::HandleDiagnostic(Diagnostic::Level Level,
             // best we can do is to highlight the range.  If this is a
             // function-like macro, we'd also like to highlight the arguments.
             if (B == E && Info.getRange(i).getEnd().isMacroID())
-              E = SM.getInstantiationRange(Info.getRange(i).getEnd()).second;
+              E = SM.getExpansionRange(Info.getRange(i).getEnd()).second;
 
             std::pair<FileID, unsigned> BInfo = SM.getDecomposedLoc(B);
             std::pair<FileID, unsigned> EInfo = SM.getDecomposedLoc(E);
index 0ea8c12a72711402fec1925c05ae518976877fb0..320971a6b82eb774c8bafd4fdda344793c37b38c 100644 (file)
@@ -687,7 +687,7 @@ SourceLocation Lexer::getLocForEndOfToken(SourceLocation Loc, unsigned Offset,
       return SourceLocation(); // Points inside the macro expansion.
 
     // Continue and find the location just after the macro expansion.
-    Loc = SM.getInstantiationRange(Loc).second;
+    Loc = SM.getExpansionRange(Loc).second;
   }
 
   unsigned Len = Lexer::MeasureTokenLength(Loc, SM, Features);
index d4fb28046a6035f262cfaf71dfa2d074c1f59804..52b1fd22da190e6581452a4ce92e15a83d4f59fb 100644 (file)
@@ -838,7 +838,7 @@ void Preprocessor::ExpandBuiltinMacro(Token &Tok) {
     // can matter for a function-like macro that expands to contain __LINE__.
     // Skip down through expansion points until we find a file loc for the
     // end of the expansion history.
-    Loc = SourceMgr.getInstantiationRange(Loc).second;
+    Loc = SourceMgr.getExpansionRange(Loc).second;
     PresumedLoc PLoc = SourceMgr.getPresumedLoc(Loc);
 
     // __LINE__ expands to a simple numeric value.
index c76befbbd7f30e6d3f1660e179441a142a30e7ac..27f383f46ce4271abb26e5b8f0dfb22552ac3160 100644 (file)
@@ -519,7 +519,7 @@ void html::HighlightMacros(Rewriter &R, FileID FID, const Preprocessor& PP) {
     // expansion by inserting a start tag before the macro expansion and
     // end tag after it.
     std::pair<SourceLocation, SourceLocation> LLoc =
-      SM.getInstantiationRange(Tok.getLocation());
+      SM.getExpansionRange(Tok.getLocation());
 
     // Ignore tokens whose instantiation location was not the main file.
     if (SM.getFileID(LLoc.first) != FID) {
index 18842dc8278b37de4903d812f122dcf626bd2df8..df9304992cb7357be6154e325a982ecfeff8b090 100644 (file)
@@ -117,7 +117,7 @@ CXSourceRange cxloc::translateSourceRange(const SourceManager &SM,
   // location accordingly.
   SourceLocation EndLoc = R.getEnd();
   if (EndLoc.isValid() && EndLoc.isMacroID())
-    EndLoc = SM.getInstantiationRange(EndLoc).second;
+    EndLoc = SM.getExpansionRange(EndLoc).second;
   if (R.isTokenRange() && !EndLoc.isInvalid() && EndLoc.isFileID()) {
     unsigned Length = Lexer::MeasureTokenLength(EndLoc, SM, LangOpts);
     EndLoc = EndLoc.getFileLocWithOffset(Length);