ClearBlue
cb-extract.h
1 /*
2  * cb-extract.h
3  *
4  * Created on: Nov 29, 2016
5  * Author: Fan Gang <[email protected]>
6  *
7  *
8  * The main part of this file is copied from file DebugInfoAnalysis.cpp, please
9  * keep sync when it is changing.
10  */
11 
12 #ifndef TOOLS_PP_EXTRACT_PP_EXTRACT_H_
13 #define TOOLS_PP_EXTRACT_PP_EXTRACT_H_
14 
15 #include "Utils/ADT/kvec.h"
16 #include "Utils/ADT/kvec_ext.h"
17 #include "Utils/StringUtils.h"
18 #include <llvm/IR/DebugInfo.h>
19 #include <llvm/Support/Allocator.h>
20 #include <unordered_map>
21 
22 using namespace llvm;
23 
24 // Use a memory allocator to manage the char array allocated on heap
25 // The memory will be automatically released
26 BumpPtrAllocator string_allocator;
27 // Reconstruct the path of the source code files in a simpler form
28 template <int initN>
29 StringRef synthesize_file_path(StringRef File, StringRef Dir,
30  kvec_str<initN> &path_result) {
31  path_result.clear();
32 
33  StringRef path_have_root_name;
34 
35  if (!sys::path::is_absolute(File)) {
36  // When the file name is not an absolute path,
37  // we should concatenate the dir and file name to obtain the full path
38  path_result.fill(Dir.data(), Dir.size());
39  path_have_root_name = Dir;
40  } else {
41  path_have_root_name = File;
42  }
43 
44  // It could be that current system is Linux but the input bitcode is generated
45  // on windows or vice versa.
46  char input_bc_path_sep = '/';
47  if (path_have_root_name.size() >= 3 && (path_have_root_name[1] == ':') &&
48  (path_have_root_name[2] == '\\')) {
49  input_bc_path_sep = '\\';
50  }
51 
52  bool first_comp = true;
53  for (sys::path::const_iterator it = sys::path::begin(File),
54  ie = sys::path::end(File);
55  it != ie; ++it, first_comp = false) {
56  StringRef component = *it;
57 
58  if (component == "..") {
59  int pos = path_result.rfind(input_bc_path_sep);
60  if (pos > 0) {
61  path_result.erase_substr(pos);
62  } else {
63  // If current path is already at root, .. has no effect
64  }
65  } else if (component != ".") {
66  // Append component to the path, including the root symbol /
67 
68  if (first_comp) {
69  // The first component is either a root name (e.g. //net) or a root
70  // directory (e.g. /) The root name has special meaning on Windows, we
71  // should keep it intact
72 
73  if (component == sys::path::root_name(File)) {
74  // On Unix system, a path starts with "//net" can be erroneously
75  // determined as a root name by sys::path::root_name. However, "//net"
76  // is actually writing the root symbol "//" twice and it is equal to
77  // "/net". Therefore, we handle the wrong root name determination
78  // here.
79 
80  size_t last_bslash = component.rfind("/");
81  if (last_bslash != StringRef::npos) {
82  component = component.substr(last_bslash);
83  } else {
84  // This is perhaps a real root name.
85  // It is either the windows driver letter (e.g. C:)
86  // or the "server_host" in the remote path "server_host:/home/xx"
87  // defined by file URI scheme specification. We just keep the
88  // component unchanged.
89  }
90  }
91  }
92 
93  // Add a backslash if the component does not start with a separator and
94  // the synthesized path is not ended with a separator
95  if (!component.startswith(StringRef(&input_bc_path_sep, 1)) &&
96  (path_result.empty() || path_result.back() != input_bc_path_sep))
97  path_result.push_back(input_bc_path_sep);
98 
99  // Add the component
100  path_result.append_str(component.data(), component.size());
101  }
102  }
103 
104  // First look up the global cache
105  // We do not set trailing zero for file name StringRef
106  StringRef file_name(path_result.c_str(), path_result.size());
107  file_name = hooked_format_str(string_allocator, "%s", path_result.c_str());
108  return file_name;
109 }
110 
111 std::unique_ptr<std::unordered_map<const Function *, StringRef>>
112 getFunctionSrcFiles(Module &M) {
113 
114  auto pFuncSrcFileCache =
115  std::unique_ptr<std::unordered_map<const Function *, StringRef>>(
116  new std::unordered_map<const Function *, StringRef>());
117 
118  // Scan the debug information placed at the end of module
119  DebugInfoFinder DbgFinder;
120  DbgFinder.processModule(M);
121  kvec_str<512> tmp_src_path;
122 
123  // Cache the function information
124  auto it_func_range = DbgFinder.subprograms();
125  for (auto it = it_func_range.begin(), ie = it_func_range.end(); it != ie;
126  ++it) {
127  const DISubprogram &f_loc = *it;
128 
129  Function *F = f_loc.getFunction();
130  StringRef File = f_loc.getFilename();
131  StringRef Dir = f_loc.getDirectory();
132  if (File.data() && Dir.data()) {
133  (*pFuncSrcFileCache)[F] = synthesize_file_path(File, Dir, tmp_src_path);
134  } else {
135  (*pFuncSrcFileCache)[F] = "";
136  }
137  }
138  return pFuncSrcFileCache;
139 }
140 
141 #endif /* TOOLS_PP_EXTRACT_PP_EXTRACT_H_ */
SymbolicExprGraph::findUnitRegion
SEGRegionNode * findUnitRegion(SEGNodeBase *cond_node, bool cond) const
Return nullptr if the node does not exist.
Definition: SymbolicExprGraph.cpp:1213
SEGStoreMemNode
Definition: SEGStoreMemNode.h:23
SailfishFunctionChecker::Sources
std::map< const SEGSiteBase *, std::set< const SEGOperandNode * > > Sources
Taint sources.
Definition: SailfishFunctionChecker.h:56
SymbolicExprGraphBuilder::getOrCreateSymbolicExprGraph
SymbolicExprGraph * getOrCreateSymbolicExprGraph(Function *F)
Definition: SymbolicExprGraphBuilder.cpp:1354
SymbolicExprGraph::dot
void dot(const char *FileName) const
Dot this graph to a file with filename.
Definition: SymbolicExprGraph.cpp:891
SEGVarArgumentNode
Definition: SEGArgumentNode.h:89
SailfishParamSummaryBuilder
Definition: SailfishParamSummaryBuilder.h:13
SEGPhiNode::IncomeNode
Definition: SEGPhiNode.h:33
SymbolicExprGraph::getBlockCond
const std::set< CDGCond > * getBlockCond(BasicBlock *BB) const
Definition: SymbolicExprGraph.h:1235
BotUpParallelPass
Definition: BotUpParallelPass.h:187
SEGOpcodeNode::CK_FUGE
@ CK_FUGE
1 0 1 1 True if unordered, greater than, or equal
Definition: SymbolicExprGraph.h:583
SEGOperandNode
Definition: SymbolicExprGraph.h:456
SailfishFunctionChecker::inlineCalleeSummaryEndWithReturn
void inlineCalleeSummaryEndWithReturn(const SEGCallSite *CS, TraceSummary *Smry, const SEGCallSiteOutputNode *CallSiteOutput, Vulnerability::ValueSitePairType Src, unsigned InlineDepth, int Case=0)
Definition: SailfishFunctionChecker.cpp:1221
OCValueFlowBuilder::buildSymbolicExprGraph
SymbolicExprGraph * buildSymbolicExprGraph(Function &F)
It undertakes real SEG construction job for the function F.
Definition: OCValueFlowBuilder.cpp:69
SEGPseudoArgumentNode
Definition: SEGArgumentNode.h:121
OCValueFlowBuilder::modelGEPOperator
SEGOpcodeNode * modelGEPOperator(GEPOperator *GEP, BasicBlock *B, SymbolicExprGraph *G)
Model GEP operator.
Definition: OCValueFlowBuilder.cpp:640
SEGOpcodeNode::CK_FOGE
@ CK_FOGE
0 0 1 1 True if ordered and greater than or equal
Definition: SymbolicExprGraph.h:575
DTSymbolicExprGraphSolver::getPhiGated
virtual SMTExprVec getPhiGated(const SEGPhiNode *PhiNode, const SEGPhiNode::IncomeNode InNode, void *Args=nullptr)
Definition: SymbolicExprGraphSolver.cpp:1187
SEGOpcodeNode::CK_ISGT
@ CK_ISGT
signed greater than
Definition: SymbolicExprGraph.h:596
Vulnerability::ValueSitePairType
std::pair< const SEGOperandNode *, const SEGSiteBase * > ValueSitePairType
Definition: Vulnerability.h:90
SEGOpcodeNode::CK_FOEq
@ CK_FOEq
0 0 0 1 True if ordered and equal
Definition: SymbolicExprGraph.h:573
SEGBinaryWithIntConstNode::dot
virtual void dot(raw_fd_ostream &O) const
Dot its self to the given output stream.
Definition: SEGBinaryWithIntConstNode.cpp:38
SEGCallSiteOutputNode
Definition: SEGCallSiteOutputNode.h:19
SEGSimpleOpcodeNode
Definition: SEGSimpleOpcodeNode.h:18
BotUpParallelPass::internallyDepends
virtual bool internallyDepends(unsigned TaskAID, unsigned TaskBID)=0
SEGCallSite
Definition: SEGCallSite.h:52
OCValueFlowBuilder::getOpcode
SEGOpcodeNode::CodeKind getOpcode(int LLVMInstOpcode, int Predicate=0)
Definition: OCValueFlowBuilder.cpp:500
SailfishSummary::RetValSummaryMap
std::map< const SEGReturnNode *, SymbolicSummary * > RetValSummaryMap
Recording the symbolic summary of each return node.
Definition: SummaryMapper.h:34
SEGOpcodeNode::CK_FOrd
@ CK_FOrd
0 1 1 1 True if ordered (no nans)
Definition: SymbolicExprGraph.h:579
SEGOperandNode::dot
void dot(raw_fd_ostream &O) const override
Dot its self to the given output stream.
Definition: SymbolicExprGraph.cpp:345
SEGOpcodeNode::CK_FONE
@ CK_FONE
0 1 1 0 True if ordered and operands are unequal
Definition: SymbolicExprGraph.h:578
DFSResult
Definition: SymbolicExprGraphBuilder.cpp:1379
SEGOpcodeNode::CodeKind
CodeKind
Definition: SymbolicExprGraph.h:522
SEGOpcodeNode::CK_FOLE
@ CK_FOLE
0 1 0 1 True if ordered and less than or equal
Definition: SymbolicExprGraph.h:577
SailfishStateBuilder
Definition: SailfishStateBuilder.h:12
SEGCallSiteArgumentSummaryNode
Definition: SEGCallSiteArgumentSummaryNode.h:17
SEGMapBase
Definition: SEGMapBase.h:20
SEGCastNode
Definition: SEGCastNode.h:18
SailfishFunctionChecker::search
void search(const SEGNodeBase *CurrentNode, const SEGNodeBase *PreviousNode, Vulnerability::ValueSitePairType Src, unsigned InlineDepth)
Definition: SailfishFunctionChecker.cpp:143
SEGCommonArgumentNode
Definition: SEGArgumentNode.h:42
SEGOpcodeNode::CK_FULT
@ CK_FULT
1 1 0 0 True if unordered or less than
Definition: SymbolicExprGraph.h:584
SymbolicExprGraphSolver::NodeSymbolNameMap
std::unordered_map< std::string, const SEGNodeBase * > NodeSymbolNameMap
map the symbol name used by Z3 in context ctx to the SEG node
Definition: SymbolicExprGraphSolver.h:54
SymbolicExprGraphSolver::getDataDeps
virtual SMTExprVec getDataDeps(const SEGNodeBase *N, void *Args=nullptr)
Model node n's data dependence.
Definition: SymbolicExprGraphSolver.cpp:144
SymbolicExprGraph
Definition: SymbolicExprGraph.h:707
SailfishFunctionChecker::processUseSite
void processUseSite(Vulnerability::ValueSitePairType Src, const SEGOperandNode *Node, const SEGSiteBase *UseSite, Vulnerability::SiteType USTy, unsigned InlineDepth)
It processes use sites according to the type of use sites.
Definition: SailfishFunctionChecker.cpp:605
SymbolicExprGraphSolver::encodeOpcodeNode
SMTExpr encodeOpcodeNode(const SEGOpcodeNode *N)
Definition: SymbolicExprGraphSolver.cpp:240
SEGOpcodeNode::CK_ISLE
@ CK_ISLE
signed less or equal
Definition: SymbolicExprGraph.h:599
SEGOpcodeNode::CK_IULT
@ CK_IULT
unsigned less than
Definition: SymbolicExprGraph.h:594
SEGCallSiteCommonOutputNode
Definition: SEGCallSiteOutputNode.h:50
SailfishFunctionChecker::inlineReturnSymbolicSummary
bool inlineReturnSymbolicSummary(const SEGCallSiteOutputNode *Symbol)
Definition: SailfishFunctionChecker.cpp:854
OCValueFlowBuilder::modelConstantExpr
SEGOperandNode * modelConstantExpr(ConstantExpr *CE, SymbolicExprGraph *SEG)
Model constant expr.
Definition: OCValueFlowBuilder.cpp:751
SailfishFunctionChecker::inlineCalleeSummaryStartWithParam
void inlineCalleeSummaryStartWithParam(const SEGCallSite *CS, TraceSummary *Smry, Vulnerability::ValueSitePairType Src, const SEGOperandNode *ActualNode, unsigned InlineDepth, int Case=0)
Definition: SailfishFunctionChecker.cpp:1117
SailfishSummary::SailfishSummaryMapper
SummaryMapper * SailfishSummaryMapper
Definition: SummaryMapper.h:38
SailfishFunctionChecker::Smry
SailfishSummary * Smry
the summary of this function
Definition: SailfishFunctionChecker.h:31
SEGOpcodeNode::CK_IULE
@ CK_IULE
unsigned less or equal
Definition: SymbolicExprGraph.h:595
SEGNodeBase::SEGNodeBase
SEGNodeBase(SEGObjectKind K, Type *Ty, SymbolicExprGraph *SEG, BasicBlock *BB, bool fromDisk)
Definition: SymbolicExprGraph.cpp:161
BotUpParallelPass::toCheck
bool toCheck(const Function *Func)
return true if the function should be in the dependence graph
Definition: BotUpParallelPass.h:238
SEGOperandNode::SEGOperandNode
SEGOperandNode(SEGObjectKind K, Type *Ty, SymbolicExprGraph *SEG, BasicBlock *BB, bool fromDisk)
A node whose value which will be set to null.
Definition: SymbolicExprGraph.cpp:223
Vulnerability::SiteType
SiteType
Definition: Vulnerability.h:58
SailfishSrcWpSummaryBuilder
Definition: SailfishSrcWpSummaryBuilder.h:13
SEGOpcodeNode::CK_IEq
@ CK_IEq
equal
Definition: SymbolicExprGraph.h:590
SEGArgumentNode
Definition: SEGArgumentNode.h:18
SailfishFunctionChecker::addCachedConstraintsToSummary
void addCachedConstraintsToSummary(SummaryBase *S)
Add the cached constraints to build summary.
Definition: SailfishFunctionChecker.cpp:129
SEGCallSiteReturnSummaryNode
Definition: SEGCallSiteReturnSummaryNode.h:20
SEGCmpSite
Definition: SEGSimpleSite.h:75
SEGDereferenceSite
Definition: SEGSimpleSite.h:32
SymbolicExprGraph::CDGCond
Definition: SymbolicExprGraph.h:726
SailfishFunctionChecker::TSV
std::shared_ptr< Vulnerability > TSV
The vulnerability instance.
Definition: SailfishFunctionChecker.h:53
SailfishSummary::ErSrcSummarySet
std::set< TraceSummary * > ErSrcSummarySet
Recording value-flow summaries starting from an error-specific source.
Definition: SummaryMapper.h:24
SymbolicExprGraphSolver::getCtrlDeps
SMTExprVec getCtrlDeps(const SEGNodeBase *N, void *Args=nullptr)
Get the condition of paths reaching node n.
Definition: SymbolicExprGraphSolver.cpp:84
SEGOpcodeNode::CK_IUGT
@ CK_IUGT
unsigned greater than
Definition: SymbolicExprGraph.h:592
SEGValue::getValue
Value * getValue()
Get Value.
Definition: SEGValue.h:66
SEGCommonReturnNode
Definition: SEGReturnNode.h:56
DTSymbolicExprGraphSolver::getCtrlDeps
virtual SMTExprVec getCtrlDeps(BasicBlock *B, const SymbolicExprGraph *G, void *Args=nullptr)
Definition: SymbolicExprGraphSolver.cpp:1176
SymbolicExprGraph::findNode
SEGOperandNode * findNode(Value *) const
Definition: SymbolicExprGraph.cpp:790
BotUpParallelPass::externallyDepends
virtual bool externallyDepends(unsigned CallerTaskID, unsigned CalleeTaskID)=0
SailfishErSrcSummaryBuilder
Definition: SailfishErSrcSummaryBuilder.h:13
DTSymbolicExprGraphSolver::getDeps
virtual SMTExprVec getDeps(const SEGNodeBase *N, const SEGNodeBase *M)
Definition: SymbolicExprGraphSolver.cpp:1445
SEGOpcodeNode::CK_FUno
@ CK_FUno
1 0 0 0 True if unordered: isnan(X) | isnan(Y)
Definition: SymbolicExprGraph.h:580
SymbolicExprGraphSolver::NodeExprMap
std::unordered_map< const SEGNodeBase *, SMTExpr > NodeExprMap
each node in seg is a z3 variable
Definition: SymbolicExprGraphSolver.h:51
SailfishChecker::internallyDepends
virtual bool internallyDepends(unsigned TaskAID, unsigned TaskBID) override
Definition: SailfishChecker.cpp:226
SymbolicExprGraphBuilder
Definition: SymbolicExprGraphBuilder.h:37
SailfishFunctionChecker::downstreamSearch
void downstreamSearch(const SEGNodeBase *CurrentNode, const SEGNodeBase *PreviousNode, Vulnerability::ValueSitePairType Src, unsigned InlineDepth)
Definition: SailfishFunctionChecker.cpp:323
SEGReturnSite
Definition: SEGReturnSite.h:18
SEGPhiNode::addIncomeValue
void addIncomeValue(SEGNodeBase *InValue, BasicBlock *BB, SEGNodeBase *condValue, bool Cond)
Add a incoming edge during construction.
Definition: SEGPhiNode.h:60
SEGOpcodeNode::CK_ISGE
@ CK_ISGE
signed greater or equal
Definition: SymbolicExprGraph.h:597
SEGObject
Definition: SymbolicExprGraph.h:76
SymbolicExprGraphSolver::getCtrlDepsPair
virtual std::pair< SMTExprVec, SMTExprVec > getCtrlDepsPair(BasicBlock *B, const SymbolicExprGraph *G, void *Args=nullptr)
Definition: SymbolicExprGraphSolver.h:79
SEGOpcodeNode::CK_IUGE
@ CK_IUGE
unsigned greater or equal
Definition: SymbolicExprGraph.h:593
SymbolicExprGraph::findOrRegion
SEGRegionNode * findOrRegion(SEGRegionNode *region1, SEGRegionNode *region2) const
Return nullptr if the node does not exist.
Definition: SymbolicExprGraph.cpp:1271
SEGCastNode::dot
virtual void dot(raw_fd_ostream &O) const
Dot its self to the given output stream.
Definition: SEGCastNode.cpp:36
SEGCallSitePseudoInputNode
Definition: SEGCallSitePseudoInputNode.h:29
OCValueFlowBuilder::findOrCreateNode
SEGOperandNode * findOrCreateNode(SymbolicExprGraph *SEG, Value *V)
Find or create a node in SEG.
Definition: OCValueFlowBuilder.cpp:915
SymbolicExprGraphBuilder::getNode
SEGOperandNode * getNode(Value *val)
Return the SEG node of a value.
Definition: SymbolicExprGraphBuilder.cpp:1490
SailfishChecker::externallyDepends
virtual bool externallyDepends(unsigned CallerTaskID, unsigned CalleeTaskID) override
Definition: SailfishChecker.cpp:234
Notifier
Definition: cb-check.cpp:344
SEGValue
Definition: SEGValue.h:38
SEGPhiNode
Definition: SEGPhiNode.h:28
SEGOpcodeNode::CK_FOGT
@ CK_FOGT
0 0 1 0 True if ordered and greater than
Definition: SymbolicExprGraph.h:574
SEGOpcodeNode::CK_FUEq
@ CK_FUEq
1 0 0 1 True if unordered or equal
Definition: SymbolicExprGraph.h:581
SailfishFunctionChecker::checkUseSite
int checkUseSite(const SEGOperandNode *Node, const SEGSiteBase *UseSite, std::unordered_map< const BasicBlock *, SMTSolver::SMTResultType > &, bool UpdateCache)
Definition: SailfishFunctionChecker.cpp:541
SEGRegionNode
Definition: SEGRegionNode.h:34
SEGNodeBase::getLLVMType
Type * getLLVMType() const
get the type size of the node
Definition: SymbolicExprGraph.h:284
SEGOpcodeNode::CK_ISLT
@ CK_ISLT
signed less than
Definition: SymbolicExprGraph.h:598
OCValueFlowBuilder::modelIntrinsics
void modelIntrinsics(CallSite CS, SymbolicExprGraph *G)
Model intrinsics CS in the SEG G of a function.
Definition: OCValueFlowBuilder.cpp:866
DTSymbolicExprGraphSolver::getDataDeps
virtual SMTExprVec getDataDeps(const SEGNodeBase *N, void *Args=nullptr)
Definition: SymbolicExprGraphSolver.cpp:1195
SailfishFunctionChecker::DT
const DomTree * DT
dom tree and post-dom tree
Definition: SailfishFunctionChecker.h:34
SEGSimpleOperandNode
Definition: SEGSimpleOperandNode.h:19
SEGOpcodeNode::CK_FULE
@ CK_FULE
1 1 0 1 True if unordered, less than, or equal
Definition: SymbolicExprGraph.h:585
SymbolicExprGraph::findAndRegion
SEGRegionNode * findAndRegion(SEGRegionNode *region1, SEGRegionNode *region2) const
Return nullptr if the node does not exist.
Definition: SymbolicExprGraph.cpp:1231
SailfishSummary::CSOutSummarySet
std::set< TraceSummary * > CSOutSummarySet
Recording value-flow summaries starting from a call-site output.
Definition: SummaryMapper.h:31
SailfishChecker::releaseMemory
virtual bool releaseMemory(Function &F) override
Definition: SailfishChecker.cpp:249
OCValueFlowBuilder::modelInstruction
void modelInstruction(Instruction &I, BasicBlock *B, SymbolicExprGraph *SEG)
Model instructions.
Definition: OCValueFlowBuilder.cpp:138
SailfishFunctionChecker::TimeChecker
Timer * TimeChecker
Definition: SailfishFunctionChecker.h:50
SEGOpcodeNode::CK_FUGT
@ CK_FUGT
1 0 1 0 True if unordered or greater than
Definition: SymbolicExprGraph.h:582
SEGCallSitePseudoOutputNode
Definition: SEGCallSiteOutputNode.h:76
SymbolicExprGraphSolver::getDepsPair
virtual std::pair< SMTExprVec, SMTExprVec > getDepsPair(const SEGNodeBase *N, const SEGNodeBase *M)
Definition: SymbolicExprGraphSolver.cpp:1080
SEGStoreMemNode::dot
void dot(raw_fd_ostream &O) const override
Dot its self to the given output stream.
Definition: SEGStoreMemNode.cpp:66
SEGOpcodeNode::CK_FTrue
@ CK_FTrue
1 1 1 1 Always true (always folded)
Definition: SymbolicExprGraph.h:587
SEGPhiNode::dot
void dot(raw_fd_ostream &O) const
Dot its self to the given output stream.
Definition: SEGPhiNode.cpp:37
SEGOpcodeNode::CK_FUNE
@ CK_FUNE
1 1 1 0 True if unordered or not equal
Definition: SymbolicExprGraph.h:586
SEGLoadMemNode::dot
void dot(raw_fd_ostream &O) const
Dot its self to the given output stream.
Definition: SEGLoadMemNode.cpp:48
SailfishChecker
Definition: SailfishChecker.h:42
SEGPseudoReturnNode
Definition: SEGReturnNode.h:76
SailfishCSOutSummaryBuilder
Definition: SailfishCSOutSummaryBuilder.h:13
SailfishFunctionChecker::matchFormalActual
void matchFormalActual(SummaryBase *Smry, const SEGCallSite *CS, std::unordered_map< std::string, SMTExpr > &)
Add constraints: "formal == actual".
Definition: SailfishFunctionChecker.cpp:788
SEGOpcodeNode
Definition: SymbolicExprGraph.h:519
SailfishFunctionChecker::StateBuilder
SailfishStateBuilder * StateBuilder
Definition: SailfishFunctionChecker.h:46
TaskDepVertex
Definition: BotUpParallelPass.h:21
SEGDivSite
Definition: SEGSimpleSite.h:90
SailfishFunctionChecker
Definition: SailfishFunctionChecker.h:22
SailfishFunctionChecker::SEG
const SymbolicExprGraph * SEG
the symbolic expr graph IR
Definition: SailfishFunctionChecker.h:37
SymbolicExprGraph::findSite
SiteTy * findSite(Instruction *I) const
Definition: SymbolicExprGraph.h:1176
SymbolicExprGraph::validate
void validate()
validate this is a DAG
Definition: SymbolicExprGraph.cpp:1015
ParallelThreadLocal
Definition: SailfishChecker.h:37
SEGSiteBase
Definition: SymbolicExprGraph.h:663
SEGReturnNode
The return node.
Definition: SEGReturnNode.h:25
SEGGEPSite
Definition: SEGSimpleSite.h:103
SailfishFunctionChecker::F
Function * F
current function
Definition: SailfishFunctionChecker.h:28
SailfishSummary::SrcWpSummarySet
std::set< TraceSummary * > SrcWpSummarySet
Definition: SummaryMapper.h:28
SymbolicExprGraph::findNotRegion
SEGRegionNode * findNotRegion(SEGRegionNode *region1) const
Return nullptr if the node does not exist.
Definition: SymbolicExprGraph.cpp:1315
SEGMapBase::isFuncBuildable
bool isFuncBuildable(const Function *F) const
Check the function is suitable for SEGBuilder.
Definition: SEGMapBase.cpp:49
SEGOpcodeNode::dot
virtual void dot(raw_fd_ostream &O) const
Dot its self to the given output stream.
Definition: SymbolicExprGraph.cpp:377
SEGMapBase::SEGMap
std::unordered_map< const Function *, SymbolicExprGraph * > SEGMap
SEG vector of functions.
Definition: SEGMapBase.h:23
TaskDepGraph
Definition: BotUpParallelPass.h:163
SymbolicExprGraphSolver::getDeps
virtual SMTExprVec getDeps(const SEGNodeBase *N, const SEGNodeBase *M)
Definition: SymbolicExprGraphSolver.cpp:1013
SEGOpcodeNode::CK_INE
@ CK_INE
not equal
Definition: SymbolicExprGraph.h:591
SEGAllocSite
Definition: SEGSimpleSite.h:141
SummaryMapper
Definition: SummaryMapper.h:41
BotUpParallelPass::releaseMemory
virtual bool releaseMemory(Function &F)=0
SEGLoadMemNode
Definition: SEGLoadMemNode.h:21
SEGNodeBase
The node base of symbolic expression graph.
Definition: SymbolicExprGraph.h:244
SailfishSummary::ParamSummarySet
std::set< TraceSummary * > ParamSummarySet
Recording value-flow summaries starting from a function parameter.
Definition: SummaryMapper.h:21
SailfishSummary
Various summaries generated for each function in pipelined PSA checker.
Definition: SummaryMapper.h:19
SEGBinaryWithIntConstNode
Definition: SEGBinaryWithIntConstNode.h:19
SEGOpcodeNode::CK_FOLT
@ CK_FOLT
0 1 0 0 True if ordered and less than
Definition: SymbolicExprGraph.h:576
SailfishRetValSummaryBuilder
Definition: SailfishRetValSummaryBuilder.h:13
SailfishFunctionChecker::collectVarMapping
void collectVarMapping(const std::vector< SummaryCacheItem > &ConstraintsCache, std::string Suffix, std::unordered_map< std::string, SMTExpr > &VariableMapping)
Definition: SailfishFunctionChecker.cpp:110
SEGOpcodeNode::CK_FFalse
@ CK_FFalse
0 0 0 0 Always false (always folded)
Definition: SymbolicExprGraph.h:572
SEGTrace
Definition: SEGTrace.h:21
SailfishFunctionChecker::Parent
SailfishChecker * Parent
the parent checker
Definition: SailfishFunctionChecker.h:25
SEGOpcodeNode::SEGOpcodeNode
SEGOpcodeNode(SEGObjectKind K, CodeKind Opcode, Type *Ty, SymbolicExprGraph *SEG, BasicBlock *BB, bool fromDisk)
This constructor will set the field Inst as nullptr.
Definition: SymbolicExprGraph.cpp:366