Question

I need to make a method that returns only the name of the functions that are not linkonce_odr. In the example below, I hope to return: sc_main

Example:

define linkonce_odr void @_ZN7sc_core15sc_signal_in_ifIbED2Ev(%"class.sc_core::sc_signal_in_if.48"* %this, i8** %vtt) unnamed_addr nounwind uwtable inlinehint align 2

define linkonce_odr void @_ZN7sc_core15sc_signal_in_ifIbEC2Ev(%"class.sc_core::sc_signal_in_if.48"* %this, i8** %vtt) unnamed_addr nounwind uwtable align 2 

define i32 @sc_main(i32 %argc, i8** %argv) uwtable 

What is the best way to identify linkonce_odr functions?

Was it helpful?

Solution

Just iterate over all the functions, for each check its linkage via getLinkage(), then return the names of those in which that method returned GlobalValue::LinkOnceODRLinkage.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top