diff options
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; |