Skip to content

Commit

Permalink
Fix warning about delete not matching new
Browse files Browse the repository at this point in the history
Signed-off-by: Chris Dodd <[email protected]>
  • Loading branch information
ChrisDodd committed Oct 31, 2024
1 parent e795b84 commit 23d4fcd
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions backends/p4tools/p4tools.def
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ class Extracted_Varbits : Type_Bits {
public:
#emit
void *operator new(size_t size) { return ::operator new(size); }
void operator delete(void *p, size_t size) { return ::operator delete(p, size); }
#end
/// The assigned size of this varbit (assigned by extract calls).
int assignedSize;
Expand Down
10 changes: 10 additions & 0 deletions ir/type.def
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ class Type_Any : Type, ITypeVar {
protected:
#emit
void *operator new(size_t size) { return ::operator new(size); }
void operator delete(void *p, size_t size) { return ::operator delete(p, size); }
#end
static long nextId;
public:
Expand Down Expand Up @@ -130,6 +131,7 @@ class Type_Boolean : Type_Base {
protected:
#emit
void *operator new(size_t size) { return ::operator new(size); }
void operator delete(void *p, size_t size) { return ::operator delete(p, size); }
#end
public:
static Type_Boolean get();
Expand All @@ -144,6 +146,7 @@ class Type_State : Type_Base {
protected:
#emit
void *operator new(size_t size) { return ::operator new(size); }
void operator delete(void *p, size_t size) { return ::operator delete(p, size); }
#end
public:
static Type_State get();
Expand All @@ -157,6 +160,7 @@ class Type_Bits : Type_Base {
protected:
#emit
void *operator new(size_t size) { return ::operator new(size); }
void operator delete(void *p, size_t size) { return ::operator delete(p, size); }
#end
public:
optional int size = 0; // zero (only) for not-yet evaluated const expression
Expand All @@ -176,6 +180,7 @@ class Type_Varbits : Type_Base {
protected:
#emit
void *operator new(size_t size) { return ::operator new(size); }
void operator delete(void *p, size_t size) { return ::operator delete(p, size); }
#end
public:
optional int size = 0; // if zero it means "unknown"
Expand Down Expand Up @@ -251,6 +256,7 @@ class Type_InfInt : Type, ITypeVar {
protected:
#emit
void *operator new(size_t size) { return ::operator new(size); }
void operator delete(void *p, size_t size) { return ::operator delete(p, size); }
#end
long declid = nextId++;
private:
Expand All @@ -275,6 +281,7 @@ class Type_Dontcare : Type_Base {
protected:
#emit
void *operator new(size_t size) { return ::operator new(size); }
void operator delete(void *p, size_t size) { return ::operator delete(p, size); }
#end
public:
toString{ return "_"_cs; }
Expand All @@ -287,6 +294,7 @@ class Type_Void : Type_Base {
protected:
#emit
void *operator new(size_t size) { return ::operator new(size); }
void operator delete(void *p, size_t size) { return ::operator delete(p, size); }
#end
public:
toString{ return "void"_cs; }
Expand All @@ -299,6 +307,7 @@ class Type_MatchKind : Type_Base {
protected:
#emit
void *operator new(size_t size) { return ::operator new(size); }
void operator delete(void *p, size_t size) { return ::operator delete(p, size); }
#end
public:
toString{ return "match_kind"_cs; }
Expand Down Expand Up @@ -636,6 +645,7 @@ class Type_String : Type_Base {
protected:
#emit
void *operator new(size_t size) { return ::operator new(size); }
void operator delete(void *p, size_t size) { return ::operator delete(p, size); }
#end
public:
static Type_String get();
Expand Down

0 comments on commit 23d4fcd

Please sign in to comment.