ConstantFoldConstantExpression can theoretically return the original
expression; don't go into an infinite loop if it does. llvm-svn: 95591
This commit is contained in:
parent
73fd7e3bee
commit
e51b57bee0
|
@ -892,8 +892,10 @@ static const MCExpr *LowerConstant(const Constant *CV, AsmPrinter &AP) {
|
||||||
// If the code isn't optimized, there may be outstanding folding
|
// If the code isn't optimized, there may be outstanding folding
|
||||||
// opportunities. Attempt to fold the expression using TargetData as a
|
// opportunities. Attempt to fold the expression using TargetData as a
|
||||||
// last resort before giving up.
|
// last resort before giving up.
|
||||||
if (Constant *C = ConstantFoldConstantExpression(CE, AP.TM.getTargetData()))
|
if (Constant *C =
|
||||||
return LowerConstant(C, AP);
|
ConstantFoldConstantExpression(CE, AP.TM.getTargetData()))
|
||||||
|
if (C != CE)
|
||||||
|
return LowerConstant(C, AP);
|
||||||
#ifndef NDEBUG
|
#ifndef NDEBUG
|
||||||
CE->dump();
|
CE->dump();
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue