Skip to content

Cleanup GCCAsmStmt children iterations #131358

Open
@cor3ntin

Description

@cor3ntin

GCCAsmStmt stores its arguments in separately allocated array

StringLiteral *AsmStr;
// FIXME: If we wanted to, we could allocate all of these in one big array.
StringLiteral **Constraints = nullptr;
StringLiteral **Clobbers = nullptr;
IdentifierInfo **Names = nullptr;
unsigned NumLabels = 0;

And is not considered to have any children.

Instead, we should store all these statements (contiguously) within the Exprs of ASmStmt and make sure that's returned from children()

Stmt **Exprs = nullptr;

However, we should also make sure that the order of the children - and therefore the order of elements
in Expr makes sense,

ie Template, OutputConstraint0, OutputExpr0, ... OutputConstraintN, OutputExprN, InputConstraint0, InputExpr0, ... InputConstraintN, InputExprN, Label0, ...

Constructors, Getter, Setters, etc of GCCAsmStmt needs to be adapted to understand this order

Metadata

Metadata

Assignees

No one assigned

    Labels

    clang:frontendLanguage frontend issues, e.g. anything involving "Sema"code-cleanup

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions