X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=lib%2FAnalysis%2FConstantFolding.cpp;h=d4457b30318fcd631bb45f8226cd327aad724253;hb=ef4cfc749a61d0d0252196c957697436ba7ec068;hp=597eecc1d2382a1c5cbb2f2141f91f9b9e4901e9;hpb=d43390498291c475a6e277fcd5d3bbf5abd3b41e;p=oota-llvm.git diff --git a/lib/Analysis/ConstantFolding.cpp b/lib/Analysis/ConstantFolding.cpp index 597eecc1d23..d4457b30318 100644 --- a/lib/Analysis/ConstantFolding.cpp +++ b/lib/Analysis/ConstantFolding.cpp @@ -76,7 +76,7 @@ static bool IsConstantOffsetFromGlobal(Constant *C, GlobalValue *&GV, Offset += TD.getStructLayout(ST)->getElementOffset(CI->getZExtValue()); } else { const SequentialType *SQT = cast(*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; }