[analyzer] Introduce minor refactoring of SVal::getSubKind function

Summary: `BaseMask` occupies the lowest bits. Effect of applying the mask is neutralized by right shift operation, thus making it useless.

Fix: Remove a redundant bitwise operation.

Differential Revision: https://reviews.llvm.org/D85026
This commit is contained in:
Denys Petrov 2020-07-31 15:54:46 +03:00
parent 86e1b73507
commit 21fa82d5c6
1 changed files with 2 additions and 2 deletions

View File

@ -80,7 +80,7 @@ public:
#define ABSTRACT_SVAL_WITH_KIND(Id, Parent) Id ## Kind,
#include "clang/StaticAnalyzer/Core/PathSensitive/SVals.def"
};
enum { BaseBits = 2, BaseMask = 0x3 };
enum { BaseBits = 2, BaseMask = 0b11 };
protected:
const void *Data = nullptr;
@ -116,7 +116,7 @@ public:
unsigned getRawKind() const { return Kind; }
BaseKind getBaseKind() const { return (BaseKind) (Kind & BaseMask); }
unsigned getSubKind() const { return (Kind & ~BaseMask) >> BaseBits; }
unsigned getSubKind() const { return Kind >> BaseBits; }
// This method is required for using SVal in a FoldingSetNode. It
// extracts a unique signature for this SVal object.