From 577b231458fbd956dcd297634b5ffa71fbefd2c0 Mon Sep 17 00:00:00 2001 From: M Henning Date: Sat, 19 Aug 2023 15:48:02 -0400 Subject: [PATCH] nv/codegen: Delete copy and assign Reviewed-by: Karol Herbst Part-of: --- src/nouveau/codegen/nv50_ir.h | 19 +++++++++++++++++++ src/nouveau/codegen/nv50_ir_util.h | 16 ++++++++++++++++ 2 files changed, 35 insertions(+) diff --git a/src/nouveau/codegen/nv50_ir.h b/src/nouveau/codegen/nv50_ir.h index 272bbda..4dd5739 100644 --- a/src/nouveau/codegen/nv50_ir.h +++ b/src/nouveau/codegen/nv50_ir.h @@ -653,6 +653,8 @@ public: ValueRef(const ValueRef&); ~ValueRef(); + ValueRef& operator=(const ValueRef&) = delete; + inline bool exists() const { return value != NULL; } void set(Value *); @@ -690,6 +692,8 @@ public: ValueDef(const ValueDef&); ~ValueDef(); + ValueDef& operator=(const ValueDef&) = delete; + inline bool exists() const { return value != NULL; } inline Value *get() const { return value; } @@ -719,6 +723,9 @@ public: Value(); virtual ~Value() { } + Value(const Value&) = delete; + Value& operator=(const Value&) = delete; + virtual Value *clone(ClonePolicy&) const = 0; virtual int print(char *, size_t, DataType ty = TYPE_NONE) const = 0; @@ -855,6 +862,9 @@ public: Instruction(Function *, operation, DataType); virtual ~Instruction(); + Instruction(const Instruction&) = delete; + Instruction& operator=(const Instruction&) = delete; + virtual Instruction *clone(ClonePolicy&, Instruction * = NULL) const; @@ -1159,6 +1169,9 @@ public: BasicBlock(Function *); ~BasicBlock(); + BasicBlock(const BasicBlock&) = delete; + BasicBlock& operator=(const BasicBlock&) = delete; + BasicBlock *clone(ClonePolicy&) const; inline int getId() const { return id; } @@ -1237,6 +1250,9 @@ public: Function(Program *, const char *name, uint32_t label); ~Function(); + Function(const Function&) = delete; + Function& operator=(const Function&) = delete; + static inline Function *get(Graph::Node *node); inline Program *getProgram() const { return prog; } @@ -1322,6 +1338,9 @@ public: Program(Type type, Target *targ); ~Program(); + Program(const Program&) = delete; + Program& operator=(const Program&) = delete; + void print(); Type getType() const { return progType; } diff --git a/src/nouveau/codegen/nv50_ir_util.h b/src/nouveau/codegen/nv50_ir_util.h index 2ab11b9..e5a7d90 100644 --- a/src/nouveau/codegen/nv50_ir_util.h +++ b/src/nouveau/codegen/nv50_ir_util.h @@ -160,6 +160,9 @@ public: DLList() : head(0) { } ~DLList() { clear(); } + DLList(const DLList&) = delete; + DLList& operator=(const DLList&) = delete; + inline void insertHead(void *data) { Item *item = new Item(data); @@ -248,6 +251,9 @@ public: Stack() : size(0), limit(0), array(0) { } ~Stack() { if (array) FREE(array); } + Stack(const Stack&) = delete; + Stack& operator=(const Stack&) = delete; + inline void push(int i) { Item data; data.u.i = i; push(data); } inline void push(unsigned int u) { Item data; data.u.u = u; push(data); } inline void push(void *p) { Item data; data.u.p = p; push(data); } @@ -316,6 +322,9 @@ public: ~DynArray() { if (data) FREE(data); } + DynArray(const DynArray&) = delete; + DynArray& operator=(const DynArray&) = delete; + inline Item& operator[](unsigned int i) { if (i >= size) @@ -422,6 +431,8 @@ public: Interval(const Interval&); ~Interval(); + Interval& operator=(const Interval&) = delete; + bool extend(int, int); void insert(const Interval&); void unify(Interval&); // clears source interval @@ -484,6 +495,8 @@ public: FREE(data); } + BitSet(const BitSet&) = delete; + // allocate will keep old data iff size is unchanged bool allocate(unsigned int nBits, bool zero); bool resize(unsigned int nBits); // keep old data, zero additional bits @@ -626,6 +639,9 @@ public: FREE(allocArray); } + MemoryPool(const MemoryPool&) = delete; + MemoryPool& operator=(const MemoryPool&) = delete; + void *allocate() { void *ret; -- 2.7.4