On Thu, Jul 31, 2014 at 6:48 PM, Hans Wennborg <[email protected]> wrote:

> On Thu, Jul 31, 2014 at 2:47 PM, Eli Bendersky <[email protected]> wrote:
> >
> >
> >
> > On Thu, Jul 31, 2014 at 12:47 PM, Rafael Espíndola
> > <[email protected]> wrote:
> >>
> >> > I'm not sure how to access those parts of LLVM from libclang. Besides,
> >> > IIRC
> >> > targets are not linked into libclang. Do you have an idea?
> >>
> >> The LLVM targets? You shouldn't need them. All that you need is the
> >> DataLayout. With that you should be able to use lib/IR/Mangler.
> >>
> >
> > Attaching a patch - is this what you had in mind?
>
> >    // The Microsoft mangler may insert a special character in the
> beginning to
> > -  // prevent further mangling. We can strip that for display purposes.
> > -  if (Buf[0] == '\x01') {
> > -    Buf.erase(0, 1);
> > +  // prevent further mangling. We stop mangling and strip it for display
> > +  // purposes.
> > +  if (FrontendBuf[0] == '\x01') {
> > +    FrontendBuf.erase(0, 1);
> > +    return cxstring::createDup(FrontendBuf);
>
> With the approach of using the backend mangler, you wouldn't need to
> strip the \01 prefix because the backend mangler does that anyway (see
> lib/IR/Mangler.cpp:105).
>
>
Yes, but this is not the path I'm going through - I don't have a LLVM
GlobalValue. The Twine-accepting function doesn't do this stripping. See
http://llvm.org/bugs/show_bug.cgi?id=20127 - I'd be able to simplify this
code when it's fixed.

Eli


> Not having to worry about that special prefix seems like a nice
> benefit of using the backend mangler too :)
>
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to