llvm.org GIT mirror llvm / f291ab2
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 Eli Friedman 8 years ago
2 changed file(s) with 14 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
293293 /// instead.
294294 bool DAE::RemoveDeadArgumentsFromCallers(Function &Fn)
295295 {
296 if (Fn.isDeclaration())
296 if (Fn.isDeclaration() || Fn.mayBeOverridden())
297297 return false;
298298
299299 // Functions with local linkage should already have been handled.
3636 call void @f(i32 %tmp)
3737 ret void
3838 }
39
40 ; Check that callers are not transformed for weak definitions.
41 define weak i32 @weak_f(i32 %x) nounwind {
42 entry:
43 ret i32 0
44 }
45 define void @weak_f_caller() nounwind {
46 entry:
47 ; CHECK: call i32 @weak_f(i32 10)
48 %call = tail call i32 @weak_f(i32 10)
49 ret void
50 }
51