[cfe-dev] Programatically obtaining section/offset information for function/constructor declarations found during AST traversal
mats petersson via cfe-dev
cfe-dev at lists.llvm.org
Mon Sep 28 03:41:31 PDT 2015
What are you ACTUALLY trying to do? As Csaba says, the code is not even
close to being machine code at that point, so you won't be able to do it at
that point. Sections and offsets would only be available after machine code
generation. There are passes in LLVM that deals with machine instructions,
that COULD be useful, but it really depends on what you are actully trying
[The reason I ask "what you really want to do" is that your question sounds
a like an XY question - like going to a garage asking how to loosen a wheel
nut, and the (wo)man tells you how to undo the wheel nut, then five minutes
later you come back asking how to get a wheel back on the car when it's
fallen to one side, because what you didn't do was lift that corner of the
car up before trying to fit the spare wheel - if you ask how to change a
wheel, you'd get a better answer for how to perform that task than asking
how to remove a wheel nut]
On 28 September 2015 at 08:52, Csaba Raduly via cfe-dev <
cfe-dev at lists.llvm.org> wrote:
> Hi Sanee,
> I doubt this is possible.
> At the time you're walking through the AST, code has not been generated
> On Mon, Sep 28, 2015 at 12:29 AM, Sanee Berlow via cfe-dev wrote:
> > Hey everyone.
> > I'm using ASTVisitor to walk through an AST to find constructors
> > belonging to a certain type. What I want to do now is find the
> > section/offset information for those found constructors that will be
> > written to the output object file, allowing me to locate the binary
> > for the constructors in the file. Is it possible to get that
> > information programatically? What would be the best way to go about
> > this?
> GCS a+ e++ d- C++ ULS$ L+$ !E- W++ P+++$ w++$ tv+ b++ DI D++ 5++
> The Tao of math: The numbers you can count are not the real numbers.
> Life is complex, with real and imaginary parts.
> "Ok, it boots. Which means it must be bug-free and perfect. " -- Linus
> "People disagree with me. I just ignore them." -- Linus Torvalds
> cfe-dev mailing list
> cfe-dev at lists.llvm.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the cfe-dev