[llvm] r281134 - [LTO] Handle null GV in Symbol object
Teresa Johnson via llvm-commits
llvm-commits at lists.llvm.org
Fri Sep 9 23:15:26 PDT 2016
Author: tejohnson
Date: Sat Sep 10 01:15:26 2016
New Revision: 281134
URL: http://llvm.org/viewvc/llvm-project?rev=281134&view=rev
Log:
[LTO] Handle null GV in Symbol object
Similar to other Symbol methods, have Symbol::getComdat handle
a null GV gracefully.
Fixes PR30326.
Modified:
llvm/trunk/include/llvm/LTO/LTO.h
Modified: llvm/trunk/include/llvm/LTO/LTO.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/LTO/LTO.h?rev=281134&r1=281133&r2=281134&view=diff
==============================================================================
--- llvm/trunk/include/llvm/LTO/LTO.h (original)
+++ llvm/trunk/include/llvm/LTO/LTO.h Sat Sep 10 01:15:26 2016
@@ -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();
More information about the llvm-commits
mailing list