Re: [cfe-users] fetch variable names through debugInfo attached to load instructors

2021-05-25 Thread David Blaikie via cfe-users
On Tue, May 25, 2021 at 1:13 PM Bella V wrote: > Thanks! It works. > > One sub-question: How do we analyze the member dereferenced struct > variables as dbg.declares only has the declaration info as inside the > function the struct variable types could have members dereferenced as well. > > Examp

Re: [cfe-users] fetch variable names through debugInfo attached to load instructors

2021-05-25 Thread Bella V via cfe-users
Thanks! It works. One sub-question: How do we analyze the member dereferenced struct variables as dbg.declares only has the declaration info as inside the function the struct variable types could have members dereferenced as well. Example: https://godbolt.org/z/zaeYn9do7 dbg.declares have use_v

Re: [cfe-users] fetch variable names through debugInfo attached to load instructors

2021-05-20 Thread David Blaikie via cfe-users
You'd have to analyze the dbg.declares and track that they refer to the same thing as the geps/loads you're interested in - from the dbg.declares (& dbg.values) you can follow those to find the variables they refer to. On Thu, May 20, 2021 at 12:18 PM Bella V via cfe-users < cfe-users@lists.llvm.o

[cfe-users] fetch variable names through debugInfo attached to load instructors

2021-05-20 Thread Bella V via cfe-users
Hello All, I read the documentation and I was able to fetch the variable names and source locations attached to metadata for call instructions (@llvm.dbg.declare) using dyn_cast. I wanted to check if we could fetch the variable names in the load/gep instructors using debugInfo. I want to collect t