diff options
author | Ahmed Bougacha <ahmed.bougacha@gmail.com> | 2015-03-27 01:40:54 +0000 |
---|---|---|
committer | Ahmed Bougacha <ahmed.bougacha@gmail.com> | 2015-03-27 01:40:54 +0000 |
commit | 821880a7a10b67816c8599eda21797addb88c4a3 (patch) | |
tree | 8a375dec157c69eae93ac70ec5c60df7149c0760 /llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp | |
parent | a523022b5384d7a0901beea7a5f36ee9c09ba339 (diff) | |
download | bcm5719-llvm-821880a7a10b67816c8599eda21797addb88c4a3.tar.gz bcm5719-llvm-821880a7a10b67816c8599eda21797addb88c4a3.zip |
[AsmPrinter] Don't assert on GOT equivalent non-constant users.
We used to dyn_cast<Constant> in the recursive call, but cast<> in the
initial one, and there can be non-Constant initial users.
llvm-svn: 233346
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp')
-rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp b/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp index 098e7989e94..07d673190eb 100644 --- a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp @@ -957,7 +957,7 @@ static bool isGOTEquivalentCandidate(const GlobalVariable *GV, // To be a got equivalent, at least one of its users need to be a constant // expression used by another global variable. for (auto *U : GV->users()) - NumGOTEquivUsers += getNumGlobalVariableUses(cast<Constant>(U)); + NumGOTEquivUsers += getNumGlobalVariableUses(dyn_cast<Constant>(U)); return NumGOTEquivUsers > 0; } |