[llvm-commits] [llvm] r144079 - in /llvm/trunk/tools/llvm-diff: DiffConsumer.cpp DifferenceEngine.cpp

John McCall rjmccall at apple.com
Mon Nov 7 22:53:05 PST 2011


Author: rjmccall
Date: Tue Nov  8 00:53:04 2011
New Revision: 144079

URL: http://llvm.org/viewvc/llvm-project?rev=144079&view=rev
Log:
Fix the printing of constants.  Patch by Stepan Dyatkovskiy!


Modified:
    llvm/trunk/tools/llvm-diff/DiffConsumer.cpp
    llvm/trunk/tools/llvm-diff/DifferenceEngine.cpp

Modified: llvm/trunk/tools/llvm-diff/DiffConsumer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-diff/DiffConsumer.cpp?rev=144079&r1=144078&r2=144079&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-diff/DiffConsumer.cpp (original)
+++ llvm/trunk/tools/llvm-diff/DiffConsumer.cpp Tue Nov  8 00:53:04 2011
@@ -64,6 +64,10 @@
     }
     return;
   }
+  if (dyn_cast<Constant>(V)) {
+    out << *V;
+    return;
+  }
 
   unsigned N = contexts.size();
   while (N > 0) {

Modified: llvm/trunk/tools/llvm-diff/DifferenceEngine.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-diff/DifferenceEngine.cpp?rev=144079&r1=144078&r2=144079&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-diff/DifferenceEngine.cpp (original)
+++ llvm/trunk/tools/llvm-diff/DifferenceEngine.cpp Tue Nov  8 00:53:04 2011
@@ -327,7 +327,7 @@
         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;





More information about the llvm-commits mailing list