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;
......
...@@ -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