From ca757587a3e524e0f58756e8efbea8aff4b020b9 Mon Sep 17 00:00:00 2001 From: Chandler Carruth Date: Mon, 25 Jul 2011 20:52:21 +0000 Subject: [PATCH] Rename SourceManager::getImmediateInstantiationRange to getImmediateExpansionRange. llvm-svn: 135960 --- clang/include/clang/Basic/SourceManager.h | 6 +++--- clang/lib/Basic/SourceManager.cpp | 10 +++++----- clang/lib/Frontend/TextDiagnosticPrinter.cpp | 4 ++-- clang/lib/Lex/Lexer.cpp | 2 +- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/clang/include/clang/Basic/SourceManager.h b/clang/include/clang/Basic/SourceManager.h index 6ade7b4ed5f1..6627391df96b 100644 --- a/clang/include/clang/Basic/SourceManager.h +++ b/clang/include/clang/Basic/SourceManager.h @@ -732,10 +732,10 @@ public: 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 - 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. diff --git a/clang/lib/Basic/SourceManager.cpp b/clang/lib/Basic/SourceManager.cpp index aad23ad6db37..30ea39e8a495 100644 --- a/clang/lib/Basic/SourceManager.cpp +++ b/clang/lib/Basic/SourceManager.cpp @@ -857,10 +857,10 @@ SourceLocation SourceManager::getImmediateSpellingLoc(SourceLocation Loc) const{ } -/// 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 -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 @@ SourceManager::getExpansionRange(SourceLocation Loc) const { if (Loc.isFileID()) return std::make_pair(Loc, Loc); std::pair 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; } diff --git a/clang/lib/Frontend/TextDiagnosticPrinter.cpp b/clang/lib/Frontend/TextDiagnosticPrinter.cpp index 2bd7394c4759..473c10deb6c2 100644 --- a/clang/lib/Frontend/TextDiagnosticPrinter.cpp +++ b/clang/lib/Frontend/TextDiagnosticPrinter.cpp @@ -322,7 +322,7 @@ static SourceLocation getImmediateMacroCallerLoc(const SourceManager &SM, // 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 @@ static SourceLocation getImmediateMacroCalleeLoc(const SourceManager &SM, // 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. diff --git a/clang/lib/Lex/Lexer.cpp b/clang/lib/Lex/Lexer.cpp index 320971a6b82e..faa1d9dab42e 100644 --- a/clang/lib/Lex/Lexer.cpp +++ b/clang/lib/Lex/Lexer.cpp @@ -912,7 +912,7 @@ static SourceLocation GetMappedTokenLoc(Preprocessor &PP, // Figure out the expansion loc range, which is the range covered by the // original _Pragma(...) sequence. std::pair II = - SM.getImmediateInstantiationRange(FileLoc); + SM.getImmediateExpansionRange(FileLoc); return SM.createInstantiationLoc(SpellingLoc, II.first, II.second, TokLen); }