Static Value-Flow Analysis
|
Validate the result of concurrent analysis. More...
#include <MTAResultValidator.h>
Classes | |
class | AccessPair |
Public Types | |
typedef int | RC_FLAG |
typedef int | RC_FLAG |
Public Member Functions | |
virtual | ~RaceResultValidator () |
Destructor. More... | |
void | init (SVFModule *M) |
Initialization. More... | |
void | analyze () |
Analysis. More... | |
void | release () |
Release resource. More... | |
bool | hasValidationTarget () const |
Check if the input program has validation target. More... | |
virtual | ~RaceResultValidator () |
Destructor. More... | |
void | init (SVFModule *M) |
Initialization. More... | |
void | analyze () |
Analysis. More... | |
void | release () |
Release resource. More... | |
bool | hasValidationTarget () const |
Check if the input program has validation target. More... | |
Protected Member Functions | |
virtual bool | mayAccessAliases (const Instruction *I1, const Instruction *I2) |
virtual bool | mayHappenInParallel (const Instruction *I1, const Instruction *I2) |
virtual bool | protectedByCommonLocks (const Instruction *I1, const Instruction *I2) |
virtual bool | mayHaveDataRace (const Instruction *I1, const Instruction *I2) |
void | collectValidationTargets () |
void | validateAll () |
Perform validation for all targets. More... | |
std::string | getOutput (const char *scenario, bool analysisRes, bool expectedRes) |
Get the validation result string of a single validation scenario. More... | |
virtual bool | mayAccessAliases (const Instruction *I1, const Instruction *I2) |
virtual bool | mayHappenInParallel (const Instruction *I1, const Instruction *I2) |
virtual bool | protectedByCommonLocks (const Instruction *I1, const Instruction *I2) |
virtual bool | mayHaveDataRace (const Instruction *I1, const Instruction *I2) |
void | collectValidationTargets () |
void | validateAll () |
Perform validation for all targets. More... | |
std::string | getOutput (const char *scenario, bool analysisRes, bool expectedRes) |
Get the validation result string of a single validation scenario. More... | |
Private Member Functions | |
const Instruction * | getPreviousMemoryAccessInst (const Instruction *I) |
const Instruction * | getPreviousMemoryAccessInst (const Instruction *I) |
Static Private Member Functions | |
static bool | compare (const CallBase *CI1, const CallBase *CI2) |
static bool | compare (const CallBase *CI1, const CallBase *CI2) |
Private Attributes | |
SVFModule * | M |
std::vector< AccessPair > | accessPairs |
RC_FLAG | selectedValidationScenarios |
Static Private Attributes | |
static const RC_FLAG | RC_MHP = 0x01 |
Constant RC_FLAG values. More... | |
static const RC_FLAG | RC_ALIASES = 0x02 |
static const RC_FLAG | RC_PROTECTED = 0x04 |
static const RC_FLAG | RC_RACE = 0x10 |
static constexpr char const * | RC_ACCESS = "RC_ACCESS" |
Validate the result of concurrent analysis.
The properties to validate of two memory accesses include one or more of the following four: (1) they may accesses aliases; (2) they may happen in parallel; (3) they are protected by common lock(s); (4) they may cause a data race error. The ground truth are specified by the "RC_ACCESS" function in the target program.
Users may utilize this result validator to validate their analysis with one or more of the four properties, by inheriting the RCResultValidator class. The corresponding virtual function of the desired property should be overridden.
Definition at line 169 of file MTAResultValidator.h.
typedef int SVF::RaceResultValidator::RC_FLAG |
Definition at line 172 of file MTAResultValidator.h.
typedef int SVF::RaceResultValidator::RC_FLAG |
Definition at line 171 of file MTAResultValidator.h.
|
inlinevirtual |
Destructor.
Definition at line 210 of file MTAResultValidator.h.
|
inlinevirtual |
|
inline |
Analysis.
Definition at line 224 of file MTAResultValidator.h.
|
inline |
|
protected |
Collect the targets for validations. The targets should be memory access Instructions in pairs. The collected targets are stored in the member variable "accessPairs".
Definition at line 600 of file MTAResultValidator.cpp.
|
inlineprotected |
Collect the targets for validations. The targets should be memory access Instructions in pairs. The collected targets are stored in the member variable "accessPairs".
Definition at line 274 of file MTAResultValidator.h.
|
inlinestaticprivate |
Comparison function to sort the validation targets in ascending order of the validation id (i.e., the 1st argument of RC_ACCESS function call).
Definition at line 306 of file MTAResultValidator.h.
|
inlinestaticprivate |
Comparison function to sort the validation targets in ascending order of the validation id (i.e., the 1st argument of RC_ACCESS function call).
Definition at line 398 of file MTAResultValidator.h.
|
inlineprotected |
Get the validation result string of a single validation scenario.
Definition at line 281 of file MTAResultValidator.h.
|
inlineprotected |
Get the validation result string of a single validation scenario.
Definition at line 373 of file MTAResultValidator.h.
|
private |
Get the previous LoadInst or StoreInst from Instruction "I" in the same BasicBlock. Return nullptr if none exists.
Definition at line 697 of file MTAResultValidator.cpp.
|
inlineprivate |
Get the previous LoadInst or StoreInst from Instruction "I" in the same BasicBlock. Return nullptr if none exists.
Definition at line 413 of file MTAResultValidator.h.
|
inline |
Check if the input program has validation target.
Definition at line 235 of file MTAResultValidator.h.
|
inline |
Check if the input program has validation target.
Definition at line 234 of file MTAResultValidator.h.
|
inline |
Initialization.
Definition at line 216 of file MTAResultValidator.h.
|
inline |
|
inlineprotectedvirtual |
Interface to the specific validation properties. Override one or more to implement your own analysis.
Definition at line 244 of file MTAResultValidator.h.
|
inlineprotectedvirtual |
Interface to the specific validation properties. Override one or more to implement your own analysis.
Definition at line 243 of file MTAResultValidator.h.
|
inlineprotectedvirtual |
Reimplemented in SVF::MHPValidator.
Definition at line 250 of file MTAResultValidator.h.
|
inlineprotectedvirtual |
Reimplemented in SVF::MHPValidator.
Definition at line 249 of file MTAResultValidator.h.
|
inlineprotectedvirtual |
Definition at line 262 of file MTAResultValidator.h.
|
inlineprotectedvirtual |
Definition at line 261 of file MTAResultValidator.h.
|
inlineprotectedvirtual |
Reimplemented in SVF::RaceValidator.
Definition at line 256 of file MTAResultValidator.h.
|
inlineprotectedvirtual |
Reimplemented in SVF::RaceValidator.
Definition at line 255 of file MTAResultValidator.h.
|
inline |
|
inline |
|
protected |
Perform validation for all targets.
Definition at line 650 of file MTAResultValidator.cpp.
|
inlineprotected |
|
private |
Definition at line 299 of file MTAResultValidator.h.
|
private |
Definition at line 298 of file MTAResultValidator.h.
|
staticconstexprprivate |
The name of the function which is used to specify the ground truth of the validation properties in the target program.
Definition at line 334 of file MTAResultValidator.h.
|
staticprivate |
Definition at line 327 of file MTAResultValidator.h.
|
staticprivate |
Constant RC_FLAG values.
Definition at line 326 of file MTAResultValidator.h.
|
staticprivate |
Definition at line 328 of file MTAResultValidator.h.
|
staticprivate |
Definition at line 329 of file MTAResultValidator.h.
|
private |
Definition at line 300 of file MTAResultValidator.h.