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