mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-12 13:30:51 +00:00
Add an obvious missing safety check to DAE::RemoveDeadArgumentsFromCallers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126720 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
d3e768ecab
commit
f291ab2fba
@ -294,7 +294,7 @@ bool DAE::DeleteDeadVarargs(Function &Fn) {
|
||||
/// instead.
|
||||
bool DAE::RemoveDeadArgumentsFromCallers(Function &Fn)
|
||||
{
|
||||
if (Fn.isDeclaration())
|
||||
if (Fn.isDeclaration() || Fn.mayBeOverridden())
|
||||
return false;
|
||||
|
||||
// Functions with local linkage should already have been handled.
|
||||
|
@ -37,3 +37,16 @@ entry:
|
||||
call void @f(i32 %tmp)
|
||||
ret void
|
||||
}
|
||||
|
||||
; Check that callers are not transformed for weak definitions.
|
||||
define weak i32 @weak_f(i32 %x) nounwind {
|
||||
entry:
|
||||
ret i32 0
|
||||
}
|
||||
define void @weak_f_caller() nounwind {
|
||||
entry:
|
||||
; CHECK: call i32 @weak_f(i32 10)
|
||||
%call = tail call i32 @weak_f(i32 10)
|
||||
ret void
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user