OLD | NEW |
1 //===- subzero/src/IceOperand.h - High-level operands -----------*- C++ -*-===// | 1 //===- subzero/src/IceOperand.h - High-level operands -----------*- C++ -*-===// |
2 // | 2 // |
3 // The Subzero Code Generator | 3 // The Subzero Code Generator |
4 // | 4 // |
5 // This file is distributed under the University of Illinois Open Source | 5 // This file is distributed under the University of Illinois Open Source |
6 // License. See LICENSE.TXT for details. | 6 // License. See LICENSE.TXT for details. |
7 // | 7 // |
8 //===----------------------------------------------------------------------===// | 8 //===----------------------------------------------------------------------===// |
9 /// | 9 /// |
10 /// \file | 10 /// \file |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 class ConstantPrimitive : public Constant { | 159 class ConstantPrimitive : public Constant { |
160 ConstantPrimitive() = delete; | 160 ConstantPrimitive() = delete; |
161 ConstantPrimitive(const ConstantPrimitive &) = delete; | 161 ConstantPrimitive(const ConstantPrimitive &) = delete; |
162 ConstantPrimitive &operator=(const ConstantPrimitive &) = delete; | 162 ConstantPrimitive &operator=(const ConstantPrimitive &) = delete; |
163 | 163 |
164 public: | 164 public: |
165 using PrimType = T; | 165 using PrimType = T; |
166 | 166 |
167 static ConstantPrimitive *create(GlobalContext *Ctx, Type Ty, | 167 static ConstantPrimitive *create(GlobalContext *Ctx, Type Ty, |
168 PrimType Value) { | 168 PrimType Value) { |
169 assert(!Ctx->isIRGenerationDisabled() && | |
170 "Attempt to build primitive constant when IR generation disabled"); | |
171 return new (Ctx->allocate<ConstantPrimitive>()) | 169 return new (Ctx->allocate<ConstantPrimitive>()) |
172 ConstantPrimitive(Ty, Value); | 170 ConstantPrimitive(Ty, Value); |
173 } | 171 } |
174 PrimType getValue() const { return Value; } | 172 PrimType getValue() const { return Value; } |
175 void emitPoolLabel(Ostream &Str, const GlobalContext *Ctx) const final { | 173 void emitPoolLabel(Ostream &Str, const GlobalContext *Ctx) const final { |
176 Str << ".L$" << getType() << "$"; | 174 Str << ".L$" << getType() << "$"; |
177 // Print hex characters byte by byte, starting from the most significant | 175 // Print hex characters byte by byte, starting from the most significant |
178 // byte. NOTE: This ordering assumes Subzero runs on a little-endian | 176 // byte. NOTE: This ordering assumes Subzero runs on a little-endian |
179 // platform. That means the possibility of different label names depending | 177 // platform. That means the possibility of different label names depending |
180 // on the endian-ness of the platform where Subzero runs. | 178 // on the endian-ness of the platform where Subzero runs. |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
272 /// ConstantRelocatable represents a symbolic constant combined with a fixed | 270 /// ConstantRelocatable represents a symbolic constant combined with a fixed |
273 /// offset. | 271 /// offset. |
274 class ConstantRelocatable : public Constant { | 272 class ConstantRelocatable : public Constant { |
275 ConstantRelocatable() = delete; | 273 ConstantRelocatable() = delete; |
276 ConstantRelocatable(const ConstantRelocatable &) = delete; | 274 ConstantRelocatable(const ConstantRelocatable &) = delete; |
277 ConstantRelocatable &operator=(const ConstantRelocatable &) = delete; | 275 ConstantRelocatable &operator=(const ConstantRelocatable &) = delete; |
278 | 276 |
279 public: | 277 public: |
280 static ConstantRelocatable *create(GlobalContext *Ctx, Type Ty, | 278 static ConstantRelocatable *create(GlobalContext *Ctx, Type Ty, |
281 const RelocatableTuple &Tuple) { | 279 const RelocatableTuple &Tuple) { |
282 assert(!Ctx->isIRGenerationDisabled() && | |
283 "Attempt to build relocatable constant when IR generation disabled"); | |
284 return new (Ctx->allocate<ConstantRelocatable>()) ConstantRelocatable( | 280 return new (Ctx->allocate<ConstantRelocatable>()) ConstantRelocatable( |
285 Ty, Tuple.Offset, Tuple.Name, Tuple.SuppressMangling); | 281 Ty, Tuple.Offset, Tuple.Name, Tuple.SuppressMangling); |
286 } | 282 } |
287 | 283 |
288 RelocOffsetT getOffset() const { return Offset; } | 284 RelocOffsetT getOffset() const { return Offset; } |
289 const IceString &getName() const { return Name; } | 285 const IceString &getName() const { return Name; } |
290 void setSuppressMangling(bool Value) { SuppressMangling = Value; } | 286 void setSuppressMangling(bool Value) { SuppressMangling = Value; } |
291 bool getSuppressMangling() const { return SuppressMangling; } | 287 bool getSuppressMangling() const { return SuppressMangling; } |
292 using Constant::emit; | 288 using Constant::emit; |
293 void emit(TargetLowering *Target) const final; | 289 void emit(TargetLowering *Target) const final; |
(...skipping 19 matching lines...) Expand all Loading... |
313 /// ConstantUndef represents an unspecified bit pattern. Although it is legal to | 309 /// ConstantUndef represents an unspecified bit pattern. Although it is legal to |
314 /// lower ConstantUndef to any value, backends should try to make code | 310 /// lower ConstantUndef to any value, backends should try to make code |
315 /// generation deterministic by lowering ConstantUndefs to 0. | 311 /// generation deterministic by lowering ConstantUndefs to 0. |
316 class ConstantUndef : public Constant { | 312 class ConstantUndef : public Constant { |
317 ConstantUndef() = delete; | 313 ConstantUndef() = delete; |
318 ConstantUndef(const ConstantUndef &) = delete; | 314 ConstantUndef(const ConstantUndef &) = delete; |
319 ConstantUndef &operator=(const ConstantUndef &) = delete; | 315 ConstantUndef &operator=(const ConstantUndef &) = delete; |
320 | 316 |
321 public: | 317 public: |
322 static ConstantUndef *create(GlobalContext *Ctx, Type Ty) { | 318 static ConstantUndef *create(GlobalContext *Ctx, Type Ty) { |
323 assert(!Ctx->isIRGenerationDisabled() && | |
324 "Attempt to build undefined constant when IR generation disabled"); | |
325 return new (Ctx->allocate<ConstantUndef>()) ConstantUndef(Ty); | 319 return new (Ctx->allocate<ConstantUndef>()) ConstantUndef(Ty); |
326 } | 320 } |
327 | 321 |
328 using Constant::emit; | 322 using Constant::emit; |
329 void emit(TargetLowering *Target) const final; | 323 void emit(TargetLowering *Target) const final; |
330 using Constant::dump; | 324 using Constant::dump; |
331 void dump(const Cfg *, Ostream &Str) const override { | 325 void dump(const Cfg *, Ostream &Str) const override { |
332 if (BuildDefs::dump()) | 326 if (BuildDefs::dump()) |
333 Str << "undef"; | 327 Str << "undef"; |
334 } | 328 } |
(...skipping 433 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
768 private: | 762 private: |
769 const Cfg *Func; | 763 const Cfg *Func; |
770 MetadataKind Kind; | 764 MetadataKind Kind; |
771 CfgVector<VariableTracking> Metadata; | 765 CfgVector<VariableTracking> Metadata; |
772 const static InstDefList NoDefinitions; | 766 const static InstDefList NoDefinitions; |
773 }; | 767 }; |
774 | 768 |
775 } // end of namespace Ice | 769 } // end of namespace Ice |
776 | 770 |
777 #endif // SUBZERO_SRC_ICEOPERAND_H | 771 #endif // SUBZERO_SRC_ICEOPERAND_H |
OLD | NEW |