Chromium Code Reviews| Index: src/IceOperand.h |
| diff --git a/src/IceOperand.h b/src/IceOperand.h |
| index 54ac48b88a28b83b4c0bc05c473fa1c536445c3b..286c7714559b04fa43709bef380c6781cefff301 100644 |
| --- a/src/IceOperand.h |
| +++ b/src/IceOperand.h |
| @@ -31,6 +31,7 @@ public: |
| kConstFloat, |
| kConstDouble, |
| kConstRelocatable, |
| + kConstUndef, |
| kConst_Num, |
| kVariable, |
| // Target-specific operand classes use kTarget as the starting |
| @@ -206,6 +207,38 @@ private: |
| bool SuppressMangling; |
| }; |
| +// ConstantUndef represents an unspecified bit pattern. |
|
jvoung (off chromium)
2014/06/17 21:48:53
The comment says it will be an unspecified bit pat
wala
2014/06/18 01:17:46
Agreed; I've updated the comment.
|
| +class ConstantUndef : public Constant { |
| +public: |
| + static ConstantUndef *create(GlobalContext *Ctx, Type Ty, |
| + uint32_t PoolEntryID) { |
| + return new (Ctx->allocate<ConstantUndef>()) ConstantUndef(Ty, PoolEntryID); |
| + } |
| + |
| + using Constant::emit; |
| + virtual void emit(GlobalContext *Ctx) const { |
| + Ostream &Str = Ctx->getStrEmit(); |
| + Str << "undef"; |
| + } |
| + |
| + using Constant::dump; |
| + virtual void dump(GlobalContext *Ctx) const { |
| + Ostream &Str = Ctx->getStrEmit(); |
| + Str << "undef"; |
| + } |
| + |
| + static bool classof(const Operand *Operand) { |
| + return Operand->getKind() == kConstUndef; |
| + } |
| + |
| +private: |
| + ConstantUndef(Type Ty, uint32_t PoolEntryID) |
| + : Constant(kConstUndef, Ty, PoolEntryID) {} |
| + ConstantUndef(const ConstantUndef &) LLVM_DELETED_FUNCTION; |
| + ConstantUndef &operator=(const ConstantUndef &) LLVM_DELETED_FUNCTION; |
| + virtual ~ConstantUndef() {} |
| +}; |
| + |
| // RegWeight is a wrapper for a uint32_t weight value, with a |
| // special value that represents infinite weight, and an addWeight() |
| // method that ensures that W+infinity=infinity. |