Skip to content

Commit d3f561c

Browse files
nurmukhametovdbabokin
authored andcommitted
Fix missing copy constructor warnings
1 parent 998e05a commit d3f561c

File tree

3 files changed

+26
-0
lines changed

3 files changed

+26
-0
lines changed

src/decl.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,11 @@ struct StructDeclaration : public Traceable {
184184
StructDeclaration(const Type *t, std::vector<Declarator *> *d) : type(t), declarators(d) {}
185185
~StructDeclaration() { delete declarators; }
186186

187+
// We don't copy these objects at the moment. If we will then proper
188+
// implementations are needed considering the ownership of declarators.
189+
StructDeclaration(const StructDeclaration &) = delete;
190+
StructDeclaration &operator=(const StructDeclaration &) = delete;
191+
187192
const Type *type;
188193
std::vector<Declarator *> *declarators;
189194
};

src/ispc.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,12 @@ class Target {
219219

220220
~Target();
221221

222+
// We don't copy Target objects at the moment. If we will then proper
223+
// implementations are needed considering the ownership of heap-allocated
224+
// fields like m_dataLayout.
225+
Target(const Target &) = delete;
226+
Target &operator=(const Target &) = delete;
227+
222228
/** Check if LLVM intrinsic is supported for the current target. */
223229
bool checkIntrinsticSupport(llvm::StringRef name, SourcePos pos);
224230

src/module.h

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,12 @@ class Module {
4646

4747
~Module();
4848

49+
// We don't copy Module objects at the moment. If we will then proper
50+
// implementations are needed considering the ownership of heap-allocated
51+
// fields like symbolTable.
52+
Module(const Module &) = delete;
53+
Module &operator=(const Module &) = delete;
54+
4955
/** Compiles the source file passed to the Module constructor, adding
5056
its global variables and functions to both the llvm::Module and
5157
SymbolTable. Returns the number of errors during compilation. */
@@ -120,6 +126,15 @@ class Module {
120126
: pic(o.pic), flatDeps(o.flatDeps), makeRuleDeps(o.makeRuleDeps), depsToStdout(o.depsToStdout),
121127
mcModel(o.mcModel) {}
122128

129+
OutputFlags &operator=(const OutputFlags &o) {
130+
pic = o.pic;
131+
flatDeps = o.flatDeps;
132+
makeRuleDeps = o.makeRuleDeps;
133+
depsToStdout = o.depsToStdout;
134+
mcModel = o.mcModel;
135+
return *this;
136+
};
137+
123138
void setPIC(bool v = true) { pic = v; }
124139
bool isPIC() const { return pic; }
125140
void setFlatDeps(bool v = true) { flatDeps = v; }

0 commit comments

Comments
 (0)