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

Miscellaneous improvements #324

Closed
wants to merge 19 commits into from
Closed

Conversation

melonedo
Copy link
Contributor

@melonedo melonedo commented Aug 21, 2021

Fix #320, fix #325, fix #326.

@melonedo
Copy link
Contributor Author

It turns out that it is very easy to split common file and API file and topo-sort the macros. This makes resurrecting old scripts much easier.

Copy link
Member

@Gnimuc Gnimuc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As for #325, I think it can be fixed by merely caching those inner nested tag types. The line needed to be fixed is

elseif occursin("anonymous", spelling(ty))
# it could be a nested anonymous tag-type.
# pass

docs/src/index.md Outdated Show resolved Hide resolved
@@ -110,6 +110,7 @@ function pretty_print(io, node::ExprNode{<:AbstractStructNodeType}, options::Dic
inline = struct_field_comment_style == "inline"
struct_def = node.exprs[1]
mutable, name, members = struct_def.args
name = Base.sym_to_string(name)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Escape struct names with var""

examples?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

with use_deterministic_symbol set to false,

struct S {
    struct {
        int a;
    } b;
};

output would have been

mutable struct ##Ctag#499
    a::Cint
    var"##Ctag#499"() = new()
end

@Gnimuc
Copy link
Member

Gnimuc commented Aug 28, 2021

By the way, why nested_tags is index by tag instead of by cursor? The latter feels more natural for me

Because CLCursors are not unique across different translation units.

@melonedo
Copy link
Contributor Author

By the way, why nested_tags is index by tag instead of by cursor? The latter feels more natural for me

Because CLCursors are not unique across different translation units.

Thanks! I now see that they are compared by actual declaration locations.

@Gnimuc
Copy link
Member

Gnimuc commented Aug 28, 2021

The ultimate solution would be to directly work with Clang's ASTContext and do AST-merging for CTU analysis. Due to libclang's limitations, we have to use these ugly workarounds for now.

@Gnimuc
Copy link
Member

Gnimuc commented Sep 9, 2021

Is this ready for review? better to split this to individual PRs.

@melonedo
Copy link
Contributor Author

melonedo commented Sep 9, 2021

Yes this is ready, this branch was meant to hold commits that might depend on each other, which now seems not happening a lot. I will split them into individual PRs soon.

@melonedo melonedo marked this pull request as draft September 9, 2021 13:09
@melonedo
Copy link
Contributor Author

All of the commits are moved to other branches. Closed.

@melonedo melonedo closed this Sep 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants