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)
committerJohn McCall <rjmccall@apple.com>
Tue, 8 Nov 2011 06:53:04 +0000 (06:53 +0000)
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 c23e8fb91a1b7ef35f192fbaf53330eba15b69bc..24b372d022909942bd83e5670517da723c8bce30 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 b240d8c5da5d1f452b0ad6630b015df9554026ee..435cd87fa7614bd90ac1ddec80ca8c0542a4fd30 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;