mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-26 21:32:10 +00:00
[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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233346 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
9f2b49c521
commit
f265603512
@ -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;
|
||||
}
|
||||
|
@ -79,3 +79,8 @@ define i32 @t0(i32 %a) {
|
||||
to i32), %a
|
||||
ret i32 %x
|
||||
}
|
||||
|
||||
; Also test direct instruction uses.
|
||||
define i32** @t1() {
|
||||
ret i32** @bargotequiv
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user