| Index: src/IceOperand.h
|
| diff --git a/src/IceOperand.h b/src/IceOperand.h
|
| index 9638066ec89f157fde02511aa98edc716fc595e6..ff7efba4c00b592c608329104dbefc0eb8ad111b 100644
|
| --- a/src/IceOperand.h
|
| +++ b/src/IceOperand.h
|
| @@ -8,11 +8,10 @@
|
| //===----------------------------------------------------------------------===//
|
| ///
|
| /// \file
|
| -/// This file declares the Operand class and its target-independent
|
| -/// subclasses. The main classes are Variable, which represents an
|
| -/// LLVM variable that is either register- or stack-allocated, and the
|
| -/// Constant hierarchy, which represents integer, floating-point,
|
| -/// and/or symbolic constants.
|
| +/// This file declares the Operand class and its target-independent subclasses.
|
| +/// The main classes are Variable, which represents an LLVM variable that is
|
| +/// either register- or stack-allocated, and the Constant hierarchy, which
|
| +/// represents integer, floating-point, and/or symbolic constants.
|
| ///
|
| //===----------------------------------------------------------------------===//
|
|
|
| @@ -22,6 +21,7 @@
|
| #include "IceCfg.h"
|
| #include "IceDefs.h"
|
| #include "IceGlobalContext.h"
|
| +#include "IceTargetKinds.def"
|
| #include "IceTypes.h"
|
|
|
| namespace Ice {
|
| @@ -41,25 +41,30 @@ public:
|
| kConstDouble,
|
| kConstRelocatable,
|
| kConstUndef,
|
| - kConst_Target, // leave space for target-specific constant kinds
|
| - kConst_Num = kConst_Target + MaxTargetKinds,
|
| +#define X(n) kConst_Target##n,
|
| + TARGETKINDS_TABLE
|
| +#undef X
|
| + kConst_Max = kConst_Target0 + TARGETKINDS_TABLE_MAX,
|
| kVariable,
|
| - kVariable_Target, // leave space for target-specific variable kinds
|
| - kVariable_Num = kVariable_Target + MaxTargetKinds,
|
| +#define X(n) kVariable_Target##n,
|
| + TARGETKINDS_TABLE
|
| +#undef X
|
| + kVariable_Max = kVariable_Target0 + TARGETKINDS_TABLE_MAX,
|
| // Target-specific operand classes use kTarget as the starting
|
| // point for their Kind enum space. Note that the value-spaces are shared
|
| // across targets. To avoid confusion over the definition of shared
|
| // values, an object specific to one target should never be passed
|
| // to a different target.
|
| - kTarget
|
| +#define X(n) kTarget##n,
|
| + TARGETKINDS_TABLE
|
| +#undef X
|
| };
|
| OperandKind getKind() const { return Kind; }
|
| Type getType() const { return Ty; }
|
|
|
| - /// Every Operand keeps an array of the Variables referenced in
|
| - /// the operand. This is so that the liveness operations can get
|
| - /// quick access to the variables of interest, without having to dig
|
| - /// so far into the operand.
|
| + /// Every Operand keeps an array of the Variables referenced in the operand.
|
| + /// This is so that the liveness operations can get quick access to the
|
| + /// variables of interest, without having to dig so far into the operand.
|
| SizeT getNumVars() const { return NumVars; }
|
| Variable *getVar(SizeT I) const {
|
| assert(I < getNumVars());
|
| @@ -118,7 +123,7 @@ public:
|
|
|
| static bool classof(const Operand *Operand) {
|
| OperandKind Kind = Operand->getKind();
|
| - return Kind >= kConst_Base && Kind <= kConst_Num;
|
| + return Kind >= kConst_Base && Kind <= kConst_Max;
|
| }
|
|
|
| /// Judge if this given immediate should be randomized or pooled
|
| @@ -508,7 +513,7 @@ public:
|
|
|
| static bool classof(const Operand *Operand) {
|
| OperandKind Kind = Operand->getKind();
|
| - return Kind >= kVariable && Kind <= kVariable_Num;
|
| + return Kind >= kVariable && Kind <= kVariable_Max;
|
| }
|
|
|
| protected:
|
|
|