Hello,
I am working on the the "Global Variable Optimizer" pass. I'd like to
modify this pass to be more aggressive. Therefore I need the call
graph. The call graph contains AssertVHs of all functions. If the
"Global Variable Optimizer" pass identifies a function to be delete
able it will be deleted immediately by this pass. The call graph is
not destroyed before. That's why deleting a function leads to an
assert in Value.cpp: "While deleting: i32 (...)* %assert. An asserting
value handle still pointed to this value! ...".
How can I ensure that the call graph is destroyed before a functions
is deleted by the "Global Variable Optimizer"? Do I have to do this
explicitly? What is the right place for this?
Kind regards,
Gordon
Gordon Haak wrote:
Hello,
I am working on the the "Global Variable Optimizer" pass. I'd like to
modify this pass to be more aggressive. Therefore I need the call
graph. The call graph contains AssertVHs of all functions. If the
"Global Variable Optimizer" pass identifies a function to be delete
able it will be deleted immediately by this pass. The call graph is
not destroyed before. That's why deleting a function leads to an
assert in Value.cpp: "While deleting: i32 (...)* %assert. An asserting
value handle still pointed to this value! ...".
How can I ensure that the call graph is destroyed before a functions
is deleted by the "Global Variable Optimizer"?
Instead of destroying the entire CallGraph, why not just inform it of the change using CG->removeFunctionFromModule(F) ?
Nick
Do I have to do this