mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-12 13:38:21 +00:00
Fix SimplifyLibcalls and ValueTracking to check mayBeOverridden
before performing optimizations based on constant string values. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79384 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -1061,7 +1061,8 @@ bool llvm::GetConstantStringInfo(Value *V, std::string &Str, uint64_t Offset,
|
||||
// variable that is a constant and is initialized. The referenced constant
|
||||
// initializer is the array that we'll use for optimization.
|
||||
GlobalVariable* GV = dyn_cast<GlobalVariable>(V);
|
||||
if (!GV || !GV->isConstant() || !GV->hasInitializer())
|
||||
if (!GV || !GV->isConstant() || !GV->hasInitializer() ||
|
||||
GV->mayBeOverridden())
|
||||
return false;
|
||||
Constant *GlobalInit = GV->getInitializer();
|
||||
|
||||
|
Reference in New Issue
Block a user