[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 3d17313734
commit 03c3511211
1 changed files with 2 additions and 0 deletions

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();