strimo378 created this revision.
Herald added a project: All.
strimo378 requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D158055

Files:
  clang/include/clang/AST/Decl.h
  clang/include/clang/AST/Expr.h


Index: clang/include/clang/AST/Expr.h
===================================================================
--- clang/include/clang/AST/Expr.h
+++ 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<NestedNameSpecifierLoc>();
   }
 
+  void setQualifierLoc(NestedNameSpecifierLoc QL) {
+    assert(hasQualifier());
+    *getTrailingObjects<NestedNameSpecifierLoc>() = 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<NamedDecl *>() : D;
   }
 
+  void setFoundDecl(NamedDecl *ND) {
+    assert(hasFoundDecl());
+    *getTrailingObjects<NamedDecl *>() = ND;
+  }
+
   bool hasTemplateKWAndArgsInfo() const {
     return DeclRefExprBits.HasTemplateKWAndArgsInfo;
   }
@@ -3296,6 +3308,11 @@
     return getTrailingObjects<MemberExprNameQualifier>()->QualifierLoc;
   }
 
+  void setQualifierLoc(NestedNameSpecifierLoc QL) {
+    assert(hasQualifierOrFoundDecl());
+    getTrailingObjects<MemberExprNameQualifier>()->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; }
Index: clang/include/clang/AST/Decl.h
===================================================================
--- clang/include/clang/AST/Decl.h
+++ 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; }
 


Index: clang/include/clang/AST/Expr.h
===================================================================
--- clang/include/clang/AST/Expr.h
+++ 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<NestedNameSpecifierLoc>();
   }
 
+  void setQualifierLoc(NestedNameSpecifierLoc QL) {
+    assert(hasQualifier());
+    *getTrailingObjects<NestedNameSpecifierLoc>() = 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<NamedDecl *>() : D;
   }
 
+  void setFoundDecl(NamedDecl *ND) {
+    assert(hasFoundDecl());
+    *getTrailingObjects<NamedDecl *>() = ND;
+  }
+
   bool hasTemplateKWAndArgsInfo() const {
     return DeclRefExprBits.HasTemplateKWAndArgsInfo;
   }
@@ -3296,6 +3308,11 @@
     return getTrailingObjects<MemberExprNameQualifier>()->QualifierLoc;
   }
 
+  void setQualifierLoc(NestedNameSpecifierLoc QL) {
+    assert(hasQualifierOrFoundDecl());
+    getTrailingObjects<MemberExprNameQualifier>()->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; }
Index: clang/include/clang/AST/Decl.h
===================================================================
--- clang/include/clang/AST/Decl.h
+++ 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; }
 
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to