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/SymbolicExprGraphBuilder.h"
21 class SEGTrace :
public Trace<const SEGObject *> {
28 virtual TraceKind getKind()
const {
return TK_ValueFlow; }
31 typedef uint64_t StepType;
32 const static StepType STY_VALUE = 0x1;
33 const static StepType STY_USE_SITE = 0x2;
35 const StepType DEFAULT_STEP_TYPE = STY_VALUE | STY_USE_SITE;
42 kvec<SEGRegionNode *> AdditionalConds;
54 int guessLEVFSrcIdx(
bool IsConsiderLoad)
const;
61 SEGTrace(
const kvec<const SEGObject *> &Trace);
74 virtual void resetWithLLVMValueTrace(
const LLVMValueTrace *ValueTrace,
83 virtual int getValidStartIdx()
const;
88 virtual int getKeyIdx()
const;
112 virtual int getLEVFSrcIdx(
bool isConsiderLoad =
false)
const;
115 StepType getStepType(
int StepIdx)
const;
118 void setStepType(
int StepIdx, StepType STy);
121 int getNumAdditionalConds()
const;
131 void clearAdditionalCond();
136 template <
typename Predicate>
137 std::pair<const SEGObject *, int>
find(
int StartIndex, Predicate P)
const {
138 for (
int I = StartIndex, E = get_length(); I < E; ++I) {
141 return std::move(std::make_pair(O, I));
145 return std::move(std::make_pair(
nullptr, get_length()));
148 virtual void print(raw_ostream &O);