8 #ifndef MTARESULTVALIDATOR_H_
9 #define MTARESULTVALIDATOR_H_
52 std::vector<std::string> &
split(
const std::string &s,
char delim, std::vector<std::string> &elems);
282 bool analysisRes,
bool expectedRes)
290 if (analysisRes == expectedRes)
308 const Value *V1 = CI1->getArgOperand(0);
309 const Value *V2 = CI2->getArgOperand(0);
310 const ConstantInt* C1 = SVFUtil::dyn_cast<ConstantInt>(V1);
311 const ConstantInt* C2 = SVFUtil::dyn_cast<ConstantInt>(V2);
312 assert(0 != C1 && 0 != C2);
313 return C1->getZExtValue() < C2->getZExtValue();
TCT * getTCT() const
Get Thread Creation Tree.
ThreadCallGraph * getThreadCallGraph() const
Get ThreadCallGraph.
Map< const SVFInstruction *, CxtThreadStmtSet > InstToThreadStmtSetMap
Map< CxtThreadStmt, NodeBS > ThreadStmtToThreadInterleav
static const INTERLEV_FLAG INTERLEV_UNSOUND
static constexpr char const * INTERLEV_ACCESS
Map< NodeID, CallStrCxt > vthdToCxtMap
std::vector< std::string > getStringArg(const Instruction *inst, unsigned int arg_num)
void dumpInterlev(NodeBS &lev)
bool collectCallsiteTargets()
INTERLEV_FLAG validateInterleaving()
bool collectInterleavingTargets()
bool collectCxtThreadTargets()
Map< NodeID, const SVFInstruction * > csnumToInst
rthdToChildrenMap rthdToChildren
static const INTERLEV_FLAG INTERLEV_TRUE
Constant INTERLEV_FLAG values.
bool matchCxt(const CallStrCxt cxt1, const CallStrCxt cxt2) const
std::vector< std::string > & split(const std::string &s, char delim, std::vector< std::string > &elems)
Map< NodeID, Set< NodeID > > rthdToChildrenMap
Map< NodeID, NodeID > vthdTorthdMap
static const INTERLEV_FLAG INTERLEV_IMPRECISE
MHP::InstToThreadStmtSetMap instToTSMap
std::string getOutput(const char *scenario, bool analysisRes)
static constexpr char const * CXT_THREAD
Map a statement to its thread interleavings.
Map< NodeID, NodeID > rthdTovthdMap
const Instruction * getPreviousMemoryAccessInst(const Instruction *I)
std::string getOutputforInterlevAnalysis(const char *scenario, INTERLEV_FLAG analysisRes)
MHP::ThreadStmtToThreadInterleav threadStmtToInterLeaving
NodeID getIntArg(const Instruction *inst, unsigned int arg_num)
static constexpr char const * TCT_ACCESS
csnumToInst csnumToInstMap
void dumpCxt(const CallStrCxt &cxt) const
SVFModule * getModule() const
MTAResultValidator(MHP *mh)
CallStrCxt getCxtArg(const Instruction *inst, unsigned int arg_num)
bool isFlaged(const RC_FLAG flag) const
Class member access.
AccessPair(const Instruction *I1, const Instruction *I2, const RC_FLAG flags)
Constructor.
const Instruction * getInstruction1() const
const Instruction * getInstruction2() const
Validate the result of concurrent analysis.
static const RC_FLAG RC_ALIASES
RC_FLAG selectedValidationScenarios
virtual bool mayHaveDataRace(const Instruction *I1, const Instruction *I2)
static bool compare(const CallBase *CI1, const CallBase *CI2)
void collectValidationTargets()
void validateAll()
Perform validation for all targets.
void release()
Release resource.
bool hasValidationTarget() const
Check if the input program has validation target.
const Instruction * getPreviousMemoryAccessInst(const Instruction *I)
virtual ~RaceResultValidator()
Destructor.
std::vector< AccessPair > accessPairs
static const RC_FLAG RC_MHP
Constant RC_FLAG values.
static const RC_FLAG RC_RACE
static const RC_FLAG RC_PROTECTED
static constexpr char const * RC_ACCESS
virtual bool mayAccessAliases(const Instruction *I1, const Instruction *I2)
virtual bool protectedByCommonLocks(const Instruction *I1, const Instruction *I2)
void init(SVFModule *M)
Initialization.
std::string getOutput(const char *scenario, bool analysisRes, bool expectedRes)
Get the validation result string of a single validation scenario.
virtual bool mayHappenInParallel(const Instruction *I1, const Instruction *I2)
SVFModule * getSVFModule() const
Get SVFFModule.
ThreadAPI * getThreadAPI() const
Thread API.
std::string sucMsg(const std::string &msg)
Returns successful message by converting a string into green string output.
std::string errMsg(const std::string &msg)
Print error message by converting a string into red string output.
llvm::Instruction Instruction
std::unordered_map< Key, Value, Hash, KeyEqual, Allocator > Map
llvm::Value Value
LLVM Basic classes.
std::vector< u32_t > CallStrCxt
llvm::ConstantInt ConstantInt