diff options
author | Eli Friedman <eli.friedman@gmail.com> | 2009-04-26 19:04:51 +0000 |
---|---|---|
committer | Eli Friedman <eli.friedman@gmail.com> | 2009-04-26 19:04:51 +0000 |
commit | 5cdb8cc267d0820f724e8643b70c3bf74885c830 (patch) | |
tree | 4390e7bb4c30582dd0db37c8caa1cfe19fae331a /clang/lib/Analysis/BugReporter.cpp | |
parent | eda6d2079285c4ef768bd7600124818ecea64d3d (diff) | |
download | bcm5719-llvm-5cdb8cc267d0820f724e8643b70c3bf74885c830.tar.gz bcm5719-llvm-5cdb8cc267d0820f724e8643b70c3bf74885c830.zip |
Minor code cleanup.
llvm-svn: 70144
Diffstat (limited to 'clang/lib/Analysis/BugReporter.cpp')
-rw-r--r-- | clang/lib/Analysis/BugReporter.cpp | 20 |
1 files changed, 4 insertions, 16 deletions
diff --git a/clang/lib/Analysis/BugReporter.cpp b/clang/lib/Analysis/BugReporter.cpp index d1dbe1cd08b..348ab3d09a7 100644 --- a/clang/lib/Analysis/BugReporter.cpp +++ b/clang/lib/Analysis/BugReporter.cpp @@ -541,22 +541,10 @@ static void GenerateMinimalPathDiagnostic(PathDiagnostic& PD, os << D->getNameAsString(); } } - - if (GetRawInt) { - - // Not an enum. - Expr* CondE = cast<SwitchStmt>(T)->getCond(); - unsigned bits = Ctx.getTypeSize(CondE->getType()); - llvm::APSInt V(bits, false); - - if (!LHS->isIntegerConstantExpr(V, Ctx, 0, true)) { - assert (false && "Case condition must be constant."); - continue; - } - - os << V; - } - + + if (GetRawInt) + os << LHS->EvaluateAsInt(Ctx); + os << ":' at line " << End.asLocation().getInstantiationLineNumber(); break; |