Skip to content

Commit

Permalink
[SYCL][ESIMD][NFCI] Fix coverity issues in use of demangler (#15731)
Browse files Browse the repository at this point in the history
Need to follow rule of three since there is a user defined destructor,
the copy constructor is called never hit at runtime, the copy assignment
constructor is never called.

Signed-off-by: Sarnie, Nick <[email protected]>
  • Loading branch information
sarnex authored Oct 18, 2024
1 parent 8e2a3ad commit e911717
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions llvm/include/llvm/SYCLLowerIR/ESIMD/ESIMDUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ Type *getVectorTyOrNull(StructType *STy);
class SimpleAllocator {
protected:
SmallVector<void *, 128> Ptrs;
SimpleAllocator &operator=(const SimpleAllocator &) = delete;

public:
void reset() {
Expand All @@ -84,6 +85,10 @@ class SimpleAllocator {
return Ptr;
}

SimpleAllocator() = default;
SimpleAllocator(const SimpleAllocator &) : SimpleAllocator() {
assert(false && "Unreachable");
}
~SimpleAllocator() { reset(); }
};

Expand Down

0 comments on commit e911717

Please sign in to comment.