Do not externalize unnamed GlobalValues
It doesn't make sense and the JIT crashes, see upstream bug report https://github.com/llvm/llvm-project/issues/54813
This commit is contained in:
parent
b20a403638
commit
1cba6d415c
@ -43,9 +43,15 @@ namespace {
|
||||
if (GV.isDeclaration())
|
||||
return false; // no change.
|
||||
|
||||
// GV is a definition.
|
||||
|
||||
// It doesn't make sense to keep unnamed constants, we wouldn't know how
|
||||
// to reference them anyway.
|
||||
if (!GV.hasName())
|
||||
return false;
|
||||
|
||||
if (GV.getName().startswith(".str"))
|
||||
return false;
|
||||
// GV is a definition.
|
||||
|
||||
llvm::GlobalValue::LinkageTypes LT = GV.getLinkage();
|
||||
if (!GV.isDiscardableIfUnused(LT))
|
||||
|
Loading…
x
Reference in New Issue
Block a user