diff --git a/clang/include/clang/AST/Decl.h b/clang/include/clang/AST/Decl.h --- a/clang/include/clang/AST/Decl.h +++ b/clang/include/clang/AST/Decl.h @@ -2118,6 +2118,8 @@ return DeclarationNameInfo(getDeclName(), getLocation(), DNLoc); } + void setDeclNameLoc(const DeclarationNameLoc &Loc) { DNLoc = Loc; } + void getNameForDiagnostic(raw_ostream &OS, const PrintingPolicy &Policy, bool Qualified) const override; @@ -3046,6 +3048,8 @@ /// Determines whether this field is mutable (C++ only). bool isMutable() const { return Mutable; } + void setMutable(bool Mutable) { this->Mutable = Mutable; } + /// Determines whether this field is a bitfield. bool isBitField() const { return BitField; } diff --git a/clang/include/clang/AST/Expr.h b/clang/include/clang/AST/Expr.h --- a/clang/include/clang/AST/Expr.h +++ b/clang/include/clang/AST/Expr.h @@ -1199,6 +1199,8 @@ /// place. Expr *getSourceExpr() const { return SourceExpr; } + void setSourceExpr(Expr *E) { SourceExpr = E; } + void setIsUnique(bool V) { assert((!V || SourceExpr) && "unique OVEs are expected to have source expressions"); @@ -1332,6 +1334,11 @@ return *getTrailingObjects(); } + void setQualifierLoc(NestedNameSpecifierLoc QL) { + assert(hasQualifier()); + *getTrailingObjects() = QL; + } + /// If the name was qualified, retrieves the nested-name-specifier /// that precedes the name. Otherwise, returns NULL. NestedNameSpecifier *getQualifier() const { @@ -1354,6 +1361,11 @@ return hasFoundDecl() ? *getTrailingObjects() : D; } + void setFoundDecl(NamedDecl *ND) { + assert(hasFoundDecl()); + *getTrailingObjects() = ND; + } + bool hasTemplateKWAndArgsInfo() const { return DeclRefExprBits.HasTemplateKWAndArgsInfo; } @@ -3296,6 +3308,11 @@ return getTrailingObjects()->QualifierLoc; } + void setQualifierLoc(NestedNameSpecifierLoc QL) { + assert(hasQualifierOrFoundDecl()); + getTrailingObjects()->QualifierLoc = QL; + } + /// If the member name was qualified, retrieves the /// nested-name-specifier that precedes the member name. Otherwise, returns /// NULL. @@ -3370,6 +3387,10 @@ MemberLoc, MemberDNLoc); } + void setMemberDeclNameLoc(const DeclarationNameLoc &Loc) { + MemberDNLoc = Loc; + } + SourceLocation getOperatorLoc() const { return MemberExprBits.OperatorLoc; } bool isArrow() const { return MemberExprBits.IsArrow; }