SVF
|
Validate the result of concurrent analysis. More...
#include <MTAResultValidator.h>
Classes | |
class | AccessPair |
Public Types | |
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... | |
Protected Member Functions | |
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) |
Private Member Functions | |
const Instruction * | getPreviousMemoryAccessInst (const Instruction *I) |
Static Private Member Functions | |
static bool | compare (const CallInst *CI1, const CallInst *CI2) |
Private Attributes | |
SVFModule * | M |
std::vector< AccessPair > | accessPairs |
RC_FLAG | selectedValidationScenarios |
Static Private Attributes | |
static constexpr char const * | RC_ACCESS = "RC_ACCESS" |
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 |
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 159 of file MTAResultValidator.h.
typedef int RaceResultValidator::RC_FLAG |
Definition at line 162 of file MTAResultValidator.h.
|
inlinevirtual |
|
inline |
Analysis.
Definition at line 214 of file MTAResultValidator.h.
|
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 265 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 375 of file MTAResultValidator.h.
|
inlineprotected |
Get the validation result string of a single validation scenario.
Definition at line 350 of file MTAResultValidator.h.
|
inlineprivate |
Get the previous LoadInst or StoreInst from Instruction "I" in the same BasicBlock. Return nullptr if none exists.
Definition at line 390 of file MTAResultValidator.h.
|
inline |
Check if the input program has validation target.
Definition at line 225 of file MTAResultValidator.h.
|
inline |
Initialization.
Definition at line 206 of file MTAResultValidator.h.
|
inlineprotectedvirtual |
Interface to the specific validation properties. Override one or more to implement your own analysis.
Definition at line 234 of file MTAResultValidator.h.
|
inlineprotectedvirtual |
Definition at line 240 of file MTAResultValidator.h.
|
inlineprotectedvirtual |
Definition at line 252 of file MTAResultValidator.h.
|
inlineprotectedvirtual |
Definition at line 246 of file MTAResultValidator.h.
|
inline |
|
inlineprotected |
Perform validation for all targets.
Definition at line 302 of file MTAResultValidator.h.
|
private |
Definition at line 368 of file MTAResultValidator.h.
|
private |
Definition at line 367 of file MTAResultValidator.h.
|
staticprivate |
The name of the function which is used to specify the ground truth of the validation properties in the target program.
Definition at line 419 of file MTAResultValidator.h.
|
staticprivate |
Definition at line 412 of file MTAResultValidator.h.
|
staticprivate |
Constant RC_FLAG values.
Definition at line 411 of file MTAResultValidator.h.
|
staticprivate |
Definition at line 413 of file MTAResultValidator.h.
|
staticprivate |
Definition at line 414 of file MTAResultValidator.h.
|
private |
Definition at line 369 of file MTAResultValidator.h.