@@ -76,14 +76,15 @@ class ConstraintSystem {
7676
7777 llvm::ArrayRef<Variable *> variables () const { return m_variables; }
7878
79- bool addConstraint (llvm::raw_ostream &errs, llvm::Init *init, Variable *self);
79+ bool addConstraint (llvm::raw_ostream &errs, const llvm::Init *init,
80+ Variable *self);
8081 void merge (ConstraintSystem &&rhs);
8182
8283 void print (llvm::raw_ostream &out, llvm::StringRef prefix) const ;
8384 void dump () const ;
8485
8586private:
86- bool addConstraintImpl (llvm::raw_ostream &errs, llvm::Init *init,
87+ bool addConstraintImpl (llvm::raw_ostream &errs, const llvm::Init *init,
8788 Variable *self);
8889 void addVariable (Variable *variable);
8990 void addGlobalVariable (Variable *variable);
@@ -117,7 +118,7 @@ class Constraint {
117118 virtual void print (llvm::raw_ostream &out, llvm::StringRef prefix) const = 0;
118119
119120 Kind getKind () const { return m_kind; }
120- llvm::Init *getInit () const { return m_init; }
121+ const llvm::Init *getInit () const { return m_init; }
121122 Variable *getSelf () const { return m_self; }
122123 llvm::ArrayRef<Variable *> variables () const { return m_variables; }
123124
@@ -134,7 +135,7 @@ class Constraint {
134135
135136 // / Only for error messages: The TableGen init (if any) from which this
136137 // / constraint was derived.
137- llvm::Init *m_init = nullptr ;
138+ const llvm::Init *m_init = nullptr ;
138139
139140 // / Only for error messages: The variable in the valued position that this
140141 // / constraint originally appeared in (if any).
@@ -178,13 +179,15 @@ class LogicOr : public Constraint {
178179 void print (llvm::raw_ostream &out, llvm::StringRef prefix) const override ;
179180
180181 llvm::ArrayRef<ConstraintSystem> branches () const { return m_branches; }
181- llvm::ArrayRef<llvm::Init *> branchInits () const { return m_branchInits; }
182+ llvm::ArrayRef<const llvm::Init *> branchInits () const {
183+ return m_branchInits;
184+ }
182185
183186private:
184187 std::vector<ConstraintSystem> m_branches;
185188
186189 // / Only for error messages.
187- std::vector<llvm::Init *> m_branchInits;
190+ std::vector<const llvm::Init *> m_branchInits;
188191};
189192
190193class MetaType {
@@ -226,7 +229,7 @@ class Attr : public MetaType {
226229
227230 llvm::StringRef getName () const ;
228231 llvm::StringRef getCppType () const { return m_cppType; }
229- llvm::Init *getLlvmType () const { return m_llvmType; }
232+ const llvm::Init *getLlvmType () const { return m_llvmType; }
230233 llvm::StringRef getToLlvmValue () const { return m_toLlvmValue; }
231234 llvm::StringRef getFromLlvmValue () const { return m_fromLlvmValue; }
232235 llvm::StringRef getToUnsigned () const { return m_toUnsigned; }
@@ -236,7 +239,7 @@ class Attr : public MetaType {
236239
237240 // Set the LLVMType once -- used during initialization to break a circular
238241 // dependency in how IntegerType is defined.
239- void setLlvmType (llvm::Init *llvmType) {
242+ void setLlvmType (const llvm::Init *llvmType) {
240243 assert (!m_llvmType);
241244 assert (llvmType);
242245 m_llvmType = llvmType;
@@ -245,7 +248,7 @@ class Attr : public MetaType {
245248private:
246249 RecordTy *m_record = nullptr ;
247250 std::string m_cppType;
248- llvm::Init *m_llvmType = nullptr ;
251+ const llvm::Init *m_llvmType = nullptr ;
249252 std::string m_toLlvmValue;
250253 std::string m_fromLlvmValue;
251254 std::string m_toUnsigned;
0 commit comments