-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCFLGraphBuilder.h
More file actions
632 lines (547 loc) · 20 KB
/
CFLGraphBuilder.h
File metadata and controls
632 lines (547 loc) · 20 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
#ifndef LLVM_LIB_ANALYSIS_TAINT_CFLGRAPH_BUILDER_H
#define LLVM_LIB_ANALYSIS_TAINT_CFLGRAPH_BUILDER_H
#include "AliasAnalysisSummary.h"
#include "CFLGraph.h"
#include "KnownFunctions.h"
#include "llvm/ADT/APInt.h"
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/DenseSet.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/iterator_range.h"
#include "llvm/Analysis/MemoryBuiltins.h"
#include "llvm/Analysis/TargetLibraryInfo.h"
#include "llvm/IR/Argument.h"
#include "llvm/IR/BasicBlock.h"
#include "llvm/IR/CallSite.h"
#include "llvm/IR/Constants.h"
#include "llvm/IR/DataLayout.h"
#include "llvm/IR/Function.h"
#include "llvm/IR/GlobalValue.h"
#include "llvm/IR/InstVisitor.h"
#include "llvm/IR/InstrTypes.h"
#include "llvm/IR/Instruction.h"
#include "llvm/IR/Instructions.h"
#include "llvm/IR/Operator.h"
#include "llvm/IR/PatternMatch.h"
#include "llvm/IR/Type.h"
#include "llvm/IR/Value.h"
#include "llvm/Support/Casting.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/raw_ostream.h"
#include <cassert>
#include <cstdint>
#include <functional>
#include <vector>
namespace llvm {
namespace cflta {
using namespace PatternMatch;
///A builder class used to create CFLGraph instance from a given function
/// The CFL-AA that uses this builder must provide its own type as a template
/// argument. This is necessary for interprocedural processing: CFLGraphBuilder
/// needs a way of obtaining the summary of other functions when callinsts are
/// encountered.
/// As a result, we expect the said CFL-AA to expose a getSummary() public
/// member function that takes a Function& and returns the corresponding summary
/// as a const AliasSummary*.
struct ExternalVals {
SmallVector<Value *, 4> RetVals;
SmallVector<Value *, 4> VAArgs;
};
//alternative: use multimap in the inner layer
using GEPMapType = DenseMap<StructType *, DenseMap<uint64_t, SmallVector<GEPOperator *, 4>>>;
template <typename CFLAA> class CFLGraphBuilder {
// Input of the builder
CFLAA &Analysis;
const TargetLibraryInfo &TLI;
// Output of the builder
CFLGraph Graph;
DenseMap<Function *, ExternalVals> ExtValMap;
DenseMap<Function *, SmallVector<CallSite, 8>> CallSiteMap;
GEPMapType GEPMap;
// Helper class
/// Gets the edges our graph should have, based on an Instruction*
class GetEdgesVisitor : public InstVisitor<GetEdgesVisitor, void> {
CFLAA &AA;
const DataLayout &DL;
const TargetLibraryInfo &TLI;
const Function& Fn;
CFLGraph &Graph;
ExternalVals &ExtVals;
DenseMap<Function *, SmallVector<CallSite, 8>> &CallSiteMap;
GEPMapType &GEPMap;
static bool hasUsefulEdges(ConstantExpr *CE) {
// ConstantExpr doesn't have terminators, invokes, or fences, so only
// needs
// to check for compares.
return CE->getOpcode() != Instruction::ICmp &&
CE->getOpcode() != Instruction::FCmp;
}
// Returns possible functions called by CS into the given SmallVectorImpl.
// Returns true if targets found, false otherwise.
static bool getPossibleTargets(CallSite CS,
SmallVectorImpl<Function *> &Output) {
if (auto *Fn = CS.getCalledFunction()) {
Output.push_back(Fn);
return true;
}
// TODO: If the call is indirect, we might be able to enumerate all
// potential
// targets of the call and return them, rather than just failing.
return false;
}
void addNode(Value *Val, AliasAttrs Attr = AliasAttrs()) {
assert(Val != nullptr && Val->getType()->isPointerTy());
if (auto GVal = dyn_cast<GlobalValue>(Val)) {
if (Graph.addNode(InstantiatedValue{GVal, 0},
getGlobalOrArgAttrFromValue(*GVal))) {
auto IV = InstantiatedValue{GVal, 1};
if (auto GVar = dyn_cast<GlobalVariable>(GVal)) {
if (!GVar->hasInitializer() || !GVar->hasDefinitiveInitializer())
Graph.addNode(IV, getAttrUnknown());
}
}
} else if (auto CExpr = dyn_cast<ConstantExpr>(Val)) {
if (hasUsefulEdges(CExpr)) {
if (Graph.addNode(InstantiatedValue{CExpr, 0}))
visitConstantExpr(CExpr);
}
} else
Graph.addNode(InstantiatedValue{Val, 0}, Attr);
}
void addAssignEdge(Value *From, Value *To, int64_t Offset = 0) {
assert(From != nullptr && To != nullptr);
if (!From->getType()->isPointerTy() || !To->getType()->isPointerTy())
return;
addNode(From);
if (To != From) {
addNode(To);
Graph.addEdge(InstantiatedValue{From, 0}, InstantiatedValue{To, 0},
Offset);
}
}
//a store pattern used in std::atomic functions
//ty** From, To;
//int Val;
//int* , Ptr0, Ptr;
//Ptr0 = bitcast From;
//Ptr = bitcast To;
//Val = load Ptr0;
//store Val Ptr;
void handleCastToIntAndStore(const Value *Val, const Value *Ptr) {
if (!Val->getType()->isIntegerTy() || !Ptr->getType()->isPointerTy())
return;
Value *From, *To;
if(match(Val, m_Load(m_BitCast(m_Value(From)))) &&
match(Ptr, m_BitCast(m_Value(To))) &&
maxDerefLevel(From) > 1 &&
maxDerefLevel(To) > 1) {
Graph.addNode(InstantiatedValue{From, 1});
Graph.addNode(InstantiatedValue{To, 1});
Graph.addEdge(InstantiatedValue{From, 1}, InstantiatedValue{To, 1});
}
}
bool handlePtrToInt(PtrToIntOperator *PTI) {
if (!PTI->hasOneUse())
return false;
auto Add = *PTI->user_begin();
if (!match(Add, m_Add(m_Specific(PTI), m_Value())) || !Add->hasOneUse())
return false;
User *ITP = *Add->user_begin();
if (auto ITPOp = dyn_cast<Operator>(ITP)) {
if (ITPOp->getOpcode() == Instruction::IntToPtr) {
auto Src = PTI->getOperand(0);
Graph.addNode(InstantiatedValue{Src, 0});
Graph.addNode(InstantiatedValue{ITP, 0});
Graph.addEdge(InstantiatedValue{Src, 0}, InstantiatedValue{ITP, 0});
return true;
}
}
return false;
}
bool handleIntToPtr(Operator *Op) {
assert(Op->getOpcode() == Instruction::IntToPtr);
const Value *Src;
auto Add = Op->getOperand(0);
if (match(Add, m_Add(m_PtrToInt(m_Value(Src)), m_Value())) &&
Src->hasOneUse() && Add->hasOneUse())
return true;
return false;
}
void addDerefEdge(Value *From, Value *To, bool IsRead) {
assert(From != nullptr && To != nullptr);
// FIXME: This is subtly broken, due to how we model some instructions
// (e.g. extractvalue, extractelement) as loads. Since those take
// non-pointer operands, we'll entirely skip adding edges for those.
//
// addAssignEdge seems to have a similar issue with insertvalue, etc.
if (!From->getType()->isPointerTy() || !To->getType()->isPointerTy()) {
if(!IsRead)
handleCastToIntAndStore(From, To);
return;
}
addNode(From);
addNode(To);
if (IsRead) {
Graph.addNode(InstantiatedValue{From, 1});
Graph.addEdge(InstantiatedValue{From, 1}, InstantiatedValue{To, 0});
} else {
Graph.addNode(InstantiatedValue{To, 1});
Graph.addEdge(InstantiatedValue{From, 0}, InstantiatedValue{To, 1});
}
}
void addLoadEdge(Value *From, Value *To) { addDerefEdge(From, To, true); }
void addStoreEdge(Value *From, Value *To) { addDerefEdge(From, To, false); }
public:
GetEdgesVisitor(CFLGraphBuilder &Builder, Function &Fn)
: AA(Builder.Analysis), DL(Fn.getParent()->getDataLayout()), TLI(Builder.TLI), Fn(Fn), Graph(Builder.Graph), ExtVals(Builder.ExtValMap[&Fn]), CallSiteMap(Builder.CallSiteMap), GEPMap(Builder.GEPMap){}
void visitInstruction(Instruction &) {
llvm_unreachable("Unsupported instruction encountered");
}
void visitReturnInst(ReturnInst &Inst) {
if (auto RetVal = Inst.getReturnValue()) {
if (RetVal->getType()->isPointerTy()) {
//currently returned global vars are not modelled due to the cost of searching for the resulting aliases
auto Attr = getAttrNone();
if(auto GVal = dyn_cast<GlobalVariable>(RetVal))
if(!GVal->isConstant()) {
Attr = getAttrEscaped();
}
addNode(RetVal, Attr);
ExtVals.RetVals.push_back(RetVal);
}
}
}
void visitPtrToIntInst(PtrToIntInst &Inst) {
auto PTIOp = cast<PtrToIntOperator>(&Inst);
if(handlePtrToInt(PTIOp))
return;
auto *Ptr = Inst.getOperand(0);
addNode(Ptr/*, getAttrEscaped()*/);
}
void visitIntToPtrInst(IntToPtrInst &Inst) {
auto Op = cast<Operator>(&Inst);
if(handleIntToPtr(Op))
return;
auto *Ptr = &Inst;
addNode(Ptr/*, getAttrUnknown()*/);
}
void visitCastInst(CastInst &Inst) {
auto *Src = Inst.getOperand(0);
addAssignEdge(Src, &Inst);
}
void visitBinaryOperator(BinaryOperator &Inst) {
auto *Op1 = Inst.getOperand(0);
auto *Op2 = Inst.getOperand(1);
addAssignEdge(Op1, &Inst);
addAssignEdge(Op2, &Inst);
}
void visitAtomicCmpXchgInst(AtomicCmpXchgInst &Inst) {
auto *Ptr = Inst.getPointerOperand();
auto *Val = Inst.getNewValOperand();
addStoreEdge(Val, Ptr);
}
void visitAtomicRMWInst(AtomicRMWInst &Inst) {
auto *Ptr = Inst.getPointerOperand();
auto *Val = Inst.getValOperand();
addStoreEdge(Val, Ptr);
}
void visitPHINode(PHINode &Inst) {
for (Value *Val : Inst.incoming_values())
addAssignEdge(Val, &Inst);
}
void visitGEP(GEPOperator &GEPOp) {
if(!GEPOp.getType()->isPointerTy())
return;
uint64_t Offset = getGEPOffset(GEPOp, DL);
auto *Op = GEPOp.getPointerOperand();
if (auto *StructTy = dyn_cast<StructType>(GEPOp.getSourceElementType())) {
addNode(Op);
addNode(&GEPOp);
GEPMap[StructTy][Offset].push_back(&GEPOp);
} else {
addAssignEdge(Op, &GEPOp, Offset);
}
}
void visitGetElementPtrInst(GetElementPtrInst &Inst) {
auto *GEPOp = cast<GEPOperator>(&Inst);
visitGEP(*GEPOp);
}
void visitSelectInst(SelectInst &Inst) {
// Condition is not processed here (The actual statement producing
// the condition result is processed elsewhere). For select, the
// condition is evaluated, but not loaded, stored, or assigned
// simply as a result of being the condition of a select.
auto *TrueVal = Inst.getTrueValue();
auto *FalseVal = Inst.getFalseValue();
addAssignEdge(TrueVal, &Inst);
addAssignEdge(FalseVal, &Inst);
}
void visitAllocaInst(AllocaInst &Inst) { addNode(&Inst); }
void visitLoadInst(LoadInst &Inst) {
auto *Ptr = Inst.getPointerOperand();
auto *Val = &Inst;
addLoadEdge(Ptr, Val);
}
void visitStoreInst(StoreInst &Inst) {
auto *Ptr = Inst.getPointerOperand();
auto *Val = Inst.getValueOperand();
addStoreEdge(Val, Ptr);
}
static bool isFunctionExternal(Function *Fn) {
//return !Fn->hasExactDefinition();
return Fn->isDeclaration() || Fn->isInterposable();
}
void visitCallSite(CallSite CS) {
auto Inst = CS.getInstruction();
// Make sure all arguments and return value are added to the graph first
for (Value *V : CS.args()) {
if (V->getType()->isPointerTy()) {
addNode(V);
}
}
if (Inst->getType()->isPointerTy())
addNode(Inst);
if(Fn.isVarArg() &&
isa<VAStartInst>(Inst)) {
ExtVals.VAArgs.push_back(CS.getArgOperand(0));
return;
}
if(handleKnownFunctions(CS, &TLI, Graph))
return;
// TODO: Add support for noalias args/all the other fun function
// attributes that we can tack on.
SmallVector<Function *, 4> Targets;
if (getPossibleTargets(CS, Targets)) {
for (const auto Target: Targets) {
CallSiteMap[Target].push_back(CS);
}
return;
}
//errs() << "unhandled call instruction " << *Inst << "\n";
//if (auto F = CS.getCalledFunction()) {
// errs() << "unhandled call to " << getDemangledName(*F) << "\n";
//}
// Because the function is opaque, we need to note that anything
// could have happened to the arguments (unless the function is marked
// readonly or readnone), and that the result could alias just about
// anything, too (unless the result is marked noalias).
if (!CS.onlyReadsMemory())
for (Value *V : CS.args()) {
if (V->getType()->isPointerTy()) {
// The argument itself escapes.
//Graph.addAttr(InstantiatedValue{V, 0}, getAttrEscaped());
// The fate of argument memory is unknown. Note that since
// AliasAttrs is transitive with respect to dereference, we only
// need to specify it for the first-level memory.
//if(Graph.getCurMaxLevel(V) > 0)
//` Graph.addAttr(InstantiatedValue{V, 1}/*, getAttrUnknown()*/);
}
}
if (Inst->getType()->isPointerTy()) {
//Return values from unknown functions are unknown
//Graph.addAttr(InstantiatedValue{Inst, 0}, getAttrUnknown());
//auto *Fn = CS.getCalledFunction();
//if (Fn == nullptr || !Fn->returnDoesNotAlias())
// No need to call addNode() since we've added Inst at the
// beginning of this function and we know it is not a global.
//Graph.addAttr(InstantiatedValue{Inst, 0}, getAttrUnknown());
}
}
/// Because vectors/aggregates are immutable and unaddressable, there's
/// nothing we can do to coax a value out of them, other than calling
/// Extract{Element,Value}. We can effectively treat them as pointers to
/// arbitrary memory locations we can store in and load from.
void visitExtractElementInst(ExtractElementInst &Inst) {
auto *Ptr = Inst.getVectorOperand();
auto *Val = &Inst;
addLoadEdge(Ptr, Val);
}
void visitInsertElementInst(InsertElementInst &Inst) {
auto *Vec = Inst.getOperand(0);
auto *Val = Inst.getOperand(1);
addAssignEdge(Vec, &Inst);
addStoreEdge(Val, &Inst);
}
void visitLandingPadInst(LandingPadInst &Inst) {
// Exceptions come from "nowhere", from our analysis' perspective.
// So we place the instruction its own group, noting that said group may
// alias externals
if (Inst.getType()->isPointerTy())
addNode(&Inst, getAttrUnknown());
}
void visitInsertValueInst(InsertValueInst &Inst) {
auto *Agg = Inst.getOperand(0);
auto *Val = Inst.getOperand(1);
addAssignEdge(Agg, &Inst);
addStoreEdge(Val, &Inst);
}
void visitExtractValueInst(ExtractValueInst &Inst) {
auto *Ptr = Inst.getAggregateOperand();
addLoadEdge(Ptr, &Inst);
}
void visitShuffleVectorInst(ShuffleVectorInst &Inst) {
auto *From1 = Inst.getOperand(0);
auto *From2 = Inst.getOperand(1);
addAssignEdge(From1, &Inst);
addAssignEdge(From2, &Inst);
}
void visitConstantExpr(ConstantExpr *CE) {
switch (CE->getOpcode()) {
case Instruction::GetElementPtr: {
auto GEPOp = cast<GEPOperator>(CE);
visitGEP(*GEPOp);
break;
}
case Instruction::PtrToInt: {
auto PTIOp = cast<PtrToIntOperator>(CE);
if(handlePtrToInt(PTIOp))
return;
addNode(CE->getOperand(0)/*, getAttrEscaped()*/);
break;
}
case Instruction::IntToPtr: {
auto Op = cast<Operator>(CE);
if(handleIntToPtr(Op))
return;
addNode(CE/*, getAttrUnknown()*/);
break;
}
case Instruction::BitCast:
case Instruction::AddrSpaceCast:
case Instruction::Trunc:
case Instruction::ZExt:
case Instruction::SExt:
case Instruction::FPExt:
case Instruction::FPTrunc:
case Instruction::UIToFP:
case Instruction::SIToFP:
case Instruction::FPToUI:
case Instruction::FPToSI: {
addAssignEdge(CE->getOperand(0), CE);
break;
}
case Instruction::Select: {
addAssignEdge(CE->getOperand(1), CE);
addAssignEdge(CE->getOperand(2), CE);
break;
}
case Instruction::InsertElement:
case Instruction::InsertValue: {
addAssignEdge(CE->getOperand(0), CE);
addStoreEdge(CE->getOperand(1), CE);
break;
}
case Instruction::ExtractElement:
case Instruction::ExtractValue: {
addLoadEdge(CE->getOperand(0), CE);
break;
}
case Instruction::Add:
case Instruction::Sub:
case Instruction::FSub:
case Instruction::Mul:
case Instruction::FMul:
case Instruction::UDiv:
case Instruction::SDiv:
case Instruction::FDiv:
case Instruction::URem:
case Instruction::SRem:
case Instruction::FRem:
case Instruction::And:
case Instruction::Or:
case Instruction::Xor:
case Instruction::Shl:
case Instruction::LShr:
case Instruction::AShr:
case Instruction::ICmp:
case Instruction::FCmp:
case Instruction::ShuffleVector: {
addAssignEdge(CE->getOperand(0), CE);
addAssignEdge(CE->getOperand(1), CE);
break;
}
default:
llvm_unreachable("Unknown instruction type encountered!");
}
}
};
// Helper functions
// Determines whether or not we an instruction is useless to us (e.g.
// FenceInst)
static bool hasUsefulEdges(Instruction *Inst) {
bool IsNonInvokeRetTerminator = Inst->isTerminator() &&
!isa<InvokeInst>(Inst) &&
!isa<ReturnInst>(Inst);
return !isa<CmpInst>(Inst) && !isa<FenceInst>(Inst) &&
!IsNonInvokeRetTerminator;
}
void addArgumentToGraph(Argument &Arg) {
if (Arg.getType()->isPointerTy()) {
Graph.addNode(InstantiatedValue{&Arg, 0},
getGlobalOrArgAttrFromValue(Arg));
// Pointees of a formal parameter is known to the caller
Graph.addNode(InstantiatedValue{&Arg, 1}, getAttrCaller());
}
}
// Given an Instruction, this will add it to the graph, along with any
// Instructions that are potentially only available from said Instruction
// For example, given the following line:
// %0 = load i16* getelementptr ([1 x i16]* @a, 0, 0), align 2
// addInstructionToGraph would add both the `load` and `getelementptr`
// instructions to the graph appropriately.
void addInstructionToGraph(GetEdgesVisitor &Visitor, Instruction &Inst) {
if (!hasUsefulEdges(&Inst))
return;
Visitor.visit(Inst);
}
// Builds the graph needed for constructing the StratifiedSets for the given
// function
void addCallEdges(CallSite CS, Function *Callee) {
auto CallInstr = CS.getInstruction();
auto ExtVals = ExtValMap[Callee];
for (const auto RetVal: ExtVals.RetVals)
Graph.addRetEdge(RetVal, CallInstr, CS);
for (unsigned ArgNo = 0; ArgNo < Callee->arg_size(); ArgNo++) {
auto ActualArgVal = CS.getArgument(ArgNo);
if(!ActualArgVal->getType()->isPointerTy())
continue;
auto FormalArgVal = (Argument *)(Callee->arg_begin() + ArgNo);
if(!FormalArgVal->getType()->isPointerTy())
continue;
Graph.addArgEdge(ActualArgVal, FormalArgVal, CS);
}
}
void buildGraphFrom(Function &Fn) {
errs() << "------------------------------------\n";
errs() << "building graph for " << Fn.getName() << "\n";
GetEdgesVisitor Visitor(*this, Fn);
for (auto &Bb : Fn.getBasicBlockList())
for (auto &Inst : Bb.getInstList())
addInstructionToGraph(Visitor, Inst);
for (auto &Arg : Fn.args())
addArgumentToGraph(Arg);
}
void buildGraphFrom(Module &Mod) {
for (auto &Fn : Mod.getFunctionList())
buildGraphFrom(Fn);
for (auto &Mapping : CallSiteMap) {
auto Callee = Mapping.first;
for (auto &CS : Mapping.second)
addCallEdges(CS, Callee);
}
CallSiteMap.clear();
ExtValMap.clear();
}
public:
CFLGraphBuilder(CFLAA &Analysis, const TargetLibraryInfo &TLI, Module &Mod) : Analysis(Analysis), TLI(TLI) {
buildGraphFrom(Mod);
}
const GEPMapType &getGEPMap() {
return GEPMap;
}
CFLGraph &getCFLGraph() { return Graph; }
};
} // end namespace cflta
} // end namespace llvm
#endif //LLVM_LIB_ANALYSIS_CFLGRAPH_BUILDER_H