Skip to content

Commit

Permalink
Report mods in callbacks, and item parentage.
Browse files Browse the repository at this point in the history
This makes two complementary improvements to the ParseCallbacks.
The first is that Mods are now announced, as a new type of
DiscoveredItem. The second is that the parentage of each item is
announced. The parent of an item is often a mod (i.e. a
C++ namespace) but not necessarily - it might be a struct within
a struct, or similar.

The reported information here is dependent on two pre-existing
bindgen options:
* whether to report C++ namespaces at all
* whether to report inline namespaces conservatively.

For that reason, the test suite gains two new tests.

Part of google/autocxx#124
  • Loading branch information
adetaylor committed Feb 21, 2025
1 parent 743c469 commit 087e2a8
Show file tree
Hide file tree
Showing 4 changed files with 442 additions and 16 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
void a();

namespace B {
void c();

namespace D {
void e();
}

// We should not report empty namespaces
namespace F {
}

namespace {
void g();
}

inline namespace H {
void i();
namespace J {
void k();
}
}

struct L {
struct M {

};
};
};
Loading

0 comments on commit 087e2a8

Please sign in to comment.