Skip to content

Commit

Permalink
Thread safety analysis: Don't erase TIL_Opcode type (NFC)
Browse files Browse the repository at this point in the history
This is mainly for debugging, but it also eliminates some casts.
  • Loading branch information
aaronpuchert committed Jul 14, 2022
1 parent bfe63ab commit e0c66c6
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions clang/include/clang/Analysis/Analyses/ThreadSafetyTIL.h
Expand Up @@ -75,7 +75,7 @@ namespace til {
class BasicBlock;

/// Enum for the different distinct classes of SExpr
enum TIL_Opcode {
enum TIL_Opcode : unsigned char {
#define TIL_OPCODE_DEF(X) COP_##X,
#include "ThreadSafetyOps.def"
#undef TIL_OPCODE_DEF
Expand Down Expand Up @@ -278,7 +278,7 @@ class SExpr {
public:
SExpr() = delete;

TIL_Opcode opcode() const { return static_cast<TIL_Opcode>(Opcode); }
TIL_Opcode opcode() const { return Opcode; }

// Subclasses of SExpr must define the following:
//
Expand Down Expand Up @@ -321,7 +321,7 @@ class SExpr {
SExpr(TIL_Opcode Op) : Opcode(Op) {}
SExpr(const SExpr &E) : Opcode(E.Opcode), Flags(E.Flags) {}

const unsigned char Opcode;
const TIL_Opcode Opcode;
unsigned char Reserved = 0;
unsigned short Flags = 0;
unsigned SExprID = 0;
Expand All @@ -332,7 +332,7 @@ class SExpr {
namespace ThreadSafetyTIL {

inline bool isTrivial(const SExpr *E) {
unsigned Op = E->opcode();
TIL_Opcode Op = E->opcode();
return Op == COP_Variable || Op == COP_Literal || Op == COP_LiteralPtr;
}

Expand Down

0 comments on commit e0c66c6

Please sign in to comment.