Skip to content

Commit f248d5e

Browse files
committed
[Local] Bring back check for FP types in getExpressionForConstant.
The check makes sure that the result for getZExtValue is guaranteed to fit into 64 bit.
1 parent b46638d commit f248d5e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

llvm/lib/Transforms/Utils/Local.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3593,7 +3593,8 @@ DIExpression *llvm::getExpressionForConstant(DIBuilder &DIB, const Constant &C,
35933593
if (isa<ConstantInt>(C))
35943594
return createIntegerExpression(C);
35953595

3596-
if (auto *FP = dyn_cast<ConstantFP>(&C)) {
3596+
auto *FP = dyn_cast<ConstantFP>(&C);
3597+
if (FP && (Ty.isFloatTy() || Ty.isDoubleTy())) {
35973598
const APFloat &APF = FP->getValueAPF();
35983599
return DIB.createConstantValueExpression(
35993600
APF.bitcastToAPInt().getZExtValue());

0 commit comments

Comments
 (0)