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

C++ Fixes #125

Draft
wants to merge 8 commits into
base: main
Choose a base branch
from
Draft

C++ Fixes #125

wants to merge 8 commits into from

Commits on Sep 26, 2024

  1. Analyze C++ UsingType

    C++ have `UsingType` which is not traversed by TraverseType, so do it in
    the Visitor.
    
    Signed-off-by: Giuliano Belinassi <[email protected]>
    giulianobelinassi committed Sep 26, 2024
    Configuration menu
    Copy the full SHA
    a3b74dc View commit details
    Browse the repository at this point in the history
  2. C++ TemplateSpecilializationType

    TraverseTemplateName does not handle TemplateDecl nor UsingShadowDecl.
    Do it on the visitor.
    
    Signed-off-by: Giuliano Belinassi <[email protected]>
    giulianobelinassi committed Sep 26, 2024
    Configuration menu
    Copy the full SHA
    551106d View commit details
    Browse the repository at this point in the history
  3. Analyze partial template declarations

    C++ can specify partial template declarations which can implement
    additional things that the original declaration doesn't have.  Here
    we try to match if a certain declaration comes from a specific
    specification by matching the Identifier on a DependentNameType, but
    that is not always possible so we also add all
    ClassTemplatePartialSpecializationDecl for a ClassTemplateDecl to the
    closure until we do not find a better way of doing this.
    
    Signed-off-by: Giuliano Belinassi <[email protected]>
    giulianobelinassi committed Sep 26, 2024
    Configuration menu
    Copy the full SHA
    581244e View commit details
    Browse the repository at this point in the history
  4. Handle VarTemplateSpecializatons

    VarTemplateSpecializations should not be treated as VarDecls, otherwise
    we lose the template<> argument.
    
    Signed-off-by: Giuliano Belinassi <[email protected]>
    giulianobelinassi committed Sep 26, 2024
    Configuration menu
    Copy the full SHA
    9cb0bc3 View commit details
    Browse the repository at this point in the history
  5. Parse UsingDecls

    C++ have the `using` keyword which can act like typedefs.  Visit those
    as well.
    
    Signed-off-by: Giuliano Belinassi <[email protected]>
    giulianobelinassi committed Sep 26, 2024
    Configuration menu
    Copy the full SHA
    8e2a52a View commit details
    Browse the repository at this point in the history
  6. Handle extern "C" builds

    Constructions such as `extern "C"` are modeled as LinkageSpecDecl,
    which we need to analyze as well.
    
    Signed-off-by: Giuliano Belinassi <[email protected]>
    giulianobelinassi committed Sep 26, 2024
    Configuration menu
    Copy the full SHA
    5a5bc39 View commit details
    Browse the repository at this point in the history
  7. Fix Remove_Redundant_Decls removing necessary decls

    PrettyPrint::Contains_From_LineCol had a bug in which Decls that do not
    contain themselves were marked as such because two files ended up having
    the same FileID because of preprocessed notation (example: # 1 "file").
    Fix this by dropping this function in favor of
    Range_Fully_Contains_Range, which uses the expanded location.
    
    Signed-off-by: Giuliano Belinassi <[email protected]>
    giulianobelinassi committed Sep 26, 2024
    Configuration menu
    Copy the full SHA
    9c0254f View commit details
    Browse the repository at this point in the history
  8. Make sure we add parent decls until the TranslationUnit

    Due to the recursive nature of C++, we must make sure we added all
    Decls up to the root (TranslationUnitDecl) of the AST to the output,
    else we might miss important decls.
    
    Signed-off-by: Giuliano Belinassi <[email protected]>
    giulianobelinassi committed Sep 26, 2024
    Configuration menu
    Copy the full SHA
    19a5ea3 View commit details
    Browse the repository at this point in the history