This is an archive of the discontinued LLVM Phabricator instance.

Expose name mangling to libclang
ClosedPublic

Authored by eliben on Jul 24 2014, 5:48 PM.

Details

Summary

Exposes a C API to name mangling for a given cursor.

This is loosely based on https://gist.github.com/tritao/2766291, and was previously discussed on cfe-dev: http://lists.cs.uiuc.edu/pipermail/cfe-dev/2014-June/037577.html

Adding testing capability via c-index-test.

Diff Detail

Event Timeline

eliben updated this revision to Diff 11863.Jul 24 2014, 5:48 PM
eliben retitled this revision from to Expose name mangling to libclang.
eliben updated this object.
eliben edited the test plan for this revision. (Show Details)
eliben added reviewers: rsmith, rengolin.
eliben added a subscriber: Unknown Object (MLST).
rengolin edited edge metadata.Jul 28 2014, 9:12 AM

Hi Eli,

Looks ok to me, but I'm not the expert. Would be good to have some negative tests, though.

cheers,
--renato

eliben updated this revision to Diff 11994.Jul 29 2014, 2:20 PM
eliben edited edge metadata.

Attaching new patch with requests addressed

In D4663#4, @rengolin wrote:

Hi Eli,

Looks ok to me, but I'm not the expert. Would be good to have some negative tests, though.

cheers,
--renato

I'm not 100% what you mean as "negative tests" in this context. I did add a check that nodes that shouldn't get mangled, aren't, in this new patch. Also addressed the other review by checking MS mangling as well.

eliben updated this revision to Diff 12001.Jul 29 2014, 4:30 PM

Following hwennborg's and pcc's advice, stripping non-printable char inserted by the Microsoft mangler.

hans added a subscriber: hans.Jul 29 2014, 4:46 PM

This looks great as far as I can tell, but I'm not familiar enough with libclang to sign off here.

eliben updated this revision to Diff 12035.Jul 30 2014, 10:44 AM

Following Argyrios's advice, infer the mangling context from AST context

eliben updated this revision to Diff 12074.Jul 31 2014, 10:47 AM

Remove llvm:: prefixes from isa/case, per Argyrios's request

rengolin accepted this revision.Aug 5 2014, 7:13 AM
rengolin edited edge metadata.
In D4663#7, @eliben wrote:

I'm not 100% what you mean as "negative tests" in this context. I did add a check that nodes that shouldn't get mangled, aren't, in this new patch. Also addressed the other review by checking MS mangling as well.

That's what I meant. :) Looks good to me, though I'm not the expert here.

cheers,
--renato

This revision is now accepted and ready to land.Aug 5 2014, 7:13 AM
eliben closed this revision.Sep 2 2014, 3:53 PM