forked from OSchip/llvm-project
[LTO] Handle null GV in Symbol object
Similar to other Symbol methods, have Symbol::getComdat handle a null GV gracefully. Fixes PR30326. llvm-svn: 281134
This commit is contained in:
parent
3d17313734
commit
03c3511211
|
@ -165,6 +165,8 @@ public:
|
||||||
return GV && llvm::canBeOmittedFromSymbolTable(GV);
|
return GV && llvm::canBeOmittedFromSymbolTable(GV);
|
||||||
}
|
}
|
||||||
Expected<const Comdat *> getComdat() const {
|
Expected<const Comdat *> getComdat() const {
|
||||||
|
if (!GV)
|
||||||
|
return nullptr;
|
||||||
const GlobalObject *GO;
|
const GlobalObject *GO;
|
||||||
if (auto *GA = dyn_cast<GlobalAlias>(GV)) {
|
if (auto *GA = dyn_cast<GlobalAlias>(GV)) {
|
||||||
GO = GA->getBaseObject();
|
GO = GA->getBaseObject();
|
||||||
|
|
Loading…
Reference in New Issue