1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-26 04:32:44 +01:00

[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:
Teresa Johnson 2016-09-10 06:15:26 +00:00
parent 28d3201799
commit 420dade831

View File

@ -165,6 +165,8 @@ public:
return GV && llvm::canBeOmittedFromSymbolTable(GV);
}
Expected<const Comdat *> getComdat() const {
if (!GV)
return nullptr;
const GlobalObject *GO;
if (auto *GA = dyn_cast<GlobalAlias>(GV)) {
GO = GA->getBaseObject();