forked from OSchip/llvm-project
Don't try to emit CK_LValueBitCast casts as constants. PR9558.
llvm-svn: 142863
This commit is contained in:
parent
89ab56d5fb
commit
9190e19b66
|
@ -573,7 +573,6 @@ public:
|
|||
case CK_CPointerToObjCPointerCast:
|
||||
case CK_BlockPointerToObjCPointerCast:
|
||||
case CK_AnyPointerToBlockPointerCast:
|
||||
case CK_LValueBitCast:
|
||||
case CK_BitCast:
|
||||
if (C->getType() == destType) return C;
|
||||
return llvm::ConstantExpr::getBitCast(C, destType);
|
||||
|
@ -589,6 +588,7 @@ public:
|
|||
case CK_ARCConsumeObject:
|
||||
case CK_ARCReclaimReturnedObject:
|
||||
case CK_ARCExtendBlockObject:
|
||||
case CK_LValueBitCast:
|
||||
return 0;
|
||||
|
||||
// These might need to be supported for constexpr.
|
||||
|
|
|
@ -36,3 +36,7 @@ namespace test2 {
|
|||
double t0 = A::d;
|
||||
double t1[] = { A::d, A::f };
|
||||
}
|
||||
|
||||
// We don't expect to fold this in the frontend, but make sure it doesn't crash.
|
||||
// CHECK: @PR9558 = global float 0.000000e+0
|
||||
float PR9558 = reinterpret_cast<const float&>("asd");
|
||||
|
|
Loading…
Reference in New Issue