summaryrefslogtreecommitdiffstats
path: root/clang/lib/Analysis/LiveVariables.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-01-27 07:57:44 +0000
committerChris Lattner <sabre@nondot.org>2009-01-27 07:57:44 +0000
commitf1ca7d3e02e0fb4d5fa6ed56459a31776e82a605 (patch)
tree872fc3a12f4820197ea23bf6e061c048bdce7b14 /clang/lib/Analysis/LiveVariables.cpp
parentc360bf2e4868ec6455cea10e26764456098adc5e (diff)
downloadbcm5719-llvm-f1ca7d3e02e0fb4d5fa6ed56459a31776e82a605.tar.gz
bcm5719-llvm-f1ca7d3e02e0fb4d5fa6ed56459a31776e82a605.zip
Introduce a new PresumedLoc class to represent the concept of a location
as reported to the user and as manipulated by #line. This is what __FILE__, __INCLUDE_LEVEL__, diagnostics and other things should follow (but not dependency generation!). This patch also includes several cleanups along the way: - SourceLocation now has a dump method, and several other places that did similar things now use it. - I cleaned up some code in AnalysisConsumer, but it should probably be simplified further now that NamedDecl is better. - TextDiagnosticPrinter is now simplified and cleaned up a bit. This patch is a prerequisite for #line, but does not actually provide any #line functionality. llvm-svn: 63098
Diffstat (limited to 'clang/lib/Analysis/LiveVariables.cpp')
-rw-r--r--clang/lib/Analysis/LiveVariables.cpp10
1 files changed, 3 insertions, 7 deletions
diff --git a/clang/lib/Analysis/LiveVariables.cpp b/clang/lib/Analysis/LiveVariables.cpp
index ac0aa9ba8c6..4c86d44e4db 100644
--- a/clang/lib/Analysis/LiveVariables.cpp
+++ b/clang/lib/Analysis/LiveVariables.cpp
@@ -358,13 +358,9 @@ void LiveVariables::dumpLiveness(const ValTy& V, SourceManager& SM) const {
for (AnalysisDataTy::decl_iterator I = AD.begin_decl(),
E = AD.end_decl(); I!=E; ++I)
if (V.getDeclBit(I->second)) {
- SourceLocation SpellingLoc = SM.getSpellingLoc(I->first->getLocation());
-
- fprintf(stderr, " %s <%s:%u:%u>\n",
- I->first->getIdentifier()->getName(),
- SM.getSourceName(SpellingLoc),
- SM.getLineNumber(SpellingLoc),
- SM.getColumnNumber(SpellingLoc));
+ fprintf(stderr, " %s <", I->first->getIdentifier()->getName());
+ I->first->getLocation().dump(SM);
+ fprintf(stderr, ">\n");
}
}
OpenPOWER on IntegriCloud