This is an archive of the discontinued LLVM Phabricator instance.

[libclang] Expose using shadow types and declarations in libclang.
Needs ReviewPublic

Authored by emilio on Dec 14 2022, 5:24 PM.

Details

Reviewers
aaron.ballman
Summary

This allows tools like rust-bindgen to detect typedefs properly.

See https://github.com/rust-lang/rust-bindgen/pull/2372 (which relies on
this patch) for an example.

Diff Detail

Event Timeline

emilio created this revision.Dec 14 2022, 5:24 PM
Herald added a project: Restricted Project. · View Herald TranscriptDec 14 2022, 5:24 PM
emilio requested review of this revision.Dec 14 2022, 5:24 PM
Herald added a project: Restricted Project. · View Herald TranscriptDec 14 2022, 5:24 PM
Herald added a subscriber: cfe-commits. · View Herald Transcript
emilio added a reviewer: aaron.ballman.EditedDec 14 2022, 5:25 PM

(As in my previous commit, picking based on git log, please review / forward as appropriate. Thanks again!)

emilio updated this revision to Diff 483499.Dec 16 2022, 5:15 AM

Fix test

serge-sans-paille added inline comments.
clang/tools/libclang/CXCursor.cpp
1281

In which case can this be null?

aaron.ballman added inline comments.Mar 1 2023, 8:25 AM
clang/tools/libclang/CXCursor.cpp
1279–1281

Hmm, we're exposing CXType_Using but here we're not giving back a cursor to the UsingType but instead looking through that type to get down to a declaration and are returning that.

Should we split these in two different cursors?