mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-20 09:30:43 +00:00
b374b90e81
indirect function pointer, inline it, then go to delete the body. The problem is that the callgraph had other references to the function, though the inliner had no way to know it, so we got a dangling pointer and an invalid iterator out of the deal. The fix to this is pretty simple: stop the inliner from deleting the function by knowing that there are references to it. Do this by making CallGraphNodes contain a refcount. This requires moving deletion of available_externally functions to the module-level cleanup sweep where it belongs. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80533 91177308-0d34-0410-b5e6-96231b3b80d8
17 lines
340 B
LLVM
17 lines
340 B
LLVM
; RUN: llvm-as < %s | opt -inline | llvm-dis
|
|
; PR4834
|
|
|
|
define i32 @main() {
|
|
%funcall1_ = call fastcc i32 ()* ()* @f1()
|
|
%executecommandptr1_ = call i32 %funcall1_()
|
|
ret i32 %executecommandptr1_
|
|
}
|
|
|
|
define internal fastcc i32 ()* @f1() nounwind readnone {
|
|
ret i32 ()* @f2
|
|
}
|
|
|
|
define internal i32 @f2() nounwind readnone {
|
|
ret i32 1
|
|
}
|