[llvm] r290822 - [NewGVN] Restore old code to placate buildbots.

Davide Italiano via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 2 10:41:34 PST 2017


Author: davide
Date: Mon Jan  2 12:41:34 2017
New Revision: 290822

URL: http://llvm.org/viewvc/llvm-project?rev=290822&view=rev
Log:
[NewGVN] Restore old code to placate buildbots.

Apparently my suggestion of using ternary doesn't really work
as clang complains about incompatible types on LHS and RHS. Some
GCC versions happen to accept the code but clang behaviour is
correct here.

Modified:
    llvm/trunk/lib/Transforms/Scalar/NewGVN.cpp

Modified: llvm/trunk/lib/Transforms/Scalar/NewGVN.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/NewGVN.cpp?rev=290822&r1=290821&r2=290822&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/NewGVN.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/NewGVN.cpp Mon Jan  2 12:41:34 2017
@@ -780,8 +780,12 @@ const Expression *NewGVN::performSymboli
 // Update the memory access equivalence table to say that From is equal to To,
 // and return true if this is different from what already existed in the table.
 bool NewGVN::setMemoryAccessEquivTo(MemoryAccess *From, MemoryAccess *To) {
-  DEBUG(dbgs() << "Setting " << *From << " equivalent to "
-               << (To ? "itself" : *To) << "\n");
+  DEBUG(dbgs() << "Setting " << *From << " equivalent to ");
+  if (!To)
+    DEBUG(dbgs() << "itself");
+  else
+    DEBUG(dbgs() << *To);
+  DEBUG(dbgs() << "\n");
   auto LookupResult = MemoryAccessEquiv.find(From);
   bool Changed = false;
   // If it's already in the table, see if the value changed.




More information about the llvm-commits mailing list