diff options
author | Chris Lattner <sabre@nondot.org> | 2009-01-16 07:36:28 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-01-16 07:36:28 +0000 |
commit | f7cf85b330bedd2877e1371fb0a83e99751ae162 (patch) | |
tree | 6674dd8f06d3c395ab61ad9770934c49572e200c /lib/Analysis | |
parent | 88054dee0402e4d3c1f64e6b697acc47195c0d72 (diff) |
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
Diffstat (limited to 'lib/Analysis')
-rw-r--r-- | lib/Analysis/BugReporter.cpp | 23 | ||||
-rw-r--r-- | lib/Analysis/CFRefCount.cpp | 6 | ||||
-rw-r--r-- | lib/Analysis/GRExprEngineInternalChecks.cpp | 5 |
3 files changed, 14 insertions, 20 deletions
diff --git a/lib/Analysis/BugReporter.cpp b/lib/Analysis/BugReporter.cpp index e6840c3ad2..adb3325f53 100644 --- a/lib/Analysis/BugReporter.cpp +++ b/lib/Analysis/BugReporter.cpp @@ -94,7 +94,7 @@ static void ExecutionContinues(std::ostringstream& os, SourceManager& SMgr, os << ' '; os << "Execution continues on line " - << SMgr.getLogicalLineNumber(S->getLocStart()) << '.'; + << SMgr.getInstantiationLineNumber(S->getLocStart()) << '.'; } @@ -534,7 +534,7 @@ void GRBugReporter::GeneratePathDiagnostic(PathDiagnostic& PD, std::ostringstream os; os << "Control jumps to line " - << SMgr.getLogicalLineNumber(S->getLocStart()) << ".\n"; + << SMgr.getInstantiationLineNumber(S->getLocStart()) << ".\n"; PD.push_front(new PathDiagnosticPiece(L, os.str())); break; @@ -548,23 +548,17 @@ void GRBugReporter::GeneratePathDiagnostic(PathDiagnostic& PD, if (Stmt* S = Dst->getLabel()) switch (S->getStmtClass()) { - - default: { + default: os << "No cases match in the switch statement. " "Control jumps to line " - << SMgr.getLogicalLineNumber(S->getLocStart()) << ".\n"; - break; - } - - case Stmt::DefaultStmtClass: { + << SMgr.getInstantiationLineNumber(S->getLocStart()) << ".\n"; + break; + case Stmt::DefaultStmtClass: os << "Control jumps to the 'default' case at line " - << SMgr.getLogicalLineNumber(S->getLocStart()) << ".\n"; - + << SMgr.getInstantiationLineNumber(S->getLocStart()) << ".\n"; break; - } case Stmt::CaseStmtClass: { - os << "Control jumps to 'case "; CaseStmt* Case = cast<CaseStmt>(S); @@ -602,10 +596,9 @@ void GRBugReporter::GeneratePathDiagnostic(PathDiagnostic& PD, } os << ":' at line " - << SMgr.getLogicalLineNumber(S->getLocStart()) << ".\n"; + << SMgr.getInstantiationLineNumber(S->getLocStart()) << ".\n"; break; - } } else { diff --git a/lib/Analysis/CFRefCount.cpp b/lib/Analysis/CFRefCount.cpp index d2d7ab8d04..af96c0672b 100644 --- a/lib/Analysis/CFRefCount.cpp +++ b/lib/Analysis/CFRefCount.cpp @@ -2541,7 +2541,7 @@ PathDiagnosticPiece* CFRefReport::getEndPath(BugReporter& br, Stmt* FirstStmt = cast<PostStmt>(AllocNode->getLocation()).getStmt(); SourceManager& SMgr = BR.getContext().getSourceManager(); - unsigned AllocLine = SMgr.getLogicalLineNumber(FirstStmt->getLocStart()); + unsigned AllocLine =SMgr.getInstantiationLineNumber(FirstStmt->getLocStart()); // Get the leak site. We may have multiple ExplodedNodes (one with the // leak) that occur on the same line number; if the node with the leak @@ -2559,7 +2559,7 @@ PathDiagnosticPiece* CFRefReport::getEndPath(BugReporter& br, Stmt* S = getStmt(BR); // This is the statement where the leak occured. assert (S); - unsigned EndLine = SMgr.getLogicalLineNumber(S->getLocStart()); + unsigned EndLine = SMgr.getInstantiationLineNumber(S->getLocStart()); // Look in the *trimmed* graph at the immediate predecessor of EndN. Does // it occur on the same line? @@ -2574,7 +2574,7 @@ PathDiagnosticPiece* CFRefReport::getEndPath(BugReporter& br, Stmt* SPred = PredPS->getStmt(); // Predecessor at same line? - if (SMgr.getLogicalLineNumber(SPred->getLocStart()) != EndLine) { + if (SMgr.getInstantiationLineNumber(SPred->getLocStart()) != EndLine) { Hint = PathDiagnosticPiece::Below; S = SPred; } diff --git a/lib/Analysis/GRExprEngineInternalChecks.cpp b/lib/Analysis/GRExprEngineInternalChecks.cpp index d32318ca7d..e7a644ce19 100644 --- a/lib/Analysis/GRExprEngineInternalChecks.cpp +++ b/lib/Analysis/GRExprEngineInternalChecks.cpp @@ -212,7 +212,8 @@ public: const CompoundLiteralExpr* CL = CR->getLiteralExpr(); os << "Address of stack memory associated with a compound literal " "declared on line " - << BR.getSourceManager().getLogicalLineNumber(CL->getLocStart()) + << BR.getSourceManager() + .getInstantiationLineNumber(CL->getLocStart()) << " returned."; R = CL->getSourceRange(); @@ -223,7 +224,7 @@ public: R = ARE->getSourceRange(); os << "Address of stack memory allocated by call to alloca() on line " - << BR.getSourceManager().getLogicalLineNumber(L) + << BR.getSourceManager().getInstantiationLineNumber(L) << " returned."; } else { |