Alberto Barbaro via llvm-dev
2019-Dec-09 19:23 UTC
[llvm-dev] How to iterate over all the GlovalVariables at runtime
Hi all, I'm playing with the interpreter and I'm able to access to some GlobalVariable, if for instance used by a GEP instruction. I was wondering if it is possible to list all of them independently from the instruction I'm currently visiting and obviously the relative value. For instance, in my .ll I have something: @.str.4.49 = private unnamed_addr constant [19 x i8] c" but running with \00", align 1 @.str.2.50 = private unnamed_addr constant [7 x i8] c"1.6.15\00", align 1 @.str.5.55 = private unnamed_addr constant [42 x i8] c"Unknown freer parameter in png_data_freer\00", align 1 Is it possible to iterate over them and get the values? Thanks Alberto -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20191209/1edb900e/attachment.html>
Alberto Barbaro via llvm-dev
2019-Dec-09 19:28 UTC
[llvm-dev] How to iterate over all the GlovalVariables at runtime
Hi all, I think I could just use llvm::Module::global_begin() <https://llvm.org/doxygen/Module_8h_source.html#l00582> . Is it correct? I don't know how I missed that :) Thanks Il giorno lun 9 dic 2019 alle ore 19:23 Alberto Barbaro < barbaro.alberto at gmail.com> ha scritto:> Hi all, > I'm playing with the interpreter and I'm able to access to some > GlobalVariable, if for instance used by a GEP instruction. I was wondering > if it is possible to list all of them independently from the instruction > I'm currently visiting and obviously the relative value. For instance, in > my .ll I have something: > > @.str.4.49 = private unnamed_addr constant [19 x i8] c" but running with > \00", align 1 > @.str.2.50 = private unnamed_addr constant [7 x i8] c"1.6.15\00", align 1 > @.str.5.55 = private unnamed_addr constant [42 x i8] c"Unknown freer > parameter in png_data_freer\00", align 1 > > Is it possible to iterate over them and get the values? > > Thanks > Alberto > >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20191209/58788d1d/attachment.html>