8 #ifndef INCLUDE_IR_SEG_SEGTRACE_H_
9 #define INCLUDE_IR_SEG_SEGTRACE_H_
11 #include "rapidjson/document.h"
13 #include "IR/LLVMValueTrace.h"
14 #include "IR/SEG/SEGMapBase.h"
21 class SEGTrace :
public Trace<const SEGObject *> {
23 typedef uint64_t StepType;
24 const static StepType STY_VALUE = 0x1;
25 const static StepType STY_USE_SITE = 0x2;
27 const StepType DEFAULT_STEP_TYPE = STY_VALUE | STY_USE_SITE;
34 kvec<SEGRegionNode *> AdditionalConds;
46 int guessLEVFSrcIdx(
bool IsConsiderLoad)
const;
53 SEGTrace(
const kvec<const SEGObject *> &Trace);
66 virtual void resetWithLLVMValueTrace(
const LLVMValueTrace *ValueTrace,
75 virtual int getValidStartIdx()
const;
80 virtual int getKeyIdx()
const;
104 virtual int getLEVFSrcIdx(
bool isConsiderLoad =
false)
const;
107 StepType getStepType(
int StepIdx)
const;
110 void setStepType(
int StepIdx, StepType STy);
113 int getNumAdditionalConds()
const;
123 void clearAdditionalCond();
128 template <
typename Predicate>
129 std::pair<const SEGObject *, int>
find(
int StartIndex, Predicate P)
const {
130 for (
int I = StartIndex, E = get_length(); I < E; ++I) {
133 return std::move(std::make_pair(O, I));
137 return std::move(std::make_pair(
nullptr, get_length()));
140 virtual void print(raw_ostream &O)
override;
142 virtual rapidjson::Value
143 makeJSON(rapidjson::Document::AllocatorType &allocator)
const;