more SourceLocation lexicon change: instead of referring to the
"logical" location, refer to the "instantiation" location.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62316 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/Driver/DiagChecker.cpp b/Driver/DiagChecker.cpp
index 6f4cd7c..8fa827a 100644
--- a/Driver/DiagChecker.cpp
+++ b/Driver/DiagChecker.cpp
@@ -167,7 +167,7 @@
for (const_diag_iterator I = diag_begin, E = diag_end; I != E; ++I)
fprintf(stderr, " Line %d: %s\n",
- SourceMgr.getLogicalLineNumber(I->first),
+ SourceMgr.getInstantiationLineNumber(I->first),
I->second.c_str());
return true;
@@ -185,12 +185,12 @@
DiagList DiffList;
for (const_diag_iterator I = d1_begin, E = d1_end; I != E; ++I) {
- unsigned LineNo1 = SourceMgr.getLogicalLineNumber(I->first);
+ unsigned LineNo1 = SourceMgr.getInstantiationLineNumber(I->first);
const std::string &Diag1 = I->second;
bool Found = false;
for (const_diag_iterator II = d2_begin, IE = d2_end; II != IE; ++II) {
- unsigned LineNo2 = SourceMgr.getLogicalLineNumber(II->first);
+ unsigned LineNo2 = SourceMgr.getInstantiationLineNumber(II->first);
if (LineNo1 != LineNo2) continue;
const std::string &Diag2 = II->second;
diff --git a/Driver/PrintPreprocessedOutput.cpp b/Driver/PrintPreprocessedOutput.cpp
index 8c2ea70..f5bde7c 100644
--- a/Driver/PrintPreprocessedOutput.cpp
+++ b/Driver/PrintPreprocessedOutput.cpp
@@ -103,7 +103,7 @@
/// #line directive. This returns false if already at the specified line, true
/// if some newlines were emitted.
bool PrintPPOutputPPCallbacks::MoveToLine(SourceLocation Loc) {
- unsigned LineNo = PP.getSourceManager().getLogicalLineNumber(Loc);
+ unsigned LineNo = PP.getSourceManager().getInstantiationLineNumber(Loc);
if (DisableLineMarkers) {
if (LineNo == CurLine) return false;
@@ -124,7 +124,7 @@
if (LineNo-CurLine == 1)
OS << '\n';
else if (LineNo == CurLine)
- return false; // Spelling line moved, but logical line didn't.
+ return false; // Spelling line moved, but instantiation line didn't.
else {
const char *NewLines = "\n\n\n\n\n\n\n\n";
OS.write(NewLines, LineNo-CurLine);
@@ -157,7 +157,7 @@
// strange behavior.
}
- Loc = SourceMgr.getLogicalLoc(Loc);
+ Loc = SourceMgr.getInstantiationLoc(Loc);
CurLine = SourceMgr.getLineNumber(Loc);
if (DisableLineMarkers) return;
@@ -200,7 +200,7 @@
/// is called for the first token on each new line. If this really is the start
/// of a new logical line, handle it and return true, otherwise return false.
/// This may not be the start of a logical line because the "start of line"
-/// marker is set for spelling lines, not logical ones.
+/// marker is set for spelling lines, not instantiation ones.
bool PrintPPOutputPPCallbacks::HandleFirstTokOnLine(Token &Tok) {
// Figure out what line we went to and insert the appropriate number of
// newline characters.
@@ -210,7 +210,7 @@
// Print out space characters so that the first token on a line is
// indented for easy reading.
const SourceManager &SourceMgr = PP.getSourceManager();
- unsigned ColNo = SourceMgr.getLogicalColumnNumber(Tok.getLocation());
+ unsigned ColNo = SourceMgr.getInstantiationColumnNumber(Tok.getLocation());
// This hack prevents stuff like:
// #define HASH #
diff --git a/Driver/RewriteBlocks.cpp b/Driver/RewriteBlocks.cpp
index 1e7a6af..e4e470a 100644
--- a/Driver/RewriteBlocks.cpp
+++ b/Driver/RewriteBlocks.cpp
@@ -341,7 +341,7 @@
// #included file. If the former, rewrite it now. If the later, check to see
// if we rewrote the #include/#import.
SourceLocation Loc = D->getLocation();
- Loc = SM->getLogicalLoc(Loc);
+ Loc = SM->getInstantiationLoc(Loc);
// If this is for a builtin, ignore it.
if (Loc.isInvalid()) return;
diff --git a/Driver/RewriteMacros.cpp b/Driver/RewriteMacros.cpp
index d10bf55..fb423c6 100644
--- a/Driver/RewriteMacros.cpp
+++ b/Driver/RewriteMacros.cpp
@@ -113,7 +113,7 @@
// that aren't in the preprocessed view, we have macros that expand to no
// tokens, or macro arguments etc.
while (RawTok.isNot(tok::eof) || PPTok.isNot(tok::eof)) {
- SourceLocation PPLoc = SM.getLogicalLoc(PPTok.getLocation());
+ SourceLocation PPLoc = SM.getInstantiationLoc(PPTok.getLocation());
// If PPTok is from a different source file, ignore it.
if (!SM.isFromMainFile(PPLoc)) {
@@ -198,7 +198,7 @@
while (PPOffs < RawOffs) {
Expansion += ' ' + PP.getSpelling(PPTok);
PP.Lex(PPTok);
- PPLoc = SM.getLogicalLoc(PPTok.getLocation());
+ PPLoc = SM.getInstantiationLoc(PPTok.getLocation());
PPOffs = SM.getFullFilePos(PPLoc);
}
Expansion += ' ';
diff --git a/Driver/RewriteObjC.cpp b/Driver/RewriteObjC.cpp
index ec0018a..cee66f7 100644
--- a/Driver/RewriteObjC.cpp
+++ b/Driver/RewriteObjC.cpp
@@ -557,7 +557,7 @@
// #included file. If the former, rewrite it now. If the later, check to see
// if we rewrote the #include/#import.
SourceLocation Loc = D->getLocation();
- Loc = SM->getLogicalLoc(Loc);
+ Loc = SM->getInstantiationLoc(Loc);
// If this is for a builtin, ignore it.
if (Loc.isInvalid()) return;