OSDN Git Service

Fix the printing of constants. Patch by Stepan Dyatkovskiy!
authorJohn McCall <rjmccall@apple.com>
Tue, 8 Nov 2011 06:53:04 +0000 (06:53 +0000)
committerStephen Hines <srhines@google.com>
Mon, 14 Nov 2011 17:12:00 +0000 (09:12 -0800)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144079 91177308-0d34-0410-b5e6-96231b3b80d8

tools/llvm-diff/DiffConsumer.cpp
tools/llvm-diff/DifferenceEngine.cpp

index c23e8fb..24b372d 100644 (file)
@@ -64,6 +64,10 @@ void DiffConsumer::printValue(Value *V, bool isL) {
     }
     return;
   }
+  if (dyn_cast<Constant>(V)) {
+    out << *V;
+    return;
+  }
 
   unsigned N = contexts.size();
   while (N > 0) {
index b240d8c..435cd87 100644 (file)
@@ -327,7 +327,7 @@ class FunctionDifferenceEngine {
         if (LCase) {
           if (TryUnify) tryUnify(LCase, RI->getSuccessor(I));
           LCases.erase(CaseValue);
-        } else if (!Difference) {
+        } else if (Complain || !Difference) {
           if (Complain)
             Engine.logf("right switch has extra case %r") << CaseValue;
           Difference = true;