From: Eli Friedman Date: Sun, 26 Apr 2009 19:04:51 +0000 (+0000) Subject: Minor code cleanup. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9ec64d6e2fe575b297e1eaa5051efc2983373e25;p=clang 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 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(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;