Propagate debug loc info through prologue/epilogue.
[oota-llvm.git] / lib / Analysis / ConstantFolding.cpp
index 597eecc1d2382a1c5cbb2f2141f91f9b9e4901e9..d4457b30318fcd631bb45f8226cd327aad724253 100644 (file)
@@ -76,7 +76,7 @@ static bool IsConstantOffsetFromGlobal(Constant *C, GlobalValue *&GV,
         Offset += TD.getStructLayout(ST)->getElementOffset(CI->getZExtValue());
       } else {
         const SequentialType *SQT = cast<SequentialType>(*GTI);
-        Offset += TD.getABITypeSize(SQT->getElementType())*CI->getSExtValue();
+        Offset += TD.getTypePaddedSize(SQT->getElementType())*CI->getSExtValue();
       }
     }
     return true;
@@ -87,7 +87,7 @@ static bool IsConstantOffsetFromGlobal(Constant *C, GlobalValue *&GV,
 
 
 /// SymbolicallyEvaluateBinop - One of Op0/Op1 is a constant expression.
-/// Attempt to symbolically evaluate the result of  a binary operator merging
+/// Attempt to symbolically evaluate the result of a binary operator merging
 /// these together.  If target data info is available, it is provided as TD, 
 /// otherwise TD is null.
 static Constant *SymbolicallyEvaluateBinop(unsigned Opc, Constant *Op0,
@@ -113,7 +113,6 @@ static Constant *SymbolicallyEvaluateBinop(unsigned Opc, Constant *Op0,
       }
   }
     
-  // TODO: Fold icmp setne/seteq as well.
   return 0;
 }