Skip to content

Commit 9ae78be

Browse files
smilczekigcbot
authored andcommitted
Apply rule-of-three
Applies rule-of-three by removing missing copy ctors.
1 parent 6a2055e commit 9ae78be

File tree

9 files changed

+33
-2
lines changed

9 files changed

+33
-2
lines changed

IGC/AdaptorOCL/CLElfLib/ElfReader.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,9 @@ class CElfReader {
5151

5252
ELF_CALL ~CElfReader();
5353

54+
CElfReader(const CElfReader &) = delete;
55+
CElfReader &operator=(const CElfReader &) = delete;
56+
5457
SElfHeader *m_pElfHeader; // pointer to the ELF header
5558
const char *m_pBinary; // portable ELF binary
5659
char *m_pNameTable; // pointer to the string table

IGC/AdaptorOCL/OCL/util/BinaryStream.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ class BinaryStream {
1717
BinaryStream();
1818
~BinaryStream();
1919

20+
BinaryStream(const BinaryStream &) = delete;
21+
BinaryStream &operator=(const BinaryStream &) = delete;
22+
2023
bool Write(const char *s, std::streamsize n);
2124

2225
bool Write(const BinaryStream &in);

IGC/BiFManager/BiFManagerCommon.hpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@ class CollectBuiltinsPass : public llvm::InstVisitor<CollectBuiltinsPass> {
3535
CollectBuiltinsPass(TFunctionsVec &neededBuiltinsFunc, const std::function<bool(llvm::Function *)> &predicate);
3636
~CollectBuiltinsPass();
3737

38+
CollectBuiltinsPass(const CollectBuiltinsPass &) = delete;
39+
CollectBuiltinsPass &operator=(const CollectBuiltinsPass &) = delete;
40+
3841
void visitCallInst(llvm::CallInst &callInst);
3942
};
4043

@@ -60,6 +63,9 @@ class BiFManagerCommon {
6063
BiFManagerCommon(llvm::LLVMContext &Context);
6164
~BiFManagerCommon();
6265

66+
BiFManagerCommon(const BiFManagerCommon &) = delete;
67+
BiFManagerCommon &operator=(const BiFManagerCommon &) = delete;
68+
6369
static size_t getHash(const std::string &FlagName);
6470

6571
protected:

IGC/BiFManager/BiFManagerHandler.hpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ class BiFManagerHandler : public BiFManagerCommon {
3232
BiFManagerHandler(llvm::LLVMContext &Context);
3333
~BiFManagerHandler();
3434

35+
BiFManagerHandler(const BiFManagerHandler &) = delete;
36+
BiFManagerHandler &operator=(const BiFManagerHandler &) = delete;
37+
3538
// Indicator if we have pointer size 32 in user module
3639
bool isPtrSizeInBits32;
3740

IGC/Compiler/CISACodeGen/ComputeShaderBase.hpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ class CComputeShaderBase : public CShader {
2020
CComputeShaderBase(llvm::Function *pFunc, CShaderProgram *pProgram, GenericShaderState &GState);
2121
virtual ~CComputeShaderBase();
2222

23+
CComputeShaderBase(const CComputeShaderBase &) = delete;
24+
CComputeShaderBase &operator=(const CComputeShaderBase &) = delete;
25+
2326
protected:
2427
// Determines if HW can handle auto generating local IDs with this
2528
// order

IGC/Compiler/CISACodeGen/DebugInfo.hpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@ class DebugInfoPass : public llvm::ModulePass {
3434
DebugInfoPass(CShaderProgram::KernelShaderMap &);
3535
virtual llvm::StringRef getPassName() const override { return "DebugInfoPass"; }
3636
virtual ~DebugInfoPass();
37+
38+
DebugInfoPass(const DebugInfoPass &) = delete;
39+
DebugInfoPass &operator=(const DebugInfoPass &) = delete;
40+
3741
static char ID;
3842

3943
private:
@@ -57,6 +61,10 @@ class CatchAllLineNumber : public llvm::FunctionPass {
5761
public:
5862
CatchAllLineNumber();
5963
virtual ~CatchAllLineNumber();
64+
65+
CatchAllLineNumber(const CatchAllLineNumber &) = delete;
66+
CatchAllLineNumber &operator=(const CatchAllLineNumber &) = delete;
67+
6068
static char ID;
6169

6270
llvm::StringRef getPassName() const override { return "CatchAllLineNumber"; }

IGC/Compiler/CISACodeGen/EmitVISAPass.hpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,9 @@ class EmitPass : public llvm::FunctionPass {
5555

5656
virtual ~EmitPass();
5757

58+
EmitPass(const EmitPass &) = delete;
59+
EmitPass &operator=(const EmitPass &) = delete;
60+
5861
// Note: all analysis passes should be function passes. If a module analysis pass
5962
// is used, it would invalidate function analysis passes and therefore cause
6063
// those analysis passes to be invoked twice, which increases compiling time.

IGC/Compiler/CISACodeGen/GenCodeGenModule.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,10 @@ class GenXCodeGenModule : public llvm::ModulePass {
4040
static char ID;
4141
GenXCodeGenModule();
4242
~GenXCodeGenModule();
43+
44+
GenXCodeGenModule(const GenXCodeGenModule &) = delete;
45+
GenXCodeGenModule &operator=(const GenXCodeGenModule &) = delete;
46+
4347
virtual llvm::StringRef getPassName() const override { return "GenX CodeGen module"; }
4448
void getAnalysisUsage(llvm::AnalysisUsage &AU) const override;
4549
bool runOnModule(llvm::Module &M) override;

IGC/Compiler/Optimizer/OpenCLPasses/UndefinedReferences/UndefinedReferencesPass.hpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@ class UndefinedReferencesPass : public llvm::ModulePass {
2222

2323
UndefinedReferencesPass();
2424

25-
~UndefinedReferencesPass() {}
26-
2725
virtual llvm::StringRef getPassName() const override { return "UndefinedReferencesPass"; }
2826
virtual void getAnalysisUsage(llvm::AnalysisUsage &AU) const override { AU.addRequired<CodeGenContextWrapper>(); }
2927

0 commit comments

Comments
 (0)