[PATCH] Expose name mangling to libclang
Eli Bendersky
eliben at google.com
Wed Jul 30 10:45:52 PDT 2014
On Tue, Jul 29, 2014 at 5:44 PM, Argyrios Kyrtzidis <kyrtzidis at apple.com>
wrote:
>
> On Jul 29, 2014, at 5:21 PM, Eli Bendersky <eliben at google.com> wrote:
>
> On Tue, Jul 29, 2014 at 5:08 PM, Argyrios Kyrtzidis <kyrtzidis at apple.com>
> wrote:
>
>> Hi Eli,
>>
>> +/**
>> + * \brief Represents the different available ABIs for name mangling.
>> + */
>> +typedef enum { CXMangleABI_Itanium = 0, CXMangleABI_Microsoft = 1 }
>> CXMangleABI;
>> +
>> +/**
>> + * \brief Retrieve the CXString representing the mangled name of the
>> cursor.
>> + */
>> +CINDEX_LINKAGE CXString clang_Cursor_getMangling(CXCursor, CXMangleABI);
>>
>> Why aren’t you just using that appropriate ABI of the translation unit
>> that was created ? So to get the MangleContext you can just call
>> ASTContext::createMangleContext().
>>
>
> Hi Argyrios,
>
> Thanks for the suggestion. This is an interesting idea - I guess I have
> been looking at it from a different angle, thinking mostly about a simple
> tool that uses Clang to mangle all kinds of names (think a web interface).
> So I was detaching standalone symbols from their containers/TUs.
>
> So, I suppose the same thing can be simulated with the approach you
> proposing, e.g. by passing a triple flag in the cmdline options
> to clang_createTranslationUnitFromSourceFile or something of the sort. What
> do you think?
>
>
> Yes, sounds good to me.
>
Argyrios, I uploaded a new patch that implements this. PTAL
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20140730/edc616b6/attachment.html>
More information about the cfe-commits
mailing list