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 | 9ec64d6e2fe575b297e1eaa5051efc2983373e25 (patch) | |
tree | 38f431dfb60928f4d6526c35d3058bd4749fc63d /lib/Analysis/BugReporter.cpp | |
parent | 1eb5540760dc79502e32d4fe9c28217476ea14b9 (diff) |
Minor code cleanup.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70144 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/BugReporter.cpp')
-rw-r--r-- | lib/Analysis/BugReporter.cpp | 20 |
1 files changed, 4 insertions, 16 deletions
diff --git a/lib/Analysis/BugReporter.cpp b/lib/Analysis/BugReporter.cpp index d1dbe1cd08..348ab3d09a 100644 --- a/lib/Analysis/BugReporter.cpp +++ b/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; |