[llvm-commits] [llvm] r120281 - /llvm/trunk/lib/Analysis/InstructionSimplify.cpp

Chandler Carruth chandlerc at gmail.com
Sun Nov 28 17:41:13 PST 2010


Author: chandlerc
Date: Sun Nov 28 19:41:13 2010
New Revision: 120281

URL: http://llvm.org/viewvc/llvm-project?rev=120281&view=rev
Log:
Add some dead stores to pacify my least favorite GCC warning: may be
uninitialized. The warning is terrible, has incorrect source locations, and has
a huge false positive rate such as *all* of these.

If anyone has a better solution, please let me know. Alternatively, I'll
happily add -Wno-uninitialized to the -Werror build mode. Maybe I can even do
it *only* when building with GCC instead of Clang.

Modified:
    llvm/trunk/lib/Analysis/InstructionSimplify.cpp

Modified: llvm/trunk/lib/Analysis/InstructionSimplify.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/InstructionSimplify.cpp?rev=120281&r1=120280&r2=120281&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/InstructionSimplify.cpp (original)
+++ llvm/trunk/lib/Analysis/InstructionSimplify.cpp Sun Nov 28 19:41:13 2010
@@ -298,7 +298,7 @@
     return Op0;
 
   // A & ~A  =  ~A & A  =  0
-  Value *A, *B;
+  Value *A = 0, *B = 0;
   if ((match(Op0, m_Not(m_Value(A))) && A == Op1) ||
       (match(Op1, m_Not(m_Value(A))) && A == Op0))
     return Constant::getNullValue(Op0->getType());
@@ -377,7 +377,7 @@
     return Op1;
 
   // A | ~A  =  ~A | A  =  -1
-  Value *A, *B;
+  Value *A = 0, *B = 0;
   if ((match(Op0, m_Not(m_Value(A))) && A == Op1) ||
       (match(Op1, m_Not(m_Value(A))) && A == Op0))
     return Constant::getAllOnesValue(Op0->getType());
@@ -452,7 +452,7 @@
     return Constant::getNullValue(Op0->getType());
 
   // A ^ ~A  =  ~A ^ A  =  -1
-  Value *A, *B;
+  Value *A = 0, *B = 0;
   if ((match(Op0, m_Not(m_Value(A))) && A == Op1) ||
       (match(Op1, m_Not(m_Value(A))) && A == Op0))
     return Constant::getAllOnesValue(Op0->getType());





More information about the llvm-commits mailing list