[cfe-commits] r70144 - /cfe/trunk/lib/Analysis/BugReporter.cpp

Eli Friedman eli.friedman at gmail.com
Sun Apr 26 12:04:52 PDT 2009


Author: efriedma
Date: Sun Apr 26 14:04:51 2009
New Revision: 70144

URL: http://llvm.org/viewvc/llvm-project?rev=70144&view=rev
Log:
Minor code cleanup.


Modified:
    cfe/trunk/lib/Analysis/BugReporter.cpp

Modified: cfe/trunk/lib/Analysis/BugReporter.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/BugReporter.cpp?rev=70144&r1=70143&r2=70144&view=diff

==============================================================================
--- cfe/trunk/lib/Analysis/BugReporter.cpp (original)
+++ cfe/trunk/lib/Analysis/BugReporter.cpp Sun Apr 26 14:04:51 2009
@@ -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;





More information about the cfe-commits mailing list