mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-05-20 20:38:48 +00:00
No need to pessimize current code for future possibilities.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19311 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
e67bc1384a
commit
488742a28e
@ -529,10 +529,9 @@ Constant *llvm::ConstantFoldCastInstruction(const Constant *V,
|
|||||||
if (const GlobalValue *GV = dyn_cast<GlobalValue>(V)) {
|
if (const GlobalValue *GV = dyn_cast<GlobalValue>(V)) {
|
||||||
if (DestTy == Type::BoolTy)
|
if (DestTy == Type::BoolTy)
|
||||||
// FIXME: When we support 'external weak' references, we have to prevent
|
// FIXME: When we support 'external weak' references, we have to prevent
|
||||||
// this transformation from happening. In the meantime we avoid folding
|
// this transformation from happening. This code will need to be updated
|
||||||
// any cast of an external symbol.
|
// to ignore external weak symbols when we support it.
|
||||||
if (!GV->isExternal())
|
return ConstantBool::True;
|
||||||
return ConstantBool::True;
|
|
||||||
} else if (const ConstantExpr *CE = dyn_cast<ConstantExpr>(V)) {
|
} else if (const ConstantExpr *CE = dyn_cast<ConstantExpr>(V)) {
|
||||||
if (CE->getOpcode() == Instruction::Cast) {
|
if (CE->getOpcode() == Instruction::Cast) {
|
||||||
Constant *Op = const_cast<Constant*>(CE->getOperand(0));
|
Constant *Op = const_cast<Constant*>(CE->getOperand(0));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user