Static Value-Flow Analysis
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
SVF::GrammarBase::Symbol Struct Reference

#include <CFGrammar.h>

Public Member Functions

 Symbol ()
 Default Value for Symbol is 0.
 
 Symbol (const u32_t &num)
 Construct from u32_t move the bit to right field.
 
 operator u32_t ()
 Conversion of u32_t.
 
 operator u32_t () const
 
bool operator< (const Symbol &rhs)
 
void operator= (const u32_t &i)
 
void operator= (unsigned long long num)
 
bool operator== (const Symbol &s)
 
bool operator== (const Symbol &s) const
 
bool operator!= (const Symbol &s) const
 
bool operator== (const u32_t &i)
 
bool operator== (const Kind &k) const
 

Public Attributes

Kind kind: 8
 
Attribute attribute: 16
 
VariableAttribute variableAttribute: 8
 

Detailed Description

Definition at line 42 of file CFGrammar.h.

Constructor & Destructor Documentation

◆ Symbol() [1/2]

SVF::GrammarBase::Symbol::Symbol ( )
inline

Default Value for Symbol is 0.

Definition at line 49 of file CFGrammar.h.

49: kind(0), attribute(0), variableAttribute(0) {}
VariableAttribute variableAttribute
Definition CFGrammar.h:46

◆ Symbol() [2/2]

SVF::GrammarBase::Symbol::Symbol ( const u32_t num)
inline

Construct from u32_t move the bit to right field.

Definition at line 52 of file CFGrammar.h.

52: kind(num & 0xFF), attribute((num >> 8 ) & 0xFFFF), variableAttribute((num >> 24)) {}
llvm::IRBuilder IRBuilder
Definition BasicTypes.h:74

Member Function Documentation

◆ operator u32_t() [1/2]

SVF::GrammarBase::Symbol::operator u32_t ( )
inline

Conversion of u32_t.

Definition at line 55 of file CFGrammar.h.

56 {
57 static_assert(sizeof(struct Symbol)==sizeof(u32_t), "sizeof(struct Symbol)!=sizeof(u32_t)");
58 u32_t num = 0;
59 num += this->variableAttribute << 24;
60 num += this->attribute << 8;
61 num += this->kind;
62 return num;
63 }
unsigned u32_t
Definition CommandLine.h:18
unsigned u32_t
Definition GeneralType.h:46
Symbol()
Default Value for Symbol is 0.
Definition CFGrammar.h:49

◆ operator u32_t() [2/2]

SVF::GrammarBase::Symbol::operator u32_t ( ) const
inline

Definition at line 65 of file CFGrammar.h.

66 {
67 static_assert(sizeof(struct Symbol)==sizeof(u32_t), "sizeof(struct Symbol)!=sizeof(u32_t)");
68 u32_t num = 0;
69 num += this->variableAttribute << 24;
70 num += this->attribute << 8;
71 num += this->kind;
72 return num;
73 }

◆ operator!=()

bool SVF::GrammarBase::Symbol::operator!= ( const Symbol s) const
inline

Definition at line 104 of file CFGrammar.h.

105 {
106 return ! (*this == s) ;
107 }

◆ operator<()

bool SVF::GrammarBase::Symbol::operator< ( const Symbol rhs)
inline

Definition at line 75 of file CFGrammar.h.

76 {
77 return u32_t(*this) < u32_t(rhs);
78 }

◆ operator=() [1/2]

void SVF::GrammarBase::Symbol::operator= ( const u32_t i)
inline

Definition at line 80 of file CFGrammar.h.

81 {
82 this->kind = EdgeKindMask & i;
83 this->attribute = i >> EdgeKindMaskBits;
85 }
static constexpr unsigned char AttributedKindMaskBits
We use the lower 24 bits to denote attributed kind.
Definition CFGrammar.h:277
static constexpr u64_t EdgeKindMask
Definition CFGrammar.h:278
static constexpr unsigned char EdgeKindMaskBits
We use the lower 8 bits to denote edge kind.
Definition CFGrammar.h:276

◆ operator=() [2/2]

void SVF::GrammarBase::Symbol::operator= ( unsigned long long  num)
inline

Definition at line 87 of file CFGrammar.h.

88 {
89 this->kind = num & 0xFF;
90 this->attribute = (num >> 8 ) & 0xFFFF;
91 this->variableAttribute = num >> 24;
92 }

◆ operator==() [1/4]

bool SVF::GrammarBase::Symbol::operator== ( const Kind k) const
inline

Definition at line 114 of file CFGrammar.h.

115 {
116 return (this->kind == k);
117 }

◆ operator==() [2/4]

bool SVF::GrammarBase::Symbol::operator== ( const Symbol s)
inline

Definition at line 94 of file CFGrammar.h.

95 {
96 return ((this->kind == s.kind) && (this->attribute == s.attribute) && (this->variableAttribute == s.variableAttribute));
97 }

◆ operator==() [3/4]

bool SVF::GrammarBase::Symbol::operator== ( const Symbol s) const
inline

Definition at line 99 of file CFGrammar.h.

100 {
101 return ((kind == s.kind) && (attribute == s.attribute) && (variableAttribute == s.variableAttribute));
102 }

◆ operator==() [4/4]

bool SVF::GrammarBase::Symbol::operator== ( const u32_t i)
inline

Definition at line 109 of file CFGrammar.h.

110 {
111 return u32_t(*this) == u32_t(i);
112 }

Member Data Documentation

◆ attribute

Attribute SVF::GrammarBase::Symbol::attribute

Definition at line 45 of file CFGrammar.h.

◆ kind

Kind SVF::GrammarBase::Symbol::kind

Definition at line 44 of file CFGrammar.h.

◆ variableAttribute

VariableAttribute SVF::GrammarBase::Symbol::variableAttribute

Definition at line 46 of file CFGrammar.h.


The documentation for this struct was generated from the following file: