Minor code cleanup.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70144 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Analysis/BugReporter.cpp b/lib/Analysis/BugReporter.cpp
index d1dbe1c..348ab3d 100644
--- a/lib/Analysis/BugReporter.cpp
+++ b/lib/Analysis/BugReporter.cpp
@@ -541,22 +541,10 @@
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;