Add parentheses around an || to correct the logic. Also silences a GCC warning
authorChandler Carruth <chandlerc@gmail.com>
Mon, 12 Jul 2010 06:47:05 +0000 (06:47 +0000)
committerChandler Carruth <chandlerc@gmail.com>
Mon, 12 Jul 2010 06:47:05 +0000 (06:47 +0000)
that was actually useful here.

Chris, please double check that this is the correct interpretation. I was
pretty sure, and ran it by Nick as well.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108129 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Analysis/ConstantFolding.cpp

index f7bd19d78ce0ca88f726956f8fc73b14106d73dd..13d8f4de48248706729c3deeb2877e15b1490d96 100644 (file)
@@ -439,7 +439,7 @@ Constant *llvm::ConstantFoldLoadFromConstPtr(Constant *C,
     // Replace load with immediate integer if the result is an integer or fp
     // value.
     if ((NumBits >> 3) == StrLen + 1 && (NumBits & 7) == 0 &&
-        isa<IntegerType>(Ty) || Ty->isFloatingPointTy()) {
+        (isa<IntegerType>(Ty) || Ty->isFloatingPointTy())) {
       APInt StrVal(NumBits, 0);
       APInt SingleChar(NumBits, 0);
       if (TD->isLittleEndian()) {