This complements the fixes in r323633 and r324075 which drop the
definitions of dead functions and variables, respectively.
Fixes PR36208.
Differential D42856
[ThinLTO] Convert dead alias to declarations tejohnson on Feb 2 2018, 10:21 AM. Authored by
Details This complements the fixes in r323633 and r324075 which drop the Fixes PR36208.
Diff Detail
Event Timeline
Comment Actions LGTM, thanks !
|
With the new change convertToDeclaration becomes a dangerous function to use in loops.
Currently there is one more place where code iterates over aliases in a "old" way and may also fail I think:
https://github.com/llvm-mirror/llvm/blob/master/lib/Transforms/IPO/FunctionImport.cpp#L670
https://github.com/llvm-mirror/llvm/blob/master/lib/Transforms/IPO/FunctionImport.cpp#L689
What about if we stop calling eraseFromParent from convertToDeclatation
and do something explicit like:
So convertToDeclaration would return true if value was converted to declaration and
false if it was replaced.
Though we can refactor this place separatelly in a followups, probably with use of
some better approach, but at least caller from FunctionImport.cpp should also be changed too then.