Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Decompose compound types #209

Closed
sdkrystian opened this issue May 24, 2023 · 2 comments
Closed

Decompose compound types #209

sdkrystian opened this issue May 24, 2023 · 2 comments
Labels
Feature Something new that it should do Metadata AST or Metadata addition/change

Comments

@sdkrystian
Copy link
Member

Consider the following:

struct S { };

S x;
S* y;

which produces the following output:

<namespace name="">
  <struct name="S" id="pOYGF6pLJlICuiGO0Xj0daDb/to=">
    <file path="input.cpp" line="6" class="def"/>
  </struct>
  <variable name="y" id="cND4SpNe0NdSmFwUXrBAZmL6sLo=">
    <file path="input.cpp" line="9" class="def"/>
    <type name="S *"/>
  </variable>
  <variable name="x" id="ujOvtFFNPf6akih2fga4S9j6Y9M=">
    <file path="input.cpp" line="8" class="def"/>
    <type name="S" id="pOYGF6pLJlICuiGO0Xj0daDb/to="/>
  </variable>
</namespace>

It may be desirable to define types (i.e, TypeInfo) in a way that separates cv-qualifiers and (pointer/reference/array/function)ness from the unadorned types (so their IDs can be used to reference the declaration of the type).

@vinniefalco
Copy link
Member

Well the rationale in the original clang-doc is that this would produce an explosion of small allocated TypeInfos. And how does separating the cv-qualifiers help the documentation?

@sdkrystian
Copy link
Member Author

@vinniefalco look at https://clang.llvm.org/doxygen/classclang_1_1ASTContext.html#aa39dff434d30711957097bb5b9d04343 -- note how there is a link to ArrayType in the return type, even though it is a pointer to a cv-qualified type

@sdkrystian sdkrystian added Feature Something new that it should do Metadata AST or Metadata addition/change labels May 24, 2023
alandefreitas pushed a commit to alandefreitas/mrdocs that referenced this issue Jul 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature Something new that it should do Metadata AST or Metadata addition/change
Projects
None yet
Development

No branches or pull requests

2 participants