Commit 7b451a92 by Jim Stichnoth

Subzero: Class definition cleanup.

For consistency, put deleted ctors at the beginning of the class definition. If the default copy ctor or assignment operator is not deleted, and the default implementation is used, leave it commented out to indicate it is intentional. Also, fixed one C++11 related TODO. BUG= none R=jvoung@chromium.org, kschimpf@google.com Review URL: https://codereview.chromium.org/656123003
parent 5ce0abb8
...@@ -48,10 +48,6 @@ CfgNode *Cfg::makeNode(const IceString &Name) { ...@@ -48,10 +48,6 @@ CfgNode *Cfg::makeNode(const IceString &Name) {
return Node; return Node;
} }
Variable *Cfg::makeVariable(Type Ty, const IceString &Name) {
return makeVariable<Variable>(Ty, Name);
}
void Cfg::addArg(Variable *Arg) { void Cfg::addArg(Variable *Arg) {
Arg->setIsArg(); Arg->setIsArg();
Args.push_back(Arg); Args.push_back(Arg);
......
...@@ -28,6 +28,9 @@ ...@@ -28,6 +28,9 @@
namespace Ice { namespace Ice {
class Cfg { class Cfg {
Cfg(const Cfg &) = delete;
Cfg &operator=(const Cfg &) = delete;
public: public:
Cfg(GlobalContext *Ctx); Cfg(GlobalContext *Ctx);
~Cfg(); ~Cfg();
...@@ -67,15 +70,13 @@ public: ...@@ -67,15 +70,13 @@ public:
// Manage Variables. // Manage Variables.
// Create a new Variable with a particular type and an optional // Create a new Variable with a particular type and an optional
// name. The Node argument is the node where the variable is defined. // name. The Node argument is the node where the variable is defined.
template <typename T> T *makeVariable(Type Ty, const IceString &Name = "") { template <typename T = Variable>
T *makeVariable(Type Ty, const IceString &Name = "") {
SizeT Index = Variables.size(); SizeT Index = Variables.size();
T *Var = T::create(this, Ty, Index, Name); T *Var = T::create(this, Ty, Index, Name);
Variables.push_back(Var); Variables.push_back(Var);
return Var; return Var;
} }
// TODO(stichnot): Remove this function with C++11, and use default
// argument <typename T=Variable> above.
Variable *makeVariable(Type Ty, const IceString &Name = "");
SizeT getNumVariables() const { return Variables.size(); } SizeT getNumVariables() const { return Variables.size(); }
const VarList &getVariables() const { return Variables; } const VarList &getVariables() const { return Variables; }
...@@ -187,9 +188,6 @@ private: ...@@ -187,9 +188,6 @@ private:
// register allocation, resetCurrentNode() should be called to avoid // register allocation, resetCurrentNode() should be called to avoid
// spurious validation failures. // spurious validation failures.
const CfgNode *CurrentNode; const CfgNode *CurrentNode;
Cfg(const Cfg &) = delete;
Cfg &operator=(const Cfg &) = delete;
}; };
} // end of namespace Ice } // end of namespace Ice
......
...@@ -21,6 +21,9 @@ ...@@ -21,6 +21,9 @@
namespace Ice { namespace Ice {
class CfgNode { class CfgNode {
CfgNode(const CfgNode &) = delete;
CfgNode &operator=(const CfgNode &) = delete;
public: public:
static CfgNode *create(Cfg *Func, SizeT LabelIndex, IceString Name = "") { static CfgNode *create(Cfg *Func, SizeT LabelIndex, IceString Name = "") {
return new (Func->allocate<CfgNode>()) CfgNode(Func, LabelIndex, Name); return new (Func->allocate<CfgNode>()) CfgNode(Func, LabelIndex, Name);
...@@ -76,8 +79,6 @@ public: ...@@ -76,8 +79,6 @@ public:
private: private:
CfgNode(Cfg *Func, SizeT LabelIndex, IceString Name); CfgNode(Cfg *Func, SizeT LabelIndex, IceString Name);
CfgNode(const CfgNode &) = delete;
CfgNode &operator=(const CfgNode &) = delete;
Cfg *const Func; Cfg *const Func;
const SizeT Number; // label index const SizeT Number; // label index
IceString Name; // for dumping only IceString Name; // for dumping only
......
...@@ -25,6 +25,9 @@ class Module; ...@@ -25,6 +25,9 @@ class Module;
namespace Ice { namespace Ice {
class Converter : public Translator { class Converter : public Translator {
Converter(const Converter &) = delete;
Converter &operator=(const Converter &) = delete;
public: public:
Converter(llvm::Module *Mod, GlobalContext *Ctx, const Ice::ClFlags &Flags) Converter(llvm::Module *Mod, GlobalContext *Ctx, const Ice::ClFlags &Flags)
: Translator(Ctx, Flags), Mod(Mod) {} : Translator(Ctx, Flags), Mod(Mod) {}
...@@ -64,9 +67,6 @@ private: ...@@ -64,9 +67,6 @@ private:
// Installs global declarations into GlobalDeclarationMap. // Installs global declarations into GlobalDeclarationMap.
void installGlobalDeclarations(llvm::Module *Mod); void installGlobalDeclarations(llvm::Module *Mod);
Converter(const Converter &) = delete;
Converter &operator=(const Converter &) = delete;
}; };
} // end of namespace ICE. } // end of namespace ICE.
......
...@@ -34,6 +34,9 @@ class FuncSigType; ...@@ -34,6 +34,9 @@ class FuncSigType;
// This class collects rudimentary statistics during translation. // This class collects rudimentary statistics during translation.
class CodeStats { class CodeStats {
CodeStats(const CodeStats &) = delete;
// CodeStats &operator=(const CodeStats &) = delete;
public: public:
CodeStats() CodeStats()
: InstructionsEmitted(0), RegistersSaved(0), FrameBytes(0), Spills(0), : InstructionsEmitted(0), RegistersSaved(0), FrameBytes(0), Spills(0),
...@@ -65,6 +68,9 @@ private: ...@@ -65,6 +68,9 @@ private:
// be synchronized, especially the constant pool, the allocator, and // be synchronized, especially the constant pool, the allocator, and
// the output streams. // the output streams.
class GlobalContext { class GlobalContext {
GlobalContext(const GlobalContext &) = delete;
GlobalContext &operator=(const GlobalContext &) = delete;
public: public:
GlobalContext(llvm::raw_ostream *OsDump, llvm::raw_ostream *OsEmit, GlobalContext(llvm::raw_ostream *OsDump, llvm::raw_ostream *OsEmit,
VerboseMask Mask, TargetArch Arch, OptLevel Opt, VerboseMask Mask, TargetArch Arch, OptLevel Opt,
...@@ -201,8 +207,6 @@ private: ...@@ -201,8 +207,6 @@ private:
CodeStats StatsCumulative; CodeStats StatsCumulative;
std::vector<TimerStack> Timers; std::vector<TimerStack> Timers;
std::vector<GlobalDeclaration *> GlobalDeclarations; std::vector<GlobalDeclaration *> GlobalDeclarations;
GlobalContext(const GlobalContext &) = delete;
GlobalContext &operator=(const GlobalContext &) = delete;
// Private helpers for mangleName() // Private helpers for mangleName()
typedef llvm::SmallVector<char, 32> ManglerVector; typedef llvm::SmallVector<char, 32> ManglerVector;
......
...@@ -35,6 +35,9 @@ namespace Ice { ...@@ -35,6 +35,9 @@ namespace Ice {
// from InstHighLevel, and low-level (target-specific) ICE // from InstHighLevel, and low-level (target-specific) ICE
// instructions inherit from InstTarget. // instructions inherit from InstTarget.
class Inst { class Inst {
Inst(const Inst &) = delete;
Inst &operator=(const Inst &) = delete;
public: public:
enum InstKind { enum InstKind {
// Arbitrary (alphabetical) order, except put Unreachable first. // Arbitrary (alphabetical) order, except put Unreachable first.
...@@ -169,10 +172,6 @@ protected: ...@@ -169,10 +172,6 @@ protected:
// tracked this way. // tracked this way.
typedef uint32_t LREndedBits; // only first 32 src operands tracked, sorry typedef uint32_t LREndedBits; // only first 32 src operands tracked, sorry
LREndedBits LiveRangesEnded; LREndedBits LiveRangesEnded;
private:
Inst(const Inst &) = delete;
Inst &operator=(const Inst &) = delete;
}; };
class InstHighLevel : public Inst { class InstHighLevel : public Inst {
...@@ -195,6 +194,9 @@ protected: ...@@ -195,6 +194,9 @@ protected:
// and the required alignment in bytes. The alignment must be either // and the required alignment in bytes. The alignment must be either
// 0 (no alignment required) or a power of 2. // 0 (no alignment required) or a power of 2.
class InstAlloca : public InstHighLevel { class InstAlloca : public InstHighLevel {
InstAlloca(const InstAlloca &) = delete;
InstAlloca &operator=(const InstAlloca &) = delete;
public: public:
static InstAlloca *create(Cfg *Func, Operand *ByteCount, static InstAlloca *create(Cfg *Func, Operand *ByteCount,
uint32_t AlignInBytes, Variable *Dest) { uint32_t AlignInBytes, Variable *Dest) {
...@@ -209,8 +211,6 @@ public: ...@@ -209,8 +211,6 @@ public:
private: private:
InstAlloca(Cfg *Func, Operand *ByteCount, uint32_t AlignInBytes, InstAlloca(Cfg *Func, Operand *ByteCount, uint32_t AlignInBytes,
Variable *Dest); Variable *Dest);
InstAlloca(const InstAlloca &) = delete;
InstAlloca &operator=(const InstAlloca &) = delete;
~InstAlloca() override {} ~InstAlloca() override {}
const uint32_t AlignInBytes; const uint32_t AlignInBytes;
}; };
...@@ -218,6 +218,9 @@ private: ...@@ -218,6 +218,9 @@ private:
// Binary arithmetic instruction. The source operands are captured in // Binary arithmetic instruction. The source operands are captured in
// getSrc(0) and getSrc(1). // getSrc(0) and getSrc(1).
class InstArithmetic : public InstHighLevel { class InstArithmetic : public InstHighLevel {
InstArithmetic(const InstArithmetic &) = delete;
InstArithmetic &operator=(const InstArithmetic &) = delete;
public: public:
enum OpKind { enum OpKind {
#define X(tag, str, commutative) tag, #define X(tag, str, commutative) tag,
...@@ -242,8 +245,6 @@ public: ...@@ -242,8 +245,6 @@ public:
private: private:
InstArithmetic(Cfg *Func, OpKind Op, Variable *Dest, Operand *Source1, InstArithmetic(Cfg *Func, OpKind Op, Variable *Dest, Operand *Source1,
Operand *Source2); Operand *Source2);
InstArithmetic(const InstArithmetic &) = delete;
InstArithmetic &operator=(const InstArithmetic &) = delete;
~InstArithmetic() override {} ~InstArithmetic() override {}
const OpKind Op; const OpKind Op;
...@@ -256,6 +257,9 @@ private: ...@@ -256,6 +257,9 @@ private:
// Inttoptr instruction, or as an intermediate step for lowering a // Inttoptr instruction, or as an intermediate step for lowering a
// Load instruction. // Load instruction.
class InstAssign : public InstHighLevel { class InstAssign : public InstHighLevel {
InstAssign(const InstAssign &) = delete;
InstAssign &operator=(const InstAssign &) = delete;
public: public:
static InstAssign *create(Cfg *Func, Variable *Dest, Operand *Source) { static InstAssign *create(Cfg *Func, Variable *Dest, Operand *Source) {
return new (Func->allocateInst<InstAssign>()) return new (Func->allocateInst<InstAssign>())
...@@ -267,14 +271,15 @@ public: ...@@ -267,14 +271,15 @@ public:
private: private:
InstAssign(Cfg *Func, Variable *Dest, Operand *Source); InstAssign(Cfg *Func, Variable *Dest, Operand *Source);
InstAssign(const InstAssign &) = delete;
InstAssign &operator=(const InstAssign &) = delete;
~InstAssign() override {} ~InstAssign() override {}
}; };
// Branch instruction. This represents both conditional and // Branch instruction. This represents both conditional and
// unconditional branches. // unconditional branches.
class InstBr : public InstHighLevel { class InstBr : public InstHighLevel {
InstBr(const InstBr &) = delete;
InstBr &operator=(const InstBr &) = delete;
public: public:
// Create a conditional branch. If TargetTrue==TargetFalse, it is // Create a conditional branch. If TargetTrue==TargetFalse, it is
// optimized to an unconditional branch. // optimized to an unconditional branch.
...@@ -307,8 +312,6 @@ private: ...@@ -307,8 +312,6 @@ private:
InstBr(Cfg *Func, Operand *Source, CfgNode *TargetTrue, CfgNode *TargetFalse); InstBr(Cfg *Func, Operand *Source, CfgNode *TargetTrue, CfgNode *TargetFalse);
// Unconditional branch // Unconditional branch
InstBr(Cfg *Func, CfgNode *Target); InstBr(Cfg *Func, CfgNode *Target);
InstBr(const InstBr &) = delete;
InstBr &operator=(const InstBr &) = delete;
~InstBr() override {} ~InstBr() override {}
CfgNode *const TargetFalse; // Doubles as unconditional branch target CfgNode *const TargetFalse; // Doubles as unconditional branch target
...@@ -318,6 +321,9 @@ private: ...@@ -318,6 +321,9 @@ private:
// Call instruction. The call target is captured as getSrc(0), and // Call instruction. The call target is captured as getSrc(0), and
// arg I is captured as getSrc(I+1). // arg I is captured as getSrc(I+1).
class InstCall : public InstHighLevel { class InstCall : public InstHighLevel {
InstCall(const InstCall &) = delete;
InstCall &operator=(const InstCall &) = delete;
public: public:
static InstCall *create(Cfg *Func, SizeT NumArgs, Variable *Dest, static InstCall *create(Cfg *Func, SizeT NumArgs, Variable *Dest,
Operand *CallTarget, bool HasTailCall) { Operand *CallTarget, bool HasTailCall) {
...@@ -349,12 +355,13 @@ protected: ...@@ -349,12 +355,13 @@ protected:
private: private:
bool HasTailCall; bool HasTailCall;
InstCall(const InstCall &) = delete;
InstCall &operator=(const InstCall &) = delete;
}; };
// Cast instruction (a.k.a. conversion operation). // Cast instruction (a.k.a. conversion operation).
class InstCast : public InstHighLevel { class InstCast : public InstHighLevel {
InstCast(const InstCast &) = delete;
InstCast &operator=(const InstCast &) = delete;
public: public:
enum OpKind { enum OpKind {
#define X(tag, str) tag, #define X(tag, str) tag,
...@@ -374,14 +381,15 @@ public: ...@@ -374,14 +381,15 @@ public:
private: private:
InstCast(Cfg *Func, OpKind CastKind, Variable *Dest, Operand *Source); InstCast(Cfg *Func, OpKind CastKind, Variable *Dest, Operand *Source);
InstCast(const InstCast &) = delete;
InstCast &operator=(const InstCast &) = delete;
~InstCast() override {} ~InstCast() override {}
const OpKind CastKind; const OpKind CastKind;
}; };
// ExtractElement instruction. // ExtractElement instruction.
class InstExtractElement : public InstHighLevel { class InstExtractElement : public InstHighLevel {
InstExtractElement(const InstExtractElement &) = delete;
InstExtractElement &operator=(const InstExtractElement &) = delete;
public: public:
static InstExtractElement *create(Cfg *Func, Variable *Dest, Operand *Source1, static InstExtractElement *create(Cfg *Func, Variable *Dest, Operand *Source1,
Operand *Source2) { Operand *Source2) {
...@@ -397,14 +405,15 @@ public: ...@@ -397,14 +405,15 @@ public:
private: private:
InstExtractElement(Cfg *Func, Variable *Dest, Operand *Source1, InstExtractElement(Cfg *Func, Variable *Dest, Operand *Source1,
Operand *Source2); Operand *Source2);
InstExtractElement(const InstExtractElement &) = delete;
InstExtractElement &operator=(const InstExtractElement &) = delete;
~InstExtractElement() override {} ~InstExtractElement() override {}
}; };
// Floating-point comparison instruction. The source operands are // Floating-point comparison instruction. The source operands are
// captured in getSrc(0) and getSrc(1). // captured in getSrc(0) and getSrc(1).
class InstFcmp : public InstHighLevel { class InstFcmp : public InstHighLevel {
InstFcmp(const InstFcmp &) = delete;
InstFcmp &operator=(const InstFcmp &) = delete;
public: public:
enum FCond { enum FCond {
#define X(tag, str) tag, #define X(tag, str) tag,
...@@ -425,8 +434,6 @@ public: ...@@ -425,8 +434,6 @@ public:
private: private:
InstFcmp(Cfg *Func, FCond Condition, Variable *Dest, Operand *Source1, InstFcmp(Cfg *Func, FCond Condition, Variable *Dest, Operand *Source1,
Operand *Source2); Operand *Source2);
InstFcmp(const InstFcmp &) = delete;
InstFcmp &operator=(const InstFcmp &) = delete;
~InstFcmp() override {} ~InstFcmp() override {}
const FCond Condition; const FCond Condition;
}; };
...@@ -434,6 +441,9 @@ private: ...@@ -434,6 +441,9 @@ private:
// Integer comparison instruction. The source operands are captured // Integer comparison instruction. The source operands are captured
// in getSrc(0) and getSrc(1). // in getSrc(0) and getSrc(1).
class InstIcmp : public InstHighLevel { class InstIcmp : public InstHighLevel {
InstIcmp(const InstIcmp &) = delete;
InstIcmp &operator=(const InstIcmp &) = delete;
public: public:
enum ICond { enum ICond {
#define X(tag, str) tag, #define X(tag, str) tag,
...@@ -454,14 +464,15 @@ public: ...@@ -454,14 +464,15 @@ public:
private: private:
InstIcmp(Cfg *Func, ICond Condition, Variable *Dest, Operand *Source1, InstIcmp(Cfg *Func, ICond Condition, Variable *Dest, Operand *Source1,
Operand *Source2); Operand *Source2);
InstIcmp(const InstIcmp &) = delete;
InstIcmp &operator=(const InstIcmp &) = delete;
~InstIcmp() override {} ~InstIcmp() override {}
const ICond Condition; const ICond Condition;
}; };
// InsertElement instruction. // InsertElement instruction.
class InstInsertElement : public InstHighLevel { class InstInsertElement : public InstHighLevel {
InstInsertElement(const InstInsertElement &) = delete;
InstInsertElement &operator=(const InstInsertElement &) = delete;
public: public:
static InstInsertElement *create(Cfg *Func, Variable *Dest, Operand *Source1, static InstInsertElement *create(Cfg *Func, Variable *Dest, Operand *Source1,
Operand *Source2, Operand *Source3) { Operand *Source2, Operand *Source3) {
...@@ -477,14 +488,15 @@ public: ...@@ -477,14 +488,15 @@ public:
private: private:
InstInsertElement(Cfg *Func, Variable *Dest, Operand *Source1, InstInsertElement(Cfg *Func, Variable *Dest, Operand *Source1,
Operand *Source2, Operand *Source3); Operand *Source2, Operand *Source3);
InstInsertElement(const InstInsertElement &) = delete;
InstInsertElement &operator=(const InstInsertElement &) = delete;
~InstInsertElement() override {} ~InstInsertElement() override {}
}; };
// Call to an intrinsic function. The call target is captured as getSrc(0), // Call to an intrinsic function. The call target is captured as getSrc(0),
// and arg I is captured as getSrc(I+1). // and arg I is captured as getSrc(I+1).
class InstIntrinsicCall : public InstCall { class InstIntrinsicCall : public InstCall {
InstIntrinsicCall(const InstIntrinsicCall &) = delete;
InstIntrinsicCall &operator=(const InstIntrinsicCall &) = delete;
public: public:
static InstIntrinsicCall *create(Cfg *Func, SizeT NumArgs, Variable *Dest, static InstIntrinsicCall *create(Cfg *Func, SizeT NumArgs, Variable *Dest,
Operand *CallTarget, Operand *CallTarget,
...@@ -504,14 +516,15 @@ private: ...@@ -504,14 +516,15 @@ private:
: InstCall(Func, NumArgs, Dest, CallTarget, false, Info.HasSideEffects, : InstCall(Func, NumArgs, Dest, CallTarget, false, Info.HasSideEffects,
Inst::IntrinsicCall), Inst::IntrinsicCall),
Info(Info) {} Info(Info) {}
InstIntrinsicCall(const InstIntrinsicCall &) = delete;
InstIntrinsicCall &operator=(const InstIntrinsicCall &) = delete;
~InstIntrinsicCall() override {} ~InstIntrinsicCall() override {}
const Intrinsics::IntrinsicInfo Info; const Intrinsics::IntrinsicInfo Info;
}; };
// Load instruction. The source address is captured in getSrc(0). // Load instruction. The source address is captured in getSrc(0).
class InstLoad : public InstHighLevel { class InstLoad : public InstHighLevel {
InstLoad(const InstLoad &) = delete;
InstLoad &operator=(const InstLoad &) = delete;
public: public:
static InstLoad *create(Cfg *Func, Variable *Dest, Operand *SourceAddr, static InstLoad *create(Cfg *Func, Variable *Dest, Operand *SourceAddr,
uint32_t Align = 1) { uint32_t Align = 1) {
...@@ -526,14 +539,15 @@ public: ...@@ -526,14 +539,15 @@ public:
private: private:
InstLoad(Cfg *Func, Variable *Dest, Operand *SourceAddr); InstLoad(Cfg *Func, Variable *Dest, Operand *SourceAddr);
InstLoad(const InstLoad &) = delete;
InstLoad &operator=(const InstLoad &) = delete;
~InstLoad() override {} ~InstLoad() override {}
}; };
// Phi instruction. For incoming edge I, the node is Labels[I] and // Phi instruction. For incoming edge I, the node is Labels[I] and
// the Phi source operand is getSrc(I). // the Phi source operand is getSrc(I).
class InstPhi : public InstHighLevel { class InstPhi : public InstHighLevel {
InstPhi(const InstPhi &) = delete;
InstPhi &operator=(const InstPhi &) = delete;
public: public:
static InstPhi *create(Cfg *Func, SizeT MaxSrcs, Variable *Dest) { static InstPhi *create(Cfg *Func, SizeT MaxSrcs, Variable *Dest) {
return new (Func->allocateInst<InstPhi>()) InstPhi(Func, MaxSrcs, Dest); return new (Func->allocateInst<InstPhi>()) InstPhi(Func, MaxSrcs, Dest);
...@@ -548,8 +562,6 @@ public: ...@@ -548,8 +562,6 @@ public:
private: private:
InstPhi(Cfg *Func, SizeT MaxSrcs, Variable *Dest); InstPhi(Cfg *Func, SizeT MaxSrcs, Variable *Dest);
InstPhi(const InstPhi &) = delete;
InstPhi &operator=(const InstPhi &) = delete;
void destroy(Cfg *Func) override { void destroy(Cfg *Func) override {
Func->deallocateArrayOf<CfgNode *>(Labels); Func->deallocateArrayOf<CfgNode *>(Labels);
Inst::destroy(Func); Inst::destroy(Func);
...@@ -566,6 +578,9 @@ private: ...@@ -566,6 +578,9 @@ private:
// there is no return value (void-type function), then // there is no return value (void-type function), then
// getSrcSize()==0 and hasRetValue()==false. // getSrcSize()==0 and hasRetValue()==false.
class InstRet : public InstHighLevel { class InstRet : public InstHighLevel {
InstRet(const InstRet &) = delete;
InstRet &operator=(const InstRet &) = delete;
public: public:
static InstRet *create(Cfg *Func, Operand *RetValue = NULL) { static InstRet *create(Cfg *Func, Operand *RetValue = NULL) {
return new (Func->allocateInst<InstRet>()) InstRet(Func, RetValue); return new (Func->allocateInst<InstRet>()) InstRet(Func, RetValue);
...@@ -581,13 +596,14 @@ public: ...@@ -581,13 +596,14 @@ public:
private: private:
InstRet(Cfg *Func, Operand *RetValue); InstRet(Cfg *Func, Operand *RetValue);
InstRet(const InstRet &) = delete;
InstRet &operator=(const InstRet &) = delete;
~InstRet() override {} ~InstRet() override {}
}; };
// Select instruction. The condition, true, and false operands are captured. // Select instruction. The condition, true, and false operands are captured.
class InstSelect : public InstHighLevel { class InstSelect : public InstHighLevel {
InstSelect(const InstSelect &) = delete;
InstSelect &operator=(const InstSelect &) = delete;
public: public:
static InstSelect *create(Cfg *Func, Variable *Dest, Operand *Condition, static InstSelect *create(Cfg *Func, Variable *Dest, Operand *Condition,
Operand *SourceTrue, Operand *SourceFalse) { Operand *SourceTrue, Operand *SourceFalse) {
...@@ -603,14 +619,15 @@ public: ...@@ -603,14 +619,15 @@ public:
private: private:
InstSelect(Cfg *Func, Variable *Dest, Operand *Condition, Operand *Source1, InstSelect(Cfg *Func, Variable *Dest, Operand *Condition, Operand *Source1,
Operand *Source2); Operand *Source2);
InstSelect(const InstSelect &) = delete;
InstSelect &operator=(const InstSelect &) = delete;
~InstSelect() override {} ~InstSelect() override {}
}; };
// Store instruction. The address operand is captured, along with the // Store instruction. The address operand is captured, along with the
// data operand to be stored into the address. // data operand to be stored into the address.
class InstStore : public InstHighLevel { class InstStore : public InstHighLevel {
InstStore(const InstStore &) = delete;
InstStore &operator=(const InstStore &) = delete;
public: public:
static InstStore *create(Cfg *Func, Operand *Data, Operand *Addr, static InstStore *create(Cfg *Func, Operand *Data, Operand *Addr,
uint32_t align = 1) { uint32_t align = 1) {
...@@ -625,14 +642,15 @@ public: ...@@ -625,14 +642,15 @@ public:
private: private:
InstStore(Cfg *Func, Operand *Data, Operand *Addr); InstStore(Cfg *Func, Operand *Data, Operand *Addr);
InstStore(const InstStore &) = delete;
InstStore &operator=(const InstStore &) = delete;
~InstStore() override {} ~InstStore() override {}
}; };
// Switch instruction. The single source operand is captured as // Switch instruction. The single source operand is captured as
// getSrc(0). // getSrc(0).
class InstSwitch : public InstHighLevel { class InstSwitch : public InstHighLevel {
InstSwitch(const InstSwitch &) = delete;
InstSwitch &operator=(const InstSwitch &) = delete;
public: public:
static InstSwitch *create(Cfg *Func, SizeT NumCases, Operand *Source, static InstSwitch *create(Cfg *Func, SizeT NumCases, Operand *Source,
CfgNode *LabelDefault) { CfgNode *LabelDefault) {
...@@ -657,8 +675,6 @@ public: ...@@ -657,8 +675,6 @@ public:
private: private:
InstSwitch(Cfg *Func, SizeT NumCases, Operand *Source, CfgNode *LabelDefault); InstSwitch(Cfg *Func, SizeT NumCases, Operand *Source, CfgNode *LabelDefault);
InstSwitch(const InstSwitch &) = delete;
InstSwitch &operator=(const InstSwitch &) = delete;
void destroy(Cfg *Func) override { void destroy(Cfg *Func) override {
Func->deallocateArrayOf<uint64_t>(Values); Func->deallocateArrayOf<uint64_t>(Values);
Func->deallocateArrayOf<CfgNode *>(Labels); Func->deallocateArrayOf<CfgNode *>(Labels);
...@@ -675,6 +691,9 @@ private: ...@@ -675,6 +691,9 @@ private:
// Unreachable instruction. This is a terminator instruction with no // Unreachable instruction. This is a terminator instruction with no
// operands. // operands.
class InstUnreachable : public InstHighLevel { class InstUnreachable : public InstHighLevel {
InstUnreachable(const InstUnreachable &) = delete;
InstUnreachable &operator=(const InstUnreachable &) = delete;
public: public:
static InstUnreachable *create(Cfg *Func) { static InstUnreachable *create(Cfg *Func) {
return new (Func->allocateInst<InstUnreachable>()) InstUnreachable(Func); return new (Func->allocateInst<InstUnreachable>()) InstUnreachable(Func);
...@@ -687,8 +706,6 @@ public: ...@@ -687,8 +706,6 @@ public:
private: private:
InstUnreachable(Cfg *Func); InstUnreachable(Cfg *Func);
InstUnreachable(const InstUnreachable &) = delete;
InstUnreachable &operator=(const InstUnreachable &) = delete;
~InstUnreachable() override {} ~InstUnreachable() override {}
}; };
...@@ -705,6 +722,9 @@ private: ...@@ -705,6 +722,9 @@ private:
// eliminated if its dest operand is unused, and therefore the FakeDef // eliminated if its dest operand is unused, and therefore the FakeDef
// dest wouldn't be properly initialized. // dest wouldn't be properly initialized.
class InstFakeDef : public InstHighLevel { class InstFakeDef : public InstHighLevel {
InstFakeDef(const InstFakeDef &) = delete;
InstFakeDef &operator=(const InstFakeDef &) = delete;
public: public:
static InstFakeDef *create(Cfg *Func, Variable *Dest, Variable *Src = NULL) { static InstFakeDef *create(Cfg *Func, Variable *Dest, Variable *Src = NULL) {
return new (Func->allocateInst<InstFakeDef>()) InstFakeDef(Func, Dest, Src); return new (Func->allocateInst<InstFakeDef>()) InstFakeDef(Func, Dest, Src);
...@@ -716,8 +736,6 @@ public: ...@@ -716,8 +736,6 @@ public:
private: private:
InstFakeDef(Cfg *Func, Variable *Dest, Variable *Src); InstFakeDef(Cfg *Func, Variable *Dest, Variable *Src);
InstFakeDef(const InstFakeDef &) = delete;
InstFakeDef &operator=(const InstFakeDef &) = delete;
~InstFakeDef() override {} ~InstFakeDef() override {}
}; };
...@@ -727,6 +745,9 @@ private: ...@@ -727,6 +745,9 @@ private:
// situations. The FakeUse instruction has no dest, so it can itself // situations. The FakeUse instruction has no dest, so it can itself
// never be dead-code eliminated. // never be dead-code eliminated.
class InstFakeUse : public InstHighLevel { class InstFakeUse : public InstHighLevel {
InstFakeUse(const InstFakeUse &) = delete;
InstFakeUse &operator=(const InstFakeUse &) = delete;
public: public:
static InstFakeUse *create(Cfg *Func, Variable *Src) { static InstFakeUse *create(Cfg *Func, Variable *Src) {
return new (Func->allocateInst<InstFakeUse>()) InstFakeUse(Func, Src); return new (Func->allocateInst<InstFakeUse>()) InstFakeUse(Func, Src);
...@@ -738,8 +759,6 @@ public: ...@@ -738,8 +759,6 @@ public:
private: private:
InstFakeUse(Cfg *Func, Variable *Src); InstFakeUse(Cfg *Func, Variable *Src);
InstFakeUse(const InstFakeUse &) = delete;
InstFakeUse &operator=(const InstFakeUse &) = delete;
~InstFakeUse() override {} ~InstFakeUse() override {}
}; };
...@@ -753,6 +772,9 @@ private: ...@@ -753,6 +772,9 @@ private:
// that kills the set of variables, so that if that linked instruction // that kills the set of variables, so that if that linked instruction
// gets dead-code eliminated, the FakeKill instruction will as well. // gets dead-code eliminated, the FakeKill instruction will as well.
class InstFakeKill : public InstHighLevel { class InstFakeKill : public InstHighLevel {
InstFakeKill(const InstFakeKill &) = delete;
InstFakeKill &operator=(const InstFakeKill &) = delete;
public: public:
static InstFakeKill *create(Cfg *Func, const VarList &KilledRegs, static InstFakeKill *create(Cfg *Func, const VarList &KilledRegs,
const Inst *Linked) { const Inst *Linked) {
...@@ -767,8 +789,6 @@ public: ...@@ -767,8 +789,6 @@ public:
private: private:
InstFakeKill(Cfg *Func, const VarList &KilledRegs, const Inst *Linked); InstFakeKill(Cfg *Func, const VarList &KilledRegs, const Inst *Linked);
InstFakeKill(const InstFakeKill &) = delete;
InstFakeKill &operator=(const InstFakeKill &) = delete;
~InstFakeKill() override {} ~InstFakeKill() override {}
// This instruction is ignored if Linked->isDeleted() is true. // This instruction is ignored if Linked->isDeleted() is true.
......
...@@ -30,6 +30,9 @@ class TargetX8632; ...@@ -30,6 +30,9 @@ class TargetX8632;
// OperandX8632 extends the Operand hierarchy. Its subclasses are // OperandX8632 extends the Operand hierarchy. Its subclasses are
// OperandX8632Mem and VariableSplit. // OperandX8632Mem and VariableSplit.
class OperandX8632 : public Operand { class OperandX8632 : public Operand {
OperandX8632(const OperandX8632 &) = delete;
OperandX8632 &operator=(const OperandX8632 &) = delete;
public: public:
enum OperandKindX8632 { enum OperandKindX8632 {
k__Start = Operand::kTarget, k__Start = Operand::kTarget,
...@@ -45,16 +48,15 @@ protected: ...@@ -45,16 +48,15 @@ protected:
OperandX8632(OperandKindX8632 Kind, Type Ty) OperandX8632(OperandKindX8632 Kind, Type Ty)
: Operand(static_cast<OperandKind>(Kind), Ty) {} : Operand(static_cast<OperandKind>(Kind), Ty) {}
~OperandX8632() override {} ~OperandX8632() override {}
private:
OperandX8632(const OperandX8632 &) = delete;
OperandX8632 &operator=(const OperandX8632 &) = delete;
}; };
// OperandX8632Mem represents the m32 addressing mode, with optional // OperandX8632Mem represents the m32 addressing mode, with optional
// base and index registers, a constant offset, and a fixed shift // base and index registers, a constant offset, and a fixed shift
// value for the index register. // value for the index register.
class OperandX8632Mem : public OperandX8632 { class OperandX8632Mem : public OperandX8632 {
OperandX8632Mem(const OperandX8632Mem &) = delete;
OperandX8632Mem &operator=(const OperandX8632Mem &) = delete;
public: public:
enum SegmentRegisters { enum SegmentRegisters {
DefaultSegment = -1, DefaultSegment = -1,
...@@ -88,8 +90,6 @@ public: ...@@ -88,8 +90,6 @@ public:
private: private:
OperandX8632Mem(Cfg *Func, Type Ty, Variable *Base, Constant *Offset, OperandX8632Mem(Cfg *Func, Type Ty, Variable *Base, Constant *Offset,
Variable *Index, uint16_t Shift, SegmentRegisters SegmentReg); Variable *Index, uint16_t Shift, SegmentRegisters SegmentReg);
OperandX8632Mem(const OperandX8632Mem &) = delete;
OperandX8632Mem &operator=(const OperandX8632Mem &) = delete;
~OperandX8632Mem() override {} ~OperandX8632Mem() override {}
Variable *Base; Variable *Base;
Constant *Offset; Constant *Offset;
...@@ -105,6 +105,9 @@ private: ...@@ -105,6 +105,9 @@ private:
// lowering forces the f64 to be spilled to the stack and then // lowering forces the f64 to be spilled to the stack and then
// accesses through the VariableSplit. // accesses through the VariableSplit.
class VariableSplit : public OperandX8632 { class VariableSplit : public OperandX8632 {
VariableSplit(const VariableSplit &) = delete;
VariableSplit &operator=(const VariableSplit &) = delete;
public: public:
enum Portion { enum Portion {
Low, Low,
...@@ -132,8 +135,6 @@ private: ...@@ -132,8 +135,6 @@ private:
Vars[0] = Var; Vars[0] = Var;
NumVars = 1; NumVars = 1;
} }
VariableSplit(const VariableSplit &) = delete;
VariableSplit &operator=(const VariableSplit &) = delete;
~VariableSplit() override { Func->deallocateArrayOf<Variable *>(Vars); } ~VariableSplit() override { Func->deallocateArrayOf<Variable *>(Vars); }
Cfg *Func; // Held only for the destructor. Cfg *Func; // Held only for the destructor.
Variable *Var; Variable *Var;
...@@ -146,6 +147,9 @@ private: ...@@ -146,6 +147,9 @@ private:
// register. If the linked Variable has a stack slot, then the // register. If the linked Variable has a stack slot, then the
// Variable and SpillVariable share that slot. // Variable and SpillVariable share that slot.
class SpillVariable : public Variable { class SpillVariable : public Variable {
SpillVariable(const SpillVariable &) = delete;
SpillVariable &operator=(const SpillVariable &) = delete;
public: public:
static SpillVariable *create(Cfg *Func, Type Ty, SizeT Index, static SpillVariable *create(Cfg *Func, Type Ty, SizeT Index,
const IceString &Name) { const IceString &Name) {
...@@ -166,6 +170,9 @@ private: ...@@ -166,6 +170,9 @@ private:
}; };
class InstX8632 : public InstTarget { class InstX8632 : public InstTarget {
InstX8632(const InstX8632 &) = delete;
InstX8632 &operator=(const InstX8632 &) = delete;
public: public:
enum InstKindX8632 { enum InstKindX8632 {
k__Start = Inst::Target, k__Start = Inst::Target,
...@@ -265,10 +272,6 @@ protected: ...@@ -265,10 +272,6 @@ protected:
static bool isClassof(const Inst *Inst, InstKindX8632 MyKind) { static bool isClassof(const Inst *Inst, InstKindX8632 MyKind) {
return Inst->getKind() == static_cast<InstKind>(MyKind); return Inst->getKind() == static_cast<InstKind>(MyKind);
} }
private:
InstX8632(const InstX8632 &) = delete;
InstX8632 &operator=(const InstX8632 &) = delete;
}; };
// InstX8632Label represents an intra-block label that is the // InstX8632Label represents an intra-block label that is the
...@@ -309,6 +312,9 @@ private: ...@@ -309,6 +312,9 @@ private:
// it may be prevented by running dead code elimination before // it may be prevented by running dead code elimination before
// lowering. // lowering.
class InstX8632Label : public InstX8632 { class InstX8632Label : public InstX8632 {
InstX8632Label(const InstX8632Label &) = delete;
InstX8632Label &operator=(const InstX8632Label &) = delete;
public: public:
static InstX8632Label *create(Cfg *Func, TargetX8632 *Target) { static InstX8632Label *create(Cfg *Func, TargetX8632 *Target) {
return new (Func->allocate<InstX8632Label>()) InstX8632Label(Func, Target); return new (Func->allocate<InstX8632Label>()) InstX8632Label(Func, Target);
...@@ -320,14 +326,15 @@ public: ...@@ -320,14 +326,15 @@ public:
private: private:
InstX8632Label(Cfg *Func, TargetX8632 *Target); InstX8632Label(Cfg *Func, TargetX8632 *Target);
InstX8632Label(const InstX8632Label &) = delete;
InstX8632Label &operator=(const InstX8632Label &) = delete;
~InstX8632Label() override {} ~InstX8632Label() override {}
SizeT Number; // used only for unique label string generation SizeT Number; // used only for unique label string generation
}; };
// Conditional and unconditional branch instruction. // Conditional and unconditional branch instruction.
class InstX8632Br : public InstX8632 { class InstX8632Br : public InstX8632 {
InstX8632Br(const InstX8632Br &) = delete;
InstX8632Br &operator=(const InstX8632Br &) = delete;
public: public:
// Create a conditional branch to a node. // Create a conditional branch to a node.
static InstX8632Br *create(Cfg *Func, CfgNode *TargetTrue, static InstX8632Br *create(Cfg *Func, CfgNode *TargetTrue,
...@@ -382,8 +389,6 @@ public: ...@@ -382,8 +389,6 @@ public:
private: private:
InstX8632Br(Cfg *Func, const CfgNode *TargetTrue, const CfgNode *TargetFalse, InstX8632Br(Cfg *Func, const CfgNode *TargetTrue, const CfgNode *TargetFalse,
const InstX8632Label *Label, CondX86::BrCond Condition); const InstX8632Label *Label, CondX86::BrCond Condition);
InstX8632Br(const InstX8632Br &) = delete;
InstX8632Br &operator=(const InstX8632Br &) = delete;
~InstX8632Br() override {} ~InstX8632Br() override {}
CondX86::BrCond Condition; CondX86::BrCond Condition;
const CfgNode *TargetTrue; const CfgNode *TargetTrue;
...@@ -394,6 +399,9 @@ private: ...@@ -394,6 +399,9 @@ private:
// AdjustStack instruction - subtracts esp by the given amount and // AdjustStack instruction - subtracts esp by the given amount and
// updates the stack offset during code emission. // updates the stack offset during code emission.
class InstX8632AdjustStack : public InstX8632 { class InstX8632AdjustStack : public InstX8632 {
InstX8632AdjustStack(const InstX8632AdjustStack &) = delete;
InstX8632AdjustStack &operator=(const InstX8632AdjustStack &) = delete;
public: public:
static InstX8632AdjustStack *create(Cfg *Func, SizeT Amount, Variable *Esp) { static InstX8632AdjustStack *create(Cfg *Func, SizeT Amount, Variable *Esp) {
return new (Func->allocate<InstX8632AdjustStack>()) return new (Func->allocate<InstX8632AdjustStack>())
...@@ -406,13 +414,14 @@ public: ...@@ -406,13 +414,14 @@ public:
private: private:
InstX8632AdjustStack(Cfg *Func, SizeT Amount, Variable *Esp); InstX8632AdjustStack(Cfg *Func, SizeT Amount, Variable *Esp);
InstX8632AdjustStack(const InstX8632AdjustStack &) = delete;
InstX8632AdjustStack &operator=(const InstX8632AdjustStack &) = delete;
SizeT Amount; SizeT Amount;
}; };
// Call instruction. Arguments should have already been pushed. // Call instruction. Arguments should have already been pushed.
class InstX8632Call : public InstX8632 { class InstX8632Call : public InstX8632 {
InstX8632Call(const InstX8632Call &) = delete;
InstX8632Call &operator=(const InstX8632Call &) = delete;
public: public:
static InstX8632Call *create(Cfg *Func, Variable *Dest, Operand *CallTarget) { static InstX8632Call *create(Cfg *Func, Variable *Dest, Operand *CallTarget) {
return new (Func->allocate<InstX8632Call>()) return new (Func->allocate<InstX8632Call>())
...@@ -425,8 +434,6 @@ public: ...@@ -425,8 +434,6 @@ public:
private: private:
InstX8632Call(Cfg *Func, Variable *Dest, Operand *CallTarget); InstX8632Call(Cfg *Func, Variable *Dest, Operand *CallTarget);
InstX8632Call(const InstX8632Call &) = delete;
InstX8632Call &operator=(const InstX8632Call &) = delete;
~InstX8632Call() override {} ~InstX8632Call() override {}
}; };
...@@ -437,6 +444,9 @@ void emitIASOpTyGPR(const Cfg *Func, Type Ty, const Operand *Var, ...@@ -437,6 +444,9 @@ void emitIASOpTyGPR(const Cfg *Func, Type Ty, const Operand *Var,
// Instructions of the form x := op(x). // Instructions of the form x := op(x).
template <InstX8632::InstKindX8632 K> template <InstX8632::InstKindX8632 K>
class InstX8632InplaceopGPR : public InstX8632 { class InstX8632InplaceopGPR : public InstX8632 {
InstX8632InplaceopGPR(const InstX8632InplaceopGPR &) = delete;
InstX8632InplaceopGPR &operator=(const InstX8632InplaceopGPR &) = delete;
public: public:
static InstX8632InplaceopGPR *create(Cfg *Func, Operand *SrcDest) { static InstX8632InplaceopGPR *create(Cfg *Func, Operand *SrcDest) {
return new (Func->allocate<InstX8632InplaceopGPR>()) return new (Func->allocate<InstX8632InplaceopGPR>())
...@@ -468,8 +478,6 @@ private: ...@@ -468,8 +478,6 @@ private:
: InstX8632(Func, K, 1, llvm::dyn_cast<Variable>(SrcDest)) { : InstX8632(Func, K, 1, llvm::dyn_cast<Variable>(SrcDest)) {
addSource(SrcDest); addSource(SrcDest);
} }
InstX8632InplaceopGPR(const InstX8632InplaceopGPR &) = delete;
InstX8632InplaceopGPR &operator=(const InstX8632InplaceopGPR &) = delete;
~InstX8632InplaceopGPR() override {} ~InstX8632InplaceopGPR() override {}
static const char *Opcode; static const char *Opcode;
static const x86::AssemblerX86::GPREmitterOneOp Emitter; static const x86::AssemblerX86::GPREmitterOneOp Emitter;
...@@ -484,6 +492,9 @@ void emitIASRegOpTyGPR(const Cfg *Func, Type Ty, const Variable *Dst, ...@@ -484,6 +492,9 @@ void emitIASRegOpTyGPR(const Cfg *Func, Type Ty, const Variable *Dst,
// Instructions of the form x := op(y) // Instructions of the form x := op(y)
template <InstX8632::InstKindX8632 K> template <InstX8632::InstKindX8632 K>
class InstX8632UnaryopGPR : public InstX8632 { class InstX8632UnaryopGPR : public InstX8632 {
InstX8632UnaryopGPR(const InstX8632UnaryopGPR &) = delete;
InstX8632UnaryopGPR &operator=(const InstX8632UnaryopGPR &) = delete;
public: public:
static InstX8632UnaryopGPR *create(Cfg *Func, Variable *Dest, Operand *Src) { static InstX8632UnaryopGPR *create(Cfg *Func, Variable *Dest, Operand *Src) {
return new (Func->allocate<InstX8632UnaryopGPR>()) return new (Func->allocate<InstX8632UnaryopGPR>())
...@@ -518,8 +529,6 @@ private: ...@@ -518,8 +529,6 @@ private:
: InstX8632(Func, K, 1, Dest) { : InstX8632(Func, K, 1, Dest) {
addSource(Src); addSource(Src);
} }
InstX8632UnaryopGPR(const InstX8632UnaryopGPR &) = delete;
InstX8632UnaryopGPR &operator=(const InstX8632UnaryopGPR &) = delete;
~InstX8632UnaryopGPR() override {} ~InstX8632UnaryopGPR() override {}
static const char *Opcode; static const char *Opcode;
static const x86::AssemblerX86::GPREmitterRegOp Emitter; static const x86::AssemblerX86::GPREmitterRegOp Emitter;
...@@ -531,6 +540,9 @@ void emitIASRegOpTyXMM(const Cfg *Func, Type Ty, const Variable *Var, ...@@ -531,6 +540,9 @@ void emitIASRegOpTyXMM(const Cfg *Func, Type Ty, const Variable *Var,
template <InstX8632::InstKindX8632 K> template <InstX8632::InstKindX8632 K>
class InstX8632UnaryopXmm : public InstX8632 { class InstX8632UnaryopXmm : public InstX8632 {
InstX8632UnaryopXmm(const InstX8632UnaryopXmm &) = delete;
InstX8632UnaryopXmm &operator=(const InstX8632UnaryopXmm &) = delete;
public: public:
static InstX8632UnaryopXmm *create(Cfg *Func, Variable *Dest, Operand *Src) { static InstX8632UnaryopXmm *create(Cfg *Func, Variable *Dest, Operand *Src) {
return new (Func->allocate<InstX8632UnaryopXmm>()) return new (Func->allocate<InstX8632UnaryopXmm>())
...@@ -563,8 +575,6 @@ private: ...@@ -563,8 +575,6 @@ private:
: InstX8632(Func, K, 1, Dest) { : InstX8632(Func, K, 1, Dest) {
addSource(Src); addSource(Src);
} }
InstX8632UnaryopXmm(const InstX8632UnaryopXmm &) = delete;
InstX8632UnaryopXmm &operator=(const InstX8632UnaryopXmm &) = delete;
~InstX8632UnaryopXmm() override {} ~InstX8632UnaryopXmm() override {}
static const char *Opcode; static const char *Opcode;
static const x86::AssemblerX86::XmmEmitterRegOp Emitter; static const x86::AssemblerX86::XmmEmitterRegOp Emitter;
...@@ -581,6 +591,9 @@ void emitIASGPRShift(const Cfg *Func, Type Ty, const Variable *Var, ...@@ -581,6 +591,9 @@ void emitIASGPRShift(const Cfg *Func, Type Ty, const Variable *Var,
template <InstX8632::InstKindX8632 K> template <InstX8632::InstKindX8632 K>
class InstX8632BinopGPRShift : public InstX8632 { class InstX8632BinopGPRShift : public InstX8632 {
InstX8632BinopGPRShift(const InstX8632BinopGPRShift &) = delete;
InstX8632BinopGPRShift &operator=(const InstX8632BinopGPRShift &) = delete;
public: public:
// Create a binary-op GPR shift instruction. // Create a binary-op GPR shift instruction.
static InstX8632BinopGPRShift *create(Cfg *Func, Variable *Dest, static InstX8632BinopGPRShift *create(Cfg *Func, Variable *Dest,
...@@ -611,8 +624,6 @@ private: ...@@ -611,8 +624,6 @@ private:
addSource(Dest); addSource(Dest);
addSource(Source); addSource(Source);
} }
InstX8632BinopGPRShift(const InstX8632BinopGPRShift &) = delete;
InstX8632BinopGPRShift &operator=(const InstX8632BinopGPRShift &) = delete;
~InstX8632BinopGPRShift() override {} ~InstX8632BinopGPRShift() override {}
static const char *Opcode; static const char *Opcode;
static const x86::AssemblerX86::GPREmitterShiftOp Emitter; static const x86::AssemblerX86::GPREmitterShiftOp Emitter;
...@@ -620,6 +631,9 @@ private: ...@@ -620,6 +631,9 @@ private:
template <InstX8632::InstKindX8632 K> template <InstX8632::InstKindX8632 K>
class InstX8632BinopGPR : public InstX8632 { class InstX8632BinopGPR : public InstX8632 {
InstX8632BinopGPR(const InstX8632BinopGPR &) = delete;
InstX8632BinopGPR &operator=(const InstX8632BinopGPR &) = delete;
public: public:
// Create an ordinary binary-op instruction like add or sub. // Create an ordinary binary-op instruction like add or sub.
static InstX8632BinopGPR *create(Cfg *Func, Variable *Dest, Operand *Source) { static InstX8632BinopGPR *create(Cfg *Func, Variable *Dest, Operand *Source) {
...@@ -649,8 +663,6 @@ private: ...@@ -649,8 +663,6 @@ private:
addSource(Dest); addSource(Dest);
addSource(Source); addSource(Source);
} }
InstX8632BinopGPR(const InstX8632BinopGPR &) = delete;
InstX8632BinopGPR &operator=(const InstX8632BinopGPR &) = delete;
~InstX8632BinopGPR() override {} ~InstX8632BinopGPR() override {}
static const char *Opcode; static const char *Opcode;
static const x86::AssemblerX86::GPREmitterRegOp Emitter; static const x86::AssemblerX86::GPREmitterRegOp Emitter;
...@@ -658,6 +670,9 @@ private: ...@@ -658,6 +670,9 @@ private:
template <InstX8632::InstKindX8632 K, bool NeedsElementType> template <InstX8632::InstKindX8632 K, bool NeedsElementType>
class InstX8632BinopXmm : public InstX8632 { class InstX8632BinopXmm : public InstX8632 {
InstX8632BinopXmm(const InstX8632BinopXmm &) = delete;
InstX8632BinopXmm &operator=(const InstX8632BinopXmm &) = delete;
public: public:
// Create an XMM binary-op instruction like addss or addps. // Create an XMM binary-op instruction like addss or addps.
static InstX8632BinopXmm *create(Cfg *Func, Variable *Dest, Operand *Source) { static InstX8632BinopXmm *create(Cfg *Func, Variable *Dest, Operand *Source) {
...@@ -689,8 +704,6 @@ private: ...@@ -689,8 +704,6 @@ private:
addSource(Dest); addSource(Dest);
addSource(Source); addSource(Source);
} }
InstX8632BinopXmm(const InstX8632BinopXmm &) = delete;
InstX8632BinopXmm &operator=(const InstX8632BinopXmm &) = delete;
~InstX8632BinopXmm() override {} ~InstX8632BinopXmm() override {}
static const char *Opcode; static const char *Opcode;
static const x86::AssemblerX86::XmmEmitterRegOp Emitter; static const x86::AssemblerX86::XmmEmitterRegOp Emitter;
...@@ -702,6 +715,9 @@ void emitIASXmmShift(const Cfg *Func, Type Ty, const Variable *Var, ...@@ -702,6 +715,9 @@ void emitIASXmmShift(const Cfg *Func, Type Ty, const Variable *Var,
template <InstX8632::InstKindX8632 K> template <InstX8632::InstKindX8632 K>
class InstX8632BinopXmmShift : public InstX8632 { class InstX8632BinopXmmShift : public InstX8632 {
InstX8632BinopXmmShift(const InstX8632BinopXmmShift &) = delete;
InstX8632BinopXmmShift &operator=(const InstX8632BinopXmmShift &) = delete;
public: public:
// Create an XMM binary-op shift operation. // Create an XMM binary-op shift operation.
static InstX8632BinopXmmShift *create(Cfg *Func, Variable *Dest, static InstX8632BinopXmmShift *create(Cfg *Func, Variable *Dest,
...@@ -735,14 +751,15 @@ private: ...@@ -735,14 +751,15 @@ private:
addSource(Dest); addSource(Dest);
addSource(Source); addSource(Source);
} }
InstX8632BinopXmmShift(const InstX8632BinopXmmShift &) = delete;
InstX8632BinopXmmShift &operator=(const InstX8632BinopXmmShift &) = delete;
~InstX8632BinopXmmShift() override {} ~InstX8632BinopXmmShift() override {}
static const char *Opcode; static const char *Opcode;
static const x86::AssemblerX86::XmmEmitterShiftOp Emitter; static const x86::AssemblerX86::XmmEmitterShiftOp Emitter;
}; };
template <InstX8632::InstKindX8632 K> class InstX8632Ternop : public InstX8632 { template <InstX8632::InstKindX8632 K> class InstX8632Ternop : public InstX8632 {
InstX8632Ternop(const InstX8632Ternop &) = delete;
InstX8632Ternop &operator=(const InstX8632Ternop &) = delete;
public: public:
// Create a ternary-op instruction like div or idiv. // Create a ternary-op instruction like div or idiv.
static InstX8632Ternop *create(Cfg *Func, Variable *Dest, Operand *Source1, static InstX8632Ternop *create(Cfg *Func, Variable *Dest, Operand *Source1,
...@@ -777,8 +794,6 @@ private: ...@@ -777,8 +794,6 @@ private:
addSource(Source1); addSource(Source1);
addSource(Source2); addSource(Source2);
} }
InstX8632Ternop(const InstX8632Ternop &) = delete;
InstX8632Ternop &operator=(const InstX8632Ternop &) = delete;
~InstX8632Ternop() override {} ~InstX8632Ternop() override {}
static const char *Opcode; static const char *Opcode;
}; };
...@@ -786,6 +801,9 @@ private: ...@@ -786,6 +801,9 @@ private:
// Instructions of the form x := y op z // Instructions of the form x := y op z
template <InstX8632::InstKindX8632 K> template <InstX8632::InstKindX8632 K>
class InstX8632ThreeAddressop : public InstX8632 { class InstX8632ThreeAddressop : public InstX8632 {
InstX8632ThreeAddressop(const InstX8632ThreeAddressop &) = delete;
InstX8632ThreeAddressop &operator=(const InstX8632ThreeAddressop &) = delete;
public: public:
static InstX8632ThreeAddressop *create(Cfg *Func, Variable *Dest, static InstX8632ThreeAddressop *create(Cfg *Func, Variable *Dest,
Operand *Source0, Operand *Source1) { Operand *Source0, Operand *Source1) {
...@@ -819,8 +837,6 @@ private: ...@@ -819,8 +837,6 @@ private:
addSource(Source0); addSource(Source0);
addSource(Source1); addSource(Source1);
} }
InstX8632ThreeAddressop(const InstX8632ThreeAddressop &) = delete;
InstX8632ThreeAddressop &operator=(const InstX8632ThreeAddressop &) = delete;
~InstX8632ThreeAddressop() override {} ~InstX8632ThreeAddressop() override {}
static const char *Opcode; static const char *Opcode;
}; };
...@@ -830,6 +846,9 @@ bool checkForRedundantAssign(const Variable *Dest, const Operand *Source); ...@@ -830,6 +846,9 @@ bool checkForRedundantAssign(const Variable *Dest, const Operand *Source);
// Base class for assignment instructions // Base class for assignment instructions
template <InstX8632::InstKindX8632 K> template <InstX8632::InstKindX8632 K>
class InstX8632Movlike : public InstX8632 { class InstX8632Movlike : public InstX8632 {
InstX8632Movlike(const InstX8632Movlike &) = delete;
InstX8632Movlike &operator=(const InstX8632Movlike &) = delete;
public: public:
static InstX8632Movlike *create(Cfg *Func, Variable *Dest, Operand *Source) { static InstX8632Movlike *create(Cfg *Func, Variable *Dest, Operand *Source) {
return new (Func->allocate<InstX8632Movlike>()) return new (Func->allocate<InstX8632Movlike>())
...@@ -855,8 +874,6 @@ private: ...@@ -855,8 +874,6 @@ private:
: InstX8632(Func, K, 1, Dest) { : InstX8632(Func, K, 1, Dest) {
addSource(Source); addSource(Source);
} }
InstX8632Movlike(const InstX8632Movlike &) = delete;
InstX8632Movlike &operator=(const InstX8632Movlike &) = delete;
~InstX8632Movlike() override {} ~InstX8632Movlike() override {}
static const char *Opcode; static const char *Opcode;
...@@ -930,6 +947,9 @@ typedef InstX8632ThreeAddressop<InstX8632::Pshufd> InstX8632Pshufd; ...@@ -930,6 +947,9 @@ typedef InstX8632ThreeAddressop<InstX8632::Pshufd> InstX8632Pshufd;
// Base class for a lockable x86-32 instruction (emits a locked prefix). // Base class for a lockable x86-32 instruction (emits a locked prefix).
class InstX8632Lockable : public InstX8632 { class InstX8632Lockable : public InstX8632 {
InstX8632Lockable(const InstX8632Lockable &) = delete;
InstX8632Lockable &operator=(const InstX8632Lockable &) = delete;
protected: protected:
bool Locked; bool Locked;
...@@ -941,14 +961,13 @@ protected: ...@@ -941,14 +961,13 @@ protected:
HasSideEffects = Locked; HasSideEffects = Locked;
} }
~InstX8632Lockable() override {} ~InstX8632Lockable() override {}
private:
InstX8632Lockable(const InstX8632Lockable &) = delete;
InstX8632Lockable &operator=(const InstX8632Lockable &) = delete;
}; };
// Mul instruction - unsigned multiply. // Mul instruction - unsigned multiply.
class InstX8632Mul : public InstX8632 { class InstX8632Mul : public InstX8632 {
InstX8632Mul(const InstX8632Mul &) = delete;
InstX8632Mul &operator=(const InstX8632Mul &) = delete;
public: public:
static InstX8632Mul *create(Cfg *Func, Variable *Dest, Variable *Source1, static InstX8632Mul *create(Cfg *Func, Variable *Dest, Variable *Source1,
Operand *Source2) { Operand *Source2) {
...@@ -962,14 +981,15 @@ public: ...@@ -962,14 +981,15 @@ public:
private: private:
InstX8632Mul(Cfg *Func, Variable *Dest, Variable *Source1, Operand *Source2); InstX8632Mul(Cfg *Func, Variable *Dest, Variable *Source1, Operand *Source2);
InstX8632Mul(const InstX8632Mul &) = delete;
InstX8632Mul &operator=(const InstX8632Mul &) = delete;
~InstX8632Mul() override {} ~InstX8632Mul() override {}
}; };
// Shld instruction - shift across a pair of operands. TODO: Verify // Shld instruction - shift across a pair of operands. TODO: Verify
// that the validator accepts the shld instruction. // that the validator accepts the shld instruction.
class InstX8632Shld : public InstX8632 { class InstX8632Shld : public InstX8632 {
InstX8632Shld(const InstX8632Shld &) = delete;
InstX8632Shld &operator=(const InstX8632Shld &) = delete;
public: public:
static InstX8632Shld *create(Cfg *Func, Variable *Dest, Variable *Source1, static InstX8632Shld *create(Cfg *Func, Variable *Dest, Variable *Source1,
Variable *Source2) { Variable *Source2) {
...@@ -984,14 +1004,15 @@ public: ...@@ -984,14 +1004,15 @@ public:
private: private:
InstX8632Shld(Cfg *Func, Variable *Dest, Variable *Source1, InstX8632Shld(Cfg *Func, Variable *Dest, Variable *Source1,
Variable *Source2); Variable *Source2);
InstX8632Shld(const InstX8632Shld &) = delete;
InstX8632Shld &operator=(const InstX8632Shld &) = delete;
~InstX8632Shld() override {} ~InstX8632Shld() override {}
}; };
// Shrd instruction - shift across a pair of operands. TODO: Verify // Shrd instruction - shift across a pair of operands. TODO: Verify
// that the validator accepts the shrd instruction. // that the validator accepts the shrd instruction.
class InstX8632Shrd : public InstX8632 { class InstX8632Shrd : public InstX8632 {
InstX8632Shrd(const InstX8632Shrd &) = delete;
InstX8632Shrd &operator=(const InstX8632Shrd &) = delete;
public: public:
static InstX8632Shrd *create(Cfg *Func, Variable *Dest, Variable *Source1, static InstX8632Shrd *create(Cfg *Func, Variable *Dest, Variable *Source1,
Variable *Source2) { Variable *Source2) {
...@@ -1006,13 +1027,14 @@ public: ...@@ -1006,13 +1027,14 @@ public:
private: private:
InstX8632Shrd(Cfg *Func, Variable *Dest, Variable *Source1, InstX8632Shrd(Cfg *Func, Variable *Dest, Variable *Source1,
Variable *Source2); Variable *Source2);
InstX8632Shrd(const InstX8632Shrd &) = delete;
InstX8632Shrd &operator=(const InstX8632Shrd &) = delete;
~InstX8632Shrd() override {} ~InstX8632Shrd() override {}
}; };
// Conditional move instruction. // Conditional move instruction.
class InstX8632Cmov : public InstX8632 { class InstX8632Cmov : public InstX8632 {
InstX8632Cmov(const InstX8632Cmov &) = delete;
InstX8632Cmov &operator=(const InstX8632Cmov &) = delete;
public: public:
static InstX8632Cmov *create(Cfg *Func, Variable *Dest, Operand *Source, static InstX8632Cmov *create(Cfg *Func, Variable *Dest, Operand *Source,
CondX86::BrCond Cond) { CondX86::BrCond Cond) {
...@@ -1027,8 +1049,6 @@ public: ...@@ -1027,8 +1049,6 @@ public:
private: private:
InstX8632Cmov(Cfg *Func, Variable *Dest, Operand *Source, InstX8632Cmov(Cfg *Func, Variable *Dest, Operand *Source,
CondX86::BrCond Cond); CondX86::BrCond Cond);
InstX8632Cmov(const InstX8632Cmov &) = delete;
InstX8632Cmov &operator=(const InstX8632Cmov &) = delete;
~InstX8632Cmov() override {} ~InstX8632Cmov() override {}
CondX86::BrCond Condition; CondX86::BrCond Condition;
...@@ -1037,6 +1057,9 @@ private: ...@@ -1037,6 +1057,9 @@ private:
// Cmpps instruction - compare packed singled-precision floating point // Cmpps instruction - compare packed singled-precision floating point
// values // values
class InstX8632Cmpps : public InstX8632 { class InstX8632Cmpps : public InstX8632 {
InstX8632Cmpps(const InstX8632Cmpps &) = delete;
InstX8632Cmpps &operator=(const InstX8632Cmpps &) = delete;
public: public:
static InstX8632Cmpps *create(Cfg *Func, Variable *Dest, Operand *Source, static InstX8632Cmpps *create(Cfg *Func, Variable *Dest, Operand *Source,
CondX86::CmppsCond Condition) { CondX86::CmppsCond Condition) {
...@@ -1051,8 +1074,6 @@ public: ...@@ -1051,8 +1074,6 @@ public:
private: private:
InstX8632Cmpps(Cfg *Func, Variable *Dest, Operand *Source, InstX8632Cmpps(Cfg *Func, Variable *Dest, Operand *Source,
CondX86::CmppsCond Cond); CondX86::CmppsCond Cond);
InstX8632Cmpps(const InstX8632Cmpps &) = delete;
InstX8632Cmpps &operator=(const InstX8632Cmpps &) = delete;
~InstX8632Cmpps() override {} ~InstX8632Cmpps() override {}
CondX86::CmppsCond Condition; CondX86::CmppsCond Condition;
...@@ -1064,6 +1085,9 @@ private: ...@@ -1064,6 +1085,9 @@ private:
// <dest> can be a register or memory, while <desired> must be a register. // <dest> can be a register or memory, while <desired> must be a register.
// It is the user's responsiblity to mark eax with a FakeDef. // It is the user's responsiblity to mark eax with a FakeDef.
class InstX8632Cmpxchg : public InstX8632Lockable { class InstX8632Cmpxchg : public InstX8632Lockable {
InstX8632Cmpxchg(const InstX8632Cmpxchg &) = delete;
InstX8632Cmpxchg &operator=(const InstX8632Cmpxchg &) = delete;
public: public:
static InstX8632Cmpxchg *create(Cfg *Func, Operand *DestOrAddr, Variable *Eax, static InstX8632Cmpxchg *create(Cfg *Func, Operand *DestOrAddr, Variable *Eax,
Variable *Desired, bool Locked) { Variable *Desired, bool Locked) {
...@@ -1078,8 +1102,6 @@ public: ...@@ -1078,8 +1102,6 @@ public:
private: private:
InstX8632Cmpxchg(Cfg *Func, Operand *DestOrAddr, Variable *Eax, InstX8632Cmpxchg(Cfg *Func, Operand *DestOrAddr, Variable *Eax,
Variable *Desired, bool Locked); Variable *Desired, bool Locked);
InstX8632Cmpxchg(const InstX8632Cmpxchg &) = delete;
InstX8632Cmpxchg &operator=(const InstX8632Cmpxchg &) = delete;
~InstX8632Cmpxchg() override {} ~InstX8632Cmpxchg() override {}
}; };
...@@ -1090,6 +1112,9 @@ private: ...@@ -1090,6 +1112,9 @@ private:
// and eax as modified. // and eax as modified.
// <m64> must be a memory operand. // <m64> must be a memory operand.
class InstX8632Cmpxchg8b : public InstX8632Lockable { class InstX8632Cmpxchg8b : public InstX8632Lockable {
InstX8632Cmpxchg8b(const InstX8632Cmpxchg8b &) = delete;
InstX8632Cmpxchg8b &operator=(const InstX8632Cmpxchg8b &) = delete;
public: public:
static InstX8632Cmpxchg8b *create(Cfg *Func, OperandX8632Mem *Dest, static InstX8632Cmpxchg8b *create(Cfg *Func, OperandX8632Mem *Dest,
Variable *Edx, Variable *Eax, Variable *Ecx, Variable *Edx, Variable *Eax, Variable *Ecx,
...@@ -1105,8 +1130,6 @@ public: ...@@ -1105,8 +1130,6 @@ public:
private: private:
InstX8632Cmpxchg8b(Cfg *Func, OperandX8632Mem *Dest, Variable *Edx, InstX8632Cmpxchg8b(Cfg *Func, OperandX8632Mem *Dest, Variable *Edx,
Variable *Eax, Variable *Ecx, Variable *Ebx, bool Locked); Variable *Eax, Variable *Ecx, Variable *Ebx, bool Locked);
InstX8632Cmpxchg8b(const InstX8632Cmpxchg8b &) = delete;
InstX8632Cmpxchg8b &operator=(const InstX8632Cmpxchg8b &) = delete;
~InstX8632Cmpxchg8b() override {} ~InstX8632Cmpxchg8b() override {}
}; };
...@@ -1115,6 +1138,9 @@ private: ...@@ -1115,6 +1138,9 @@ private:
// from dest/src types. Sign and zero extension on the integer // from dest/src types. Sign and zero extension on the integer
// operand needs to be done separately. // operand needs to be done separately.
class InstX8632Cvt : public InstX8632 { class InstX8632Cvt : public InstX8632 {
InstX8632Cvt(const InstX8632Cvt &) = delete;
InstX8632Cvt &operator=(const InstX8632Cvt &) = delete;
public: public:
enum CvtVariant { Si2ss, Tss2si, Float2float, Dq2ps, Tps2dq }; enum CvtVariant { Si2ss, Tss2si, Float2float, Dq2ps, Tps2dq };
static InstX8632Cvt *create(Cfg *Func, Variable *Dest, Operand *Source, static InstX8632Cvt *create(Cfg *Func, Variable *Dest, Operand *Source,
...@@ -1131,13 +1157,14 @@ public: ...@@ -1131,13 +1157,14 @@ public:
private: private:
CvtVariant Variant; CvtVariant Variant;
InstX8632Cvt(Cfg *Func, Variable *Dest, Operand *Source, CvtVariant Variant); InstX8632Cvt(Cfg *Func, Variable *Dest, Operand *Source, CvtVariant Variant);
InstX8632Cvt(const InstX8632Cvt &) = delete;
InstX8632Cvt &operator=(const InstX8632Cvt &) = delete;
~InstX8632Cvt() override {} ~InstX8632Cvt() override {}
}; };
// cmp - Integer compare instruction. // cmp - Integer compare instruction.
class InstX8632Icmp : public InstX8632 { class InstX8632Icmp : public InstX8632 {
InstX8632Icmp(const InstX8632Icmp &) = delete;
InstX8632Icmp &operator=(const InstX8632Icmp &) = delete;
public: public:
static InstX8632Icmp *create(Cfg *Func, Operand *Src1, Operand *Src2) { static InstX8632Icmp *create(Cfg *Func, Operand *Src1, Operand *Src2) {
return new (Func->allocate<InstX8632Icmp>()) return new (Func->allocate<InstX8632Icmp>())
...@@ -1150,13 +1177,14 @@ public: ...@@ -1150,13 +1177,14 @@ public:
private: private:
InstX8632Icmp(Cfg *Func, Operand *Src1, Operand *Src2); InstX8632Icmp(Cfg *Func, Operand *Src1, Operand *Src2);
InstX8632Icmp(const InstX8632Icmp &) = delete;
InstX8632Icmp &operator=(const InstX8632Icmp &) = delete;
~InstX8632Icmp() override {} ~InstX8632Icmp() override {}
}; };
// ucomiss/ucomisd - floating-point compare instruction. // ucomiss/ucomisd - floating-point compare instruction.
class InstX8632Ucomiss : public InstX8632 { class InstX8632Ucomiss : public InstX8632 {
InstX8632Ucomiss(const InstX8632Ucomiss &) = delete;
InstX8632Ucomiss &operator=(const InstX8632Ucomiss &) = delete;
public: public:
static InstX8632Ucomiss *create(Cfg *Func, Operand *Src1, Operand *Src2) { static InstX8632Ucomiss *create(Cfg *Func, Operand *Src1, Operand *Src2) {
return new (Func->allocate<InstX8632Ucomiss>()) return new (Func->allocate<InstX8632Ucomiss>())
...@@ -1169,13 +1197,14 @@ public: ...@@ -1169,13 +1197,14 @@ public:
private: private:
InstX8632Ucomiss(Cfg *Func, Operand *Src1, Operand *Src2); InstX8632Ucomiss(Cfg *Func, Operand *Src1, Operand *Src2);
InstX8632Ucomiss(const InstX8632Ucomiss &) = delete;
InstX8632Ucomiss &operator=(const InstX8632Ucomiss &) = delete;
~InstX8632Ucomiss() override {} ~InstX8632Ucomiss() override {}
}; };
// UD2 instruction. // UD2 instruction.
class InstX8632UD2 : public InstX8632 { class InstX8632UD2 : public InstX8632 {
InstX8632UD2(const InstX8632UD2 &) = delete;
InstX8632UD2 &operator=(const InstX8632UD2 &) = delete;
public: public:
static InstX8632UD2 *create(Cfg *Func) { static InstX8632UD2 *create(Cfg *Func) {
return new (Func->allocate<InstX8632UD2>()) InstX8632UD2(Func); return new (Func->allocate<InstX8632UD2>()) InstX8632UD2(Func);
...@@ -1187,13 +1216,14 @@ public: ...@@ -1187,13 +1216,14 @@ public:
private: private:
InstX8632UD2(Cfg *Func); InstX8632UD2(Cfg *Func);
InstX8632UD2(const InstX8632UD2 &) = delete;
InstX8632UD2 &operator=(const InstX8632UD2 &) = delete;
~InstX8632UD2() override {} ~InstX8632UD2() override {}
}; };
// Test instruction. // Test instruction.
class InstX8632Test : public InstX8632 { class InstX8632Test : public InstX8632 {
InstX8632Test(const InstX8632Test &) = delete;
InstX8632Test &operator=(const InstX8632Test &) = delete;
public: public:
static InstX8632Test *create(Cfg *Func, Operand *Source1, Operand *Source2) { static InstX8632Test *create(Cfg *Func, Operand *Source1, Operand *Source2) {
return new (Func->allocate<InstX8632Test>()) return new (Func->allocate<InstX8632Test>())
...@@ -1206,13 +1236,14 @@ public: ...@@ -1206,13 +1236,14 @@ public:
private: private:
InstX8632Test(Cfg *Func, Operand *Source1, Operand *Source2); InstX8632Test(Cfg *Func, Operand *Source1, Operand *Source2);
InstX8632Test(const InstX8632Test &) = delete;
InstX8632Test &operator=(const InstX8632Test &) = delete;
~InstX8632Test() override {} ~InstX8632Test() override {}
}; };
// Mfence instruction. // Mfence instruction.
class InstX8632Mfence : public InstX8632 { class InstX8632Mfence : public InstX8632 {
InstX8632Mfence(const InstX8632Mfence &) = delete;
InstX8632Mfence &operator=(const InstX8632Mfence &) = delete;
public: public:
static InstX8632Mfence *create(Cfg *Func) { static InstX8632Mfence *create(Cfg *Func) {
return new (Func->allocate<InstX8632Mfence>()) InstX8632Mfence(Func); return new (Func->allocate<InstX8632Mfence>()) InstX8632Mfence(Func);
...@@ -1224,8 +1255,6 @@ public: ...@@ -1224,8 +1255,6 @@ public:
private: private:
InstX8632Mfence(Cfg *Func); InstX8632Mfence(Cfg *Func);
InstX8632Mfence(const InstX8632Mfence &) = delete;
InstX8632Mfence &operator=(const InstX8632Mfence &) = delete;
~InstX8632Mfence() override {} ~InstX8632Mfence() override {}
}; };
...@@ -1233,6 +1262,9 @@ private: ...@@ -1233,6 +1262,9 @@ private:
// operand instead of Variable as the destination. It's important // operand instead of Variable as the destination. It's important
// for liveness that there is no Dest operand. // for liveness that there is no Dest operand.
class InstX8632Store : public InstX8632 { class InstX8632Store : public InstX8632 {
InstX8632Store(const InstX8632Store &) = delete;
InstX8632Store &operator=(const InstX8632Store &) = delete;
public: public:
static InstX8632Store *create(Cfg *Func, Operand *Value, OperandX8632 *Mem) { static InstX8632Store *create(Cfg *Func, Operand *Value, OperandX8632 *Mem) {
return new (Func->allocate<InstX8632Store>()) return new (Func->allocate<InstX8632Store>())
...@@ -1244,8 +1276,6 @@ public: ...@@ -1244,8 +1276,6 @@ public:
private: private:
InstX8632Store(Cfg *Func, Operand *Value, OperandX8632 *Mem); InstX8632Store(Cfg *Func, Operand *Value, OperandX8632 *Mem);
InstX8632Store(const InstX8632Store &) = delete;
InstX8632Store &operator=(const InstX8632Store &) = delete;
~InstX8632Store() override {} ~InstX8632Store() override {}
}; };
...@@ -1254,6 +1284,9 @@ private: ...@@ -1254,6 +1284,9 @@ private:
// for liveness that there is no Dest operand. The source must be an // for liveness that there is no Dest operand. The source must be an
// Xmm register, since Dest is mem. // Xmm register, since Dest is mem.
class InstX8632StoreP : public InstX8632 { class InstX8632StoreP : public InstX8632 {
InstX8632StoreP(const InstX8632StoreP &) = delete;
InstX8632StoreP &operator=(const InstX8632StoreP &) = delete;
public: public:
static InstX8632StoreP *create(Cfg *Func, Variable *Value, static InstX8632StoreP *create(Cfg *Func, Variable *Value,
OperandX8632Mem *Mem) { OperandX8632Mem *Mem) {
...@@ -1267,12 +1300,13 @@ public: ...@@ -1267,12 +1300,13 @@ public:
private: private:
InstX8632StoreP(Cfg *Func, Variable *Value, OperandX8632Mem *Mem); InstX8632StoreP(Cfg *Func, Variable *Value, OperandX8632Mem *Mem);
InstX8632StoreP(const InstX8632StoreP &) = delete;
InstX8632StoreP &operator=(const InstX8632StoreP &) = delete;
~InstX8632StoreP() override {} ~InstX8632StoreP() override {}
}; };
class InstX8632StoreQ : public InstX8632 { class InstX8632StoreQ : public InstX8632 {
InstX8632StoreQ(const InstX8632StoreQ &) = delete;
InstX8632StoreQ &operator=(const InstX8632StoreQ &) = delete;
public: public:
static InstX8632StoreQ *create(Cfg *Func, Variable *Value, static InstX8632StoreQ *create(Cfg *Func, Variable *Value,
OperandX8632Mem *Mem) { OperandX8632Mem *Mem) {
...@@ -1286,14 +1320,15 @@ public: ...@@ -1286,14 +1320,15 @@ public:
private: private:
InstX8632StoreQ(Cfg *Func, Variable *Value, OperandX8632Mem *Mem); InstX8632StoreQ(Cfg *Func, Variable *Value, OperandX8632Mem *Mem);
InstX8632StoreQ(const InstX8632StoreQ &) = delete;
InstX8632StoreQ &operator=(const InstX8632StoreQ &) = delete;
~InstX8632StoreQ() override {} ~InstX8632StoreQ() override {}
}; };
// Movsx - copy from a narrower integer type to a wider integer // Movsx - copy from a narrower integer type to a wider integer
// type, with sign extension. // type, with sign extension.
class InstX8632Movsx : public InstX8632 { class InstX8632Movsx : public InstX8632 {
InstX8632Movsx(const InstX8632Movsx &) = delete;
InstX8632Movsx &operator=(const InstX8632Movsx &) = delete;
public: public:
static InstX8632Movsx *create(Cfg *Func, Variable *Dest, Operand *Source) { static InstX8632Movsx *create(Cfg *Func, Variable *Dest, Operand *Source) {
return new (Func->allocate<InstX8632Movsx>()) return new (Func->allocate<InstX8632Movsx>())
...@@ -1305,14 +1340,15 @@ public: ...@@ -1305,14 +1340,15 @@ public:
private: private:
InstX8632Movsx(Cfg *Func, Variable *Dest, Operand *Source); InstX8632Movsx(Cfg *Func, Variable *Dest, Operand *Source);
InstX8632Movsx(const InstX8632Movsx &) = delete;
InstX8632Movsx &operator=(const InstX8632Movsx &) = delete;
~InstX8632Movsx() override {} ~InstX8632Movsx() override {}
}; };
// Movzx - copy from a narrower integer type to a wider integer // Movzx - copy from a narrower integer type to a wider integer
// type, with zero extension. // type, with zero extension.
class InstX8632Movzx : public InstX8632 { class InstX8632Movzx : public InstX8632 {
InstX8632Movzx(const InstX8632Movzx &) = delete;
InstX8632Movzx &operator=(const InstX8632Movzx &) = delete;
public: public:
static InstX8632Movzx *create(Cfg *Func, Variable *Dest, Operand *Source) { static InstX8632Movzx *create(Cfg *Func, Variable *Dest, Operand *Source) {
return new (Func->allocate<InstX8632Movzx>()) return new (Func->allocate<InstX8632Movzx>())
...@@ -1324,13 +1360,14 @@ public: ...@@ -1324,13 +1360,14 @@ public:
private: private:
InstX8632Movzx(Cfg *Func, Variable *Dest, Operand *Source); InstX8632Movzx(Cfg *Func, Variable *Dest, Operand *Source);
InstX8632Movzx(const InstX8632Movzx &) = delete;
InstX8632Movzx &operator=(const InstX8632Movzx &) = delete;
~InstX8632Movzx() override {} ~InstX8632Movzx() override {}
}; };
// Nop instructions of varying length // Nop instructions of varying length
class InstX8632Nop : public InstX8632 { class InstX8632Nop : public InstX8632 {
InstX8632Nop(const InstX8632Nop &) = delete;
InstX8632Nop &operator=(const InstX8632Nop &) = delete;
public: public:
// TODO: Replace with enum. // TODO: Replace with enum.
typedef unsigned NopVariant; typedef unsigned NopVariant;
...@@ -1345,8 +1382,6 @@ public: ...@@ -1345,8 +1382,6 @@ public:
private: private:
InstX8632Nop(Cfg *Func, SizeT Length); InstX8632Nop(Cfg *Func, SizeT Length);
InstX8632Nop(const InstX8632Nop &) = delete;
InstX8632Nop &operator=(const InstX8632Nop &) = delete;
~InstX8632Nop() override {} ~InstX8632Nop() override {}
NopVariant Variant; NopVariant Variant;
...@@ -1354,6 +1389,9 @@ private: ...@@ -1354,6 +1389,9 @@ private:
// Fld - load a value onto the x87 FP stack. // Fld - load a value onto the x87 FP stack.
class InstX8632Fld : public InstX8632 { class InstX8632Fld : public InstX8632 {
InstX8632Fld(const InstX8632Fld &) = delete;
InstX8632Fld &operator=(const InstX8632Fld &) = delete;
public: public:
static InstX8632Fld *create(Cfg *Func, Operand *Src) { static InstX8632Fld *create(Cfg *Func, Operand *Src) {
return new (Func->allocate<InstX8632Fld>()) InstX8632Fld(Func, Src); return new (Func->allocate<InstX8632Fld>()) InstX8632Fld(Func, Src);
...@@ -1365,13 +1403,14 @@ public: ...@@ -1365,13 +1403,14 @@ public:
private: private:
InstX8632Fld(Cfg *Func, Operand *Src); InstX8632Fld(Cfg *Func, Operand *Src);
InstX8632Fld(const InstX8632Fld &) = delete;
InstX8632Fld &operator=(const InstX8632Fld &) = delete;
~InstX8632Fld() override {} ~InstX8632Fld() override {}
}; };
// Fstp - store x87 st(0) into memory and pop st(0). // Fstp - store x87 st(0) into memory and pop st(0).
class InstX8632Fstp : public InstX8632 { class InstX8632Fstp : public InstX8632 {
InstX8632Fstp(const InstX8632Fstp &) = delete;
InstX8632Fstp &operator=(const InstX8632Fstp &) = delete;
public: public:
static InstX8632Fstp *create(Cfg *Func, Variable *Dest) { static InstX8632Fstp *create(Cfg *Func, Variable *Dest) {
return new (Func->allocate<InstX8632Fstp>()) InstX8632Fstp(Func, Dest); return new (Func->allocate<InstX8632Fstp>()) InstX8632Fstp(Func, Dest);
...@@ -1383,12 +1422,13 @@ public: ...@@ -1383,12 +1422,13 @@ public:
private: private:
InstX8632Fstp(Cfg *Func, Variable *Dest); InstX8632Fstp(Cfg *Func, Variable *Dest);
InstX8632Fstp(const InstX8632Fstp &) = delete;
InstX8632Fstp &operator=(const InstX8632Fstp &) = delete;
~InstX8632Fstp() override {} ~InstX8632Fstp() override {}
}; };
class InstX8632Pop : public InstX8632 { class InstX8632Pop : public InstX8632 {
InstX8632Pop(const InstX8632Pop &) = delete;
InstX8632Pop &operator=(const InstX8632Pop &) = delete;
public: public:
static InstX8632Pop *create(Cfg *Func, Variable *Dest) { static InstX8632Pop *create(Cfg *Func, Variable *Dest) {
return new (Func->allocate<InstX8632Pop>()) InstX8632Pop(Func, Dest); return new (Func->allocate<InstX8632Pop>()) InstX8632Pop(Func, Dest);
...@@ -1400,12 +1440,13 @@ public: ...@@ -1400,12 +1440,13 @@ public:
private: private:
InstX8632Pop(Cfg *Func, Variable *Dest); InstX8632Pop(Cfg *Func, Variable *Dest);
InstX8632Pop(const InstX8632Pop &) = delete;
InstX8632Pop &operator=(const InstX8632Pop &) = delete;
~InstX8632Pop() override {} ~InstX8632Pop() override {}
}; };
class InstX8632Push : public InstX8632 { class InstX8632Push : public InstX8632 {
InstX8632Push(const InstX8632Push &) = delete;
InstX8632Push &operator=(const InstX8632Push &) = delete;
public: public:
static InstX8632Push *create(Cfg *Func, Variable *Source) { static InstX8632Push *create(Cfg *Func, Variable *Source) {
return new (Func->allocate<InstX8632Push>()) return new (Func->allocate<InstX8632Push>())
...@@ -1418,8 +1459,6 @@ public: ...@@ -1418,8 +1459,6 @@ public:
private: private:
InstX8632Push(Cfg *Func, Variable *Source); InstX8632Push(Cfg *Func, Variable *Source);
InstX8632Push(const InstX8632Push &) = delete;
InstX8632Push &operator=(const InstX8632Push &) = delete;
~InstX8632Push() override {} ~InstX8632Push() override {}
}; };
...@@ -1428,6 +1467,9 @@ private: ...@@ -1428,6 +1467,9 @@ private:
// (for non-void returning functions) for liveness analysis, though // (for non-void returning functions) for liveness analysis, though
// a FakeUse before the ret would do just as well. // a FakeUse before the ret would do just as well.
class InstX8632Ret : public InstX8632 { class InstX8632Ret : public InstX8632 {
InstX8632Ret(const InstX8632Ret &) = delete;
InstX8632Ret &operator=(const InstX8632Ret &) = delete;
public: public:
static InstX8632Ret *create(Cfg *Func, Variable *Source = NULL) { static InstX8632Ret *create(Cfg *Func, Variable *Source = NULL) {
return new (Func->allocate<InstX8632Ret>()) InstX8632Ret(Func, Source); return new (Func->allocate<InstX8632Ret>()) InstX8632Ret(Func, Source);
...@@ -1439,8 +1481,6 @@ public: ...@@ -1439,8 +1481,6 @@ public:
private: private:
InstX8632Ret(Cfg *Func, Variable *Source); InstX8632Ret(Cfg *Func, Variable *Source);
InstX8632Ret(const InstX8632Ret &) = delete;
InstX8632Ret &operator=(const InstX8632Ret &) = delete;
~InstX8632Ret() override {} ~InstX8632Ret() override {}
}; };
...@@ -1452,6 +1492,9 @@ private: ...@@ -1452,6 +1492,9 @@ private:
// Both the dest and source are updated. The caller should then insert a // Both the dest and source are updated. The caller should then insert a
// FakeDef to reflect the second udpate. // FakeDef to reflect the second udpate.
class InstX8632Xadd : public InstX8632Lockable { class InstX8632Xadd : public InstX8632Lockable {
InstX8632Xadd(const InstX8632Xadd &) = delete;
InstX8632Xadd &operator=(const InstX8632Xadd &) = delete;
public: public:
static InstX8632Xadd *create(Cfg *Func, Operand *Dest, Variable *Source, static InstX8632Xadd *create(Cfg *Func, Operand *Dest, Variable *Source,
bool Locked) { bool Locked) {
...@@ -1465,8 +1508,6 @@ public: ...@@ -1465,8 +1508,6 @@ public:
private: private:
InstX8632Xadd(Cfg *Func, Operand *Dest, Variable *Source, bool Locked); InstX8632Xadd(Cfg *Func, Operand *Dest, Variable *Source, bool Locked);
InstX8632Xadd(const InstX8632Xadd &) = delete;
InstX8632Xadd &operator=(const InstX8632Xadd &) = delete;
~InstX8632Xadd() override {} ~InstX8632Xadd() override {}
}; };
...@@ -1477,6 +1518,9 @@ private: ...@@ -1477,6 +1518,9 @@ private:
// then the instruction is automatically "locked" without the need for // then the instruction is automatically "locked" without the need for
// a lock prefix. // a lock prefix.
class InstX8632Xchg : public InstX8632 { class InstX8632Xchg : public InstX8632 {
InstX8632Xchg(const InstX8632Xchg &) = delete;
InstX8632Xchg &operator=(const InstX8632Xchg &) = delete;
public: public:
static InstX8632Xchg *create(Cfg *Func, Operand *Dest, Variable *Source) { static InstX8632Xchg *create(Cfg *Func, Operand *Dest, Variable *Source) {
return new (Func->allocate<InstX8632Xchg>()) return new (Func->allocate<InstX8632Xchg>())
...@@ -1489,8 +1533,6 @@ public: ...@@ -1489,8 +1533,6 @@ public:
private: private:
InstX8632Xchg(Cfg *Func, Operand *Dest, Variable *Source); InstX8632Xchg(Cfg *Func, Operand *Dest, Variable *Source);
InstX8632Xchg(const InstX8632Xchg &) = delete;
InstX8632Xchg &operator=(const InstX8632Xchg &) = delete;
~InstX8632Xchg() override {} ~InstX8632Xchg() override {}
}; };
......
...@@ -24,6 +24,9 @@ class InstCall; ...@@ -24,6 +24,9 @@ class InstCall;
static const size_t kMaxIntrinsicParameters = 6; static const size_t kMaxIntrinsicParameters = 6;
class Intrinsics { class Intrinsics {
Intrinsics(const Intrinsics &) = delete;
Intrinsics &operator=(const Intrinsics &) = delete;
public: public:
Intrinsics(); Intrinsics();
~Intrinsics(); ~Intrinsics();
...@@ -158,9 +161,6 @@ private: ...@@ -158,9 +161,6 @@ private:
// TODO(jvoung): May want to switch to something like LLVM's StringMap. // TODO(jvoung): May want to switch to something like LLVM's StringMap.
typedef std::map<IceString, FullIntrinsicInfo> IntrinsicMap; typedef std::map<IceString, FullIntrinsicInfo> IntrinsicMap;
IntrinsicMap Map; IntrinsicMap Map;
Intrinsics(const Intrinsics &) = delete;
Intrinsics &operator=(const Intrinsics &) = delete;
}; };
} // end of namespace Ice } // end of namespace Ice
......
...@@ -26,6 +26,11 @@ ...@@ -26,6 +26,11 @@
namespace Ice { namespace Ice {
class LivenessNode { class LivenessNode {
// TODO: Disable these constructors when Liveness::Nodes is no
// longer an STL container.
// LivenessNode(const LivenessNode &) = delete;
// LivenessNode &operator=(const LivenessNode &) = delete;
public: public:
LivenessNode() : NumLocals(0) {} LivenessNode() : NumLocals(0) {}
// NumLocals is the number of Variables local to this block. // NumLocals is the number of Variables local to this block.
...@@ -43,12 +48,6 @@ public: ...@@ -43,12 +48,6 @@ public:
// index/key of each element is less than NumLocals + // index/key of each element is less than NumLocals +
// Liveness::NumGlobals. // Liveness::NumGlobals.
LiveBeginEndMap LiveBegin, LiveEnd; LiveBeginEndMap LiveBegin, LiveEnd;
private:
// TODO: Disable these constructors when Liveness::Nodes is no
// longer an STL container.
// LivenessNode(const LivenessNode &) = delete;
// LivenessNode &operator=(const LivenessNode &) = delete;
}; };
class Liveness { class Liveness {
......
...@@ -26,6 +26,9 @@ ...@@ -26,6 +26,9 @@
namespace Ice { namespace Ice {
class Operand { class Operand {
Operand(const Operand &) = delete;
Operand &operator=(const Operand &) = delete;
public: public:
static const size_t MaxTargetKinds = 10; static const size_t MaxTargetKinds = 10;
enum OperandKind { enum OperandKind {
...@@ -86,10 +89,6 @@ protected: ...@@ -86,10 +89,6 @@ protected:
// Vars and NumVars are initialized by the derived class. // Vars and NumVars are initialized by the derived class.
SizeT NumVars; SizeT NumVars;
Variable **Vars; Variable **Vars;
private:
Operand(const Operand &) = delete;
Operand &operator=(const Operand &) = delete;
}; };
template<class StreamType> template<class StreamType>
...@@ -101,6 +100,9 @@ inline StreamType &operator<<(StreamType &Str, const Operand &Op) { ...@@ -101,6 +100,9 @@ inline StreamType &operator<<(StreamType &Str, const Operand &Op) {
// Constant is the abstract base class for constants. All // Constant is the abstract base class for constants. All
// constants are allocated from a global arena and are pooled. // constants are allocated from a global arena and are pooled.
class Constant : public Operand { class Constant : public Operand {
Constant(const Constant &) = delete;
Constant &operator=(const Constant &) = delete;
public: public:
uint32_t getPoolEntryID() const { return PoolEntryID; } uint32_t getPoolEntryID() const { return PoolEntryID; }
using Operand::dump; using Operand::dump;
...@@ -124,15 +126,14 @@ protected: ...@@ -124,15 +126,14 @@ protected:
// within its constant pool. It is used for building the constant // within its constant pool. It is used for building the constant
// pool in the object code and for referencing its entries. // pool in the object code and for referencing its entries.
const uint32_t PoolEntryID; const uint32_t PoolEntryID;
private:
Constant(const Constant &) = delete;
Constant &operator=(const Constant &) = delete;
}; };
// ConstantPrimitive<> wraps a primitive type. // ConstantPrimitive<> wraps a primitive type.
template <typename T, Operand::OperandKind K> template <typename T, Operand::OperandKind K>
class ConstantPrimitive : public Constant { class ConstantPrimitive : public Constant {
ConstantPrimitive(const ConstantPrimitive &) = delete;
ConstantPrimitive &operator=(const ConstantPrimitive &) = delete;
public: public:
static ConstantPrimitive *create(GlobalContext *Ctx, Type Ty, T Value, static ConstantPrimitive *create(GlobalContext *Ctx, Type Ty, T Value,
uint32_t PoolEntryID) { uint32_t PoolEntryID) {
...@@ -154,8 +155,6 @@ public: ...@@ -154,8 +155,6 @@ public:
private: private:
ConstantPrimitive(Type Ty, T Value, uint32_t PoolEntryID) ConstantPrimitive(Type Ty, T Value, uint32_t PoolEntryID)
: Constant(K, Ty, PoolEntryID), Value(Value) {} : Constant(K, Ty, PoolEntryID), Value(Value) {}
ConstantPrimitive(const ConstantPrimitive &) = delete;
ConstantPrimitive &operator=(const ConstantPrimitive &) = delete;
~ConstantPrimitive() override {} ~ConstantPrimitive() override {}
const T Value; const T Value;
}; };
...@@ -182,15 +181,13 @@ template <> inline void ConstantInteger64::dump(const Cfg *, Ostream &Str) const ...@@ -182,15 +181,13 @@ template <> inline void ConstantInteger64::dump(const Cfg *, Ostream &Str) const
// ConstantRelocatable can fit into the global constant pool // ConstantRelocatable can fit into the global constant pool
// template mechanism. // template mechanism.
class RelocatableTuple { class RelocatableTuple {
// RelocatableTuple(const RelocatableTuple &) = delete;
RelocatableTuple &operator=(const RelocatableTuple &) = delete; RelocatableTuple &operator=(const RelocatableTuple &) = delete;
public: public:
RelocatableTuple(const RelocOffsetT Offset, const IceString &Name, RelocatableTuple(const RelocOffsetT Offset, const IceString &Name,
bool SuppressMangling) bool SuppressMangling)
: Offset(Offset), Name(Name), SuppressMangling(SuppressMangling) {} : Offset(Offset), Name(Name), SuppressMangling(SuppressMangling) {}
RelocatableTuple(const RelocatableTuple &Other)
: Offset(Other.Offset), Name(Other.Name),
SuppressMangling(Other.SuppressMangling) {}
const RelocOffsetT Offset; const RelocOffsetT Offset;
const IceString Name; const IceString Name;
...@@ -202,6 +199,9 @@ bool operator<(const RelocatableTuple &A, const RelocatableTuple &B); ...@@ -202,6 +199,9 @@ bool operator<(const RelocatableTuple &A, const RelocatableTuple &B);
// ConstantRelocatable represents a symbolic constant combined with // ConstantRelocatable represents a symbolic constant combined with
// a fixed offset. // a fixed offset.
class ConstantRelocatable : public Constant { class ConstantRelocatable : public Constant {
ConstantRelocatable(const ConstantRelocatable &) = delete;
ConstantRelocatable &operator=(const ConstantRelocatable &) = delete;
public: public:
static ConstantRelocatable *create(GlobalContext *Ctx, Type Ty, static ConstantRelocatable *create(GlobalContext *Ctx, Type Ty,
const RelocatableTuple &Tuple, const RelocatableTuple &Tuple,
...@@ -229,8 +229,6 @@ private: ...@@ -229,8 +229,6 @@ private:
bool SuppressMangling, uint32_t PoolEntryID) bool SuppressMangling, uint32_t PoolEntryID)
: Constant(kConstRelocatable, Ty, PoolEntryID), Offset(Offset), : Constant(kConstRelocatable, Ty, PoolEntryID), Offset(Offset),
Name(Name), SuppressMangling(SuppressMangling) {} Name(Name), SuppressMangling(SuppressMangling) {}
ConstantRelocatable(const ConstantRelocatable &) = delete;
ConstantRelocatable &operator=(const ConstantRelocatable &) = delete;
~ConstantRelocatable() override {} ~ConstantRelocatable() override {}
const RelocOffsetT Offset; // fixed offset to add const RelocOffsetT Offset; // fixed offset to add
const IceString Name; // optional for debug/dump const IceString Name; // optional for debug/dump
...@@ -241,6 +239,9 @@ private: ...@@ -241,6 +239,9 @@ private:
// legal to lower ConstantUndef to any value, backends should try to // legal to lower ConstantUndef to any value, backends should try to
// make code generation deterministic by lowering ConstantUndefs to 0. // make code generation deterministic by lowering ConstantUndefs to 0.
class ConstantUndef : public Constant { class ConstantUndef : public Constant {
ConstantUndef(const ConstantUndef &) = delete;
ConstantUndef &operator=(const ConstantUndef &) = delete;
public: public:
static ConstantUndef *create(GlobalContext *Ctx, Type Ty, static ConstantUndef *create(GlobalContext *Ctx, Type Ty,
uint32_t PoolEntryID) { uint32_t PoolEntryID) {
...@@ -260,8 +261,6 @@ public: ...@@ -260,8 +261,6 @@ public:
private: private:
ConstantUndef(Type Ty, uint32_t PoolEntryID) ConstantUndef(Type Ty, uint32_t PoolEntryID)
: Constant(kConstUndef, Ty, PoolEntryID) {} : Constant(kConstUndef, Ty, PoolEntryID) {}
ConstantUndef(const ConstantUndef &) = delete;
ConstantUndef &operator=(const ConstantUndef &) = delete;
~ConstantUndef() override {} ~ConstantUndef() override {}
}; };
...@@ -269,6 +268,9 @@ private: ...@@ -269,6 +268,9 @@ private:
// special value that represents infinite weight, and an addWeight() // special value that represents infinite weight, and an addWeight()
// method that ensures that W+infinity=infinity. // method that ensures that W+infinity=infinity.
class RegWeight { class RegWeight {
// RegWeight(const RegWeight &) = delete;
// RegWeight &operator=(const RegWeight &) = delete;
public: public:
RegWeight() : Weight(0) {} RegWeight() : Weight(0) {}
RegWeight(uint32_t Weight) : Weight(Weight) {} RegWeight(uint32_t Weight) : Weight(Weight) {}
...@@ -300,6 +302,9 @@ bool operator==(const RegWeight &A, const RegWeight &B); ...@@ -300,6 +302,9 @@ bool operator==(const RegWeight &A, const RegWeight &B);
// weight, in case e.g. we want a live range to have higher weight // weight, in case e.g. we want a live range to have higher weight
// inside a loop. // inside a loop.
class LiveRange { class LiveRange {
// LiveRange(const LiveRange &) = delete;
// LiveRange &operator=(const LiveRange &) = delete;
public: public:
LiveRange() : Weight(0), IsNonpoints(false) {} LiveRange() : Weight(0), IsNonpoints(false) {}
...@@ -516,6 +521,9 @@ typedef std::vector<const Inst *> InstDefList; ...@@ -516,6 +521,9 @@ typedef std::vector<const Inst *> InstDefList;
// VariableTracking tracks the metadata for a single variable. It is // VariableTracking tracks the metadata for a single variable. It is
// only meant to be used internally by VariablesMetadata. // only meant to be used internally by VariablesMetadata.
class VariableTracking { class VariableTracking {
// VariableTracking(const VariableTracking &) = delete;
VariableTracking &operator=(const VariableTracking &) = delete;
public: public:
enum MultiDefState { enum MultiDefState {
// TODO(stichnot): Consider using just a simple counter. // TODO(stichnot): Consider using just a simple counter.
...@@ -543,7 +551,6 @@ public: ...@@ -543,7 +551,6 @@ public:
void markDef(const Inst *Instr, const CfgNode *Node); void markDef(const Inst *Instr, const CfgNode *Node);
private: private:
VariableTracking &operator=(const VariableTracking &) = delete;
MultiDefState MultiDef; MultiDefState MultiDef;
MultiBlockState MultiBlock; MultiBlockState MultiBlock;
const CfgNode *SingleUseNode; const CfgNode *SingleUseNode;
...@@ -556,6 +563,9 @@ private: ...@@ -556,6 +563,9 @@ private:
// VariablesMetadata analyzes and summarizes the metadata for the // VariablesMetadata analyzes and summarizes the metadata for the
// complete set of Variables. // complete set of Variables.
class VariablesMetadata { class VariablesMetadata {
VariablesMetadata(const VariablesMetadata &) = delete;
VariablesMetadata &operator=(const VariablesMetadata &) = delete;
public: public:
VariablesMetadata(const Cfg *Func) : Func(Func) {} VariablesMetadata(const Cfg *Func) : Func(Func) {}
// Initialize the state by traversing all instructions/variables in // Initialize the state by traversing all instructions/variables in
...@@ -602,8 +612,6 @@ private: ...@@ -602,8 +612,6 @@ private:
const Cfg *Func; const Cfg *Func;
std::vector<VariableTracking> Metadata; std::vector<VariableTracking> Metadata;
const static InstDefList NoDefinitions; const static InstDefList NoDefinitions;
VariablesMetadata(const VariablesMetadata &) = delete;
VariablesMetadata &operator=(const VariablesMetadata &) = delete;
}; };
} // end of namespace Ice } // end of namespace Ice
......
...@@ -22,14 +22,14 @@ ...@@ -22,14 +22,14 @@
namespace Ice { namespace Ice {
class RandomNumberGenerator { class RandomNumberGenerator {
RandomNumberGenerator(const RandomNumberGenerator &) = delete;
RandomNumberGenerator &operator=(const RandomNumberGenerator &) = delete;
public: public:
RandomNumberGenerator(llvm::StringRef Salt); RandomNumberGenerator(llvm::StringRef Salt);
uint64_t next(uint64_t Max); uint64_t next(uint64_t Max);
private: private:
RandomNumberGenerator(const RandomNumberGenerator &) = delete;
RandomNumberGenerator &operator=(const RandomNumberGenerator &) = delete;
uint64_t State; uint64_t State;
}; };
...@@ -37,16 +37,16 @@ private: ...@@ -37,16 +37,16 @@ private:
// reason for the wrapper class is that we want to keep the // reason for the wrapper class is that we want to keep the
// RandomNumberGenerator interface identical to LLVM's. // RandomNumberGenerator interface identical to LLVM's.
class RandomNumberGeneratorWrapper { class RandomNumberGeneratorWrapper {
RandomNumberGeneratorWrapper(const RandomNumberGeneratorWrapper &) = delete;
RandomNumberGeneratorWrapper &
operator=(const RandomNumberGeneratorWrapper &) = delete;
public: public:
uint64_t next(uint64_t Max) { return RNG.next(Max); } uint64_t next(uint64_t Max) { return RNG.next(Max); }
bool getTrueWithProbability(float Probability); bool getTrueWithProbability(float Probability);
RandomNumberGeneratorWrapper(RandomNumberGenerator &RNG) : RNG(RNG) {} RandomNumberGeneratorWrapper(RandomNumberGenerator &RNG) : RNG(RNG) {}
private: private:
RandomNumberGeneratorWrapper(const RandomNumberGeneratorWrapper &) = delete;
RandomNumberGeneratorWrapper &
operator=(const RandomNumberGeneratorWrapper &) = delete;
RandomNumberGenerator &RNG; RandomNumberGenerator &RNG;
}; };
......
...@@ -35,6 +35,9 @@ class Assembler; ...@@ -35,6 +35,9 @@ class Assembler;
// when inserting new instructions in order to track whether variables // when inserting new instructions in order to track whether variables
// are used as single-block or multi-block. // are used as single-block or multi-block.
class LoweringContext { class LoweringContext {
LoweringContext(const LoweringContext &) = delete;
LoweringContext &operator=(const LoweringContext &) = delete;
public: public:
LoweringContext() : Node(NULL) {} LoweringContext() : Node(NULL) {}
~LoweringContext() {} ~LoweringContext() {}
...@@ -86,11 +89,12 @@ private: ...@@ -86,11 +89,12 @@ private:
void skipDeleted(InstList::iterator &I) const; void skipDeleted(InstList::iterator &I) const;
void advanceForward(InstList::iterator &I) const; void advanceForward(InstList::iterator &I) const;
void advanceBackward(InstList::iterator &I) const; void advanceBackward(InstList::iterator &I) const;
LoweringContext(const LoweringContext &) = delete;
LoweringContext &operator=(const LoweringContext &) = delete;
}; };
class TargetLowering { class TargetLowering {
TargetLowering(const TargetLowering &) = delete;
TargetLowering &operator=(const TargetLowering &) = delete;
public: public:
static TargetLowering *createLowering(TargetArch Target, Cfg *Func); static TargetLowering *createLowering(TargetArch Target, Cfg *Func);
static Assembler *createAssembler(TargetArch Target, Cfg *Func); static Assembler *createAssembler(TargetArch Target, Cfg *Func);
...@@ -233,16 +237,16 @@ protected: ...@@ -233,16 +237,16 @@ protected:
// natural location, as arguments are pushed for a function call. // natural location, as arguments are pushed for a function call.
int32_t StackAdjustment; int32_t StackAdjustment;
LoweringContext Context; LoweringContext Context;
private:
TargetLowering(const TargetLowering &) = delete;
TargetLowering &operator=(const TargetLowering &) = delete;
}; };
// TargetGlobalInitLowering is used for "lowering" global // TargetGlobalInitLowering is used for "lowering" global
// initializers. It is separated out from TargetLowering because it // initializers. It is separated out from TargetLowering because it
// does not require a Cfg. // does not require a Cfg.
class TargetGlobalInitLowering { class TargetGlobalInitLowering {
TargetGlobalInitLowering(const TargetGlobalInitLowering &) = delete;
TargetGlobalInitLowering &operator=(const TargetGlobalInitLowering &) =
delete;
public: public:
static TargetGlobalInitLowering *createLowering(TargetArch Target, static TargetGlobalInitLowering *createLowering(TargetArch Target,
GlobalContext *Ctx); GlobalContext *Ctx);
...@@ -253,11 +257,6 @@ public: ...@@ -253,11 +257,6 @@ public:
protected: protected:
TargetGlobalInitLowering(GlobalContext *Ctx) : Ctx(Ctx) {} TargetGlobalInitLowering(GlobalContext *Ctx) : Ctx(Ctx) {}
GlobalContext *Ctx; GlobalContext *Ctx;
private:
TargetGlobalInitLowering(const TargetGlobalInitLowering &) = delete;
TargetGlobalInitLowering &operator=(const TargetGlobalInitLowering &) =
delete;
}; };
} // end of namespace Ice } // end of namespace Ice
......
...@@ -25,6 +25,9 @@ ...@@ -25,6 +25,9 @@
namespace Ice { namespace Ice {
class TargetX8632 : public TargetLowering { class TargetX8632 : public TargetLowering {
TargetX8632(const TargetX8632 &) = delete;
TargetX8632 &operator=(const TargetX8632 &) = delete;
public: public:
static TargetX8632 *create(Cfg *Func) { return new TargetX8632(Func); } static TargetX8632 *create(Cfg *Func) { return new TargetX8632(Func); }
...@@ -483,13 +486,14 @@ protected: ...@@ -483,13 +486,14 @@ protected:
static IceString RegNames[]; static IceString RegNames[];
private: private:
TargetX8632(const TargetX8632 &) = delete;
TargetX8632 &operator=(const TargetX8632 &) = delete;
~TargetX8632() override {} ~TargetX8632() override {}
template <typename T> void emitConstantPool() const; template <typename T> void emitConstantPool() const;
}; };
class TargetGlobalInitX8632 : public TargetGlobalInitLowering { class TargetGlobalInitX8632 : public TargetGlobalInitLowering {
TargetGlobalInitX8632(const TargetGlobalInitX8632 &) = delete;
TargetGlobalInitX8632 &operator=(const TargetGlobalInitX8632 &) = delete;
public: public:
static TargetGlobalInitLowering *create(GlobalContext *Ctx) { static TargetGlobalInitLowering *create(GlobalContext *Ctx) {
return new TargetGlobalInitX8632(Ctx); return new TargetGlobalInitX8632(Ctx);
...@@ -501,8 +505,6 @@ protected: ...@@ -501,8 +505,6 @@ protected:
TargetGlobalInitX8632(GlobalContext *Ctx); TargetGlobalInitX8632(GlobalContext *Ctx);
private: private:
TargetGlobalInitX8632(const TargetGlobalInitX8632 &) = delete;
TargetGlobalInitX8632 &operator=(const TargetGlobalInitX8632 &) = delete;
~TargetGlobalInitX8632() override {} ~TargetGlobalInitX8632() override {}
}; };
......
...@@ -31,6 +31,9 @@ typedef std::vector<TimerTreeNode>::size_type TTindex; ...@@ -31,6 +31,9 @@ typedef std::vector<TimerTreeNode>::size_type TTindex;
// the TimerTreeNode::Nodes array, and the parent is always at a lower // the TimerTreeNode::Nodes array, and the parent is always at a lower
// index. // index.
class TimerTreeNode { class TimerTreeNode {
// TimerTreeNode(const TimerTreeNode &) = delete;
TimerTreeNode &operator=(const TimerTreeNode &) = delete;
public: public:
TimerTreeNode() : Parent(0), Interior(0), Time(0), UpdateCount(0) {} TimerTreeNode() : Parent(0), Interior(0), Time(0), UpdateCount(0) {}
std::vector<TTindex> Children; // indexed by TimerIdT std::vector<TTindex> Children; // indexed by TimerIdT
......
...@@ -32,6 +32,9 @@ class GlobalContext; ...@@ -32,6 +32,9 @@ class GlobalContext;
// other intermediate representations down to ICE, and then call the appropriate // other intermediate representations down to ICE, and then call the appropriate
// (inherited) methods to convert ICE into machine instructions. // (inherited) methods to convert ICE into machine instructions.
class Translator { class Translator {
Translator(const Translator &) = delete;
Translator &operator=(const Translator &) = delete;
public: public:
typedef std::vector<VariableDeclaration *> VariableDeclarationListType; typedef std::vector<VariableDeclaration *> VariableDeclarationListType;
...@@ -81,11 +84,8 @@ protected: ...@@ -81,11 +84,8 @@ protected:
// GlobalContext instead of Cfg, and then make emitConstantPool use // GlobalContext instead of Cfg, and then make emitConstantPool use
// that. // that.
std::unique_ptr<Cfg> Func; std::unique_ptr<Cfg> Func;
private:
Translator(const Translator &) = delete;
Translator &operator=(const Translator &) = delete;
}; };
}
} // end of namespace Ice
#endif // SUBZERO_SRC_ICETRANSLATOR_H #endif // SUBZERO_SRC_ICETRANSLATOR_H
...@@ -22,6 +22,9 @@ ...@@ -22,6 +22,9 @@
namespace Ice { namespace Ice {
class PNaClTranslator : public Translator { class PNaClTranslator : public Translator {
PNaClTranslator(const PNaClTranslator &) = delete;
PNaClTranslator &operator=(const PNaClTranslator &) = delete;
public: public:
PNaClTranslator(GlobalContext *Ctx, const ClFlags &Flags) PNaClTranslator(GlobalContext *Ctx, const ClFlags &Flags)
: Translator(Ctx, Flags) {} : Translator(Ctx, Flags) {}
...@@ -29,11 +32,8 @@ public: ...@@ -29,11 +32,8 @@ public:
// converted to machine code. Sets ErrorStatus to true if any // converted to machine code. Sets ErrorStatus to true if any
// errors occurred. // errors occurred.
void translate(const std::string &IRFilename); void translate(const std::string &IRFilename);
private:
PNaClTranslator(const PNaClTranslator &) = delete;
PNaClTranslator &operator=(const PNaClTranslator &) = delete;
}; };
}
} // end of namespace Ice
#endif // SUBZERO_SRC_PNACLTRANSLATOR_H #endif // SUBZERO_SRC_PNACLTRANSLATOR_H
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment