LLVM: include/llvm/Analysis/LazyCallGraph.h Source File (original) (raw)

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#ifndef LLVM_ANALYSIS_LAZYCALLGRAPH_H

35#define LLVM_ANALYSIS_LAZYCALLGRAPH_H

36

51#include

52#include

53#include

54#include

55#include

56

57namespace llvm {

58

60template struct GraphTraits;

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

110public:

114

115

116

117

118

119

120

121

122

123

124

125

126

127

128

130 public:

131

133

136

137

138

139

140

141 explicit operator bool() const;

142

143

145

146

147

148

150

151

152

153

155

156

157

158

160

161 private:

164

166

167 void setKind(Kind K) { Value.setInt(K); }

168 };

169

170

171

172

173

174

175

176

177

178

179

180 class EdgeSequence {

184

187

188 public:

189

190 class iterator

192 std::forward_iterator_tag> {

195

197

198

201 while (I != E && !*I)

202 ++I;

203 }

204

205 public:

207

208 using iterator_adaptor_base::operator++;

210 do {

211 ++I;

212 } while (I != E && !*I);

213 return *this;

214 }

215 };

216

217

218

219

220

221 class call_iterator

223 std::forward_iterator_tag> {

226

228

229

230 void advanceToNextEdge() {

231 while (I != E && (!*I || I->isCall()))

232 ++I;

233 }

234

235

238 advanceToNextEdge();

239 }

240

241 public:

243

244 using iterator_adaptor_base::operator++;

246 ++I;

247 advanceToNextEdge();

248 return *this;

249 }

250 };

251

254

256 assert(EdgeIndexMap.contains(&N) && "No such edge!");

257 auto &E = Edges[EdgeIndexMap.find(&N)->second];

258 assert(E && "Dead or null edge!");

259 return E;

260 }

261

263 auto EI = EdgeIndexMap.find(&N);

264 if (EI == EdgeIndexMap.end())

265 return nullptr;

266 auto &E = Edges[EI->second];

267 return E ? &E : nullptr;

268 }

269

274

278

280 for (auto &E : Edges)

281 if (E)

282 return false;

283

284 return true;

285 }

286

287 private:

288 VectorT Edges;

290

292

293

294 void insertEdgeInternal(Node &ChildN, Edge::Kind EK);

295

296

297 void setEdgeKind(Node &ChildN, Edge::Kind EK);

298

299

300 bool removeEdgeInternal(Node &ChildN);

301 };

302

303

304

305

306

307

308

309

310

311

312

313 class Node {

316

317 public:

319

321

323

324

325 bool operator==(const Node &N) const { return this == &N; }

327

328

329 bool isPopulated() const { return Edges.has_value(); }

330

331

332

333

334

335

338 "Both graph and function pointers should be null or non-null.");

339 return !G;

340 }

341

342

343

349

350

351

352

353

354

355

356

357

358

359

360

361

363 if (Edges)

364 return *Edges;

365

366 return populateSlow();

367 }

368

369 private:

372

373

374

375

376 int DFSNumber = 0;

377 int LowLink = 0;

378

379 std::optional Edges;

380

381

382

384

385

386 LLVM_ABI EdgeSequence &populateSlow();

387

388

389

390

391

392

393 void replaceFunction(Function &NewF);

394

395 void clear() { Edges.reset(); }

396

397

399 return OS << N.F->getName();

400 }

401

402

403 void dump() const;

404 };

405

406

407

408

409

410

411

412

413

414

415

416

420

423

424 template

425 SCC(RefSCC &OuterRefSCC, NodeRangeT &&Nodes)

426 : OuterRefSCC(&OuterRefSCC), Nodes(std::forward(Nodes)) {}

427

428 void clear() {

429 OuterRefSCC = nullptr;

431 }

432

433

434

435

436

437

438

439

441 OS << '(';

442 int I = 0;

444 if (I > 0)

445 OS << ", ";

446

447 if (I > 8) {

448 OS << "..., " << *C.Nodes.back();

449 break;

450 }

451 OS << N;

452 ++I;

453 }

454 OS << ')';

455 return OS;

456 }

457

458

459 void dump() const;

460

461#if !defined(NDEBUG) || defined(EXPENSIVE_CHECKS)

462

463

464

465

466

467

468

470#endif

471

472 public:

474

477

478 int size() const { return Nodes.size(); }

479

481

482

483

484

485

486 bool isParentOf(const SCC &C) const;

487

488

489

490

491

492

493

494 bool isAncestorOf(const SCC &C) const;

495

496

497

498

499

500 bool isChildOf(const SCC &C) const { return C.isParentOf(*this); }

501

502

503

504

505

506 bool isDescendantOf(const SCC &C) const { return C.isAncestorOf(*this); }

507

508

509

510

511

513 std::string Name;

515 OS << *this;

517 return Name;

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 class RefSCC {

545

547

548

550

551

553

554

555

557

558 void clear() {

559 SCCs.clear();

560 SCCIndices.clear();

561 }

562

563

564

565

566

567

568

569

571 OS << '[';

572 int I = 0;

574 if (I > 0)

575 OS << ", ";

576

577 if (I > 4) {

578 OS << "..., " << *RC.SCCs.back();

579 break;

580 }

581 OS << C;

582 ++I;

583 }

584 OS << ']';

585 return OS;

586 }

587

588

589 void dump() const;

590

591#if !defined(NDEBUG) || defined(EXPENSIVE_CHECKS)

592

593

594

595

596

597

598

599

600

602#endif

603

604 public:

609

612

613 ssize_t size() const { return SCCs.size(); }

614

616

618 return SCCs.begin() + SCCIndices.find(&C)->second;

619 }

620

621

622

623

624

626

627

628

629

630

631

633

634

635

636

637

639

640

641

642

643

644

648

649

650

651

652

654 std::string Name;

656 OS << *this;

658 return Name;

659 }

660

661

662

663

664

665

666

667

668

669

670

671

672

673

674

675

676

677

678

679

680

681

682

683

684

685

686

688 Node &SourceN, Node &TargetN,

690

691

692

693

694

695

696

698

699

700

701

702

703

704

705

706

707

708

709

710

711

712

713

714

715

716

718 Node &TargetN);

719

720

721

722

723

725

726

727

728

729

731

732

733

734

735

736

737

738

739

740

741

742

743

745

746

747

748

749

750

751

753 Edge::Kind EK);

754

755

756

757

758

759

760

761

762

763

764

765

766

767

768

769

770

771

772

773

774

775

776

777

778

779

781 Node &TargetN);

782

783

784

785

786

787

788

789

790

791

792

794

795

796

797

798

799

800

801

802

803

804

805

806

807

808

809

810

811

812

813

814

815

816

817

818

819

820

821

822

823

824

825

826

827

828

829

830

831

832

835

836

837

838

839

840

841

842

843

844

846

847

848

849

850

851

852

853

854

855

857

858

859

860

861

862

863

864

865

866

868

869

870 };

871

872

873

874

875

876

877

878 class postorder_ref_scc_iterator

880 std::forward_iterator_tag, RefSCC> {

883

884

885 struct IsAtEndT {};

886

888 RefSCC *RC = nullptr;

889

890

892 incrementUntilNonEmptyRefSCC();

893 }

894

895

896 postorder_ref_scc_iterator(LazyCallGraph &G, IsAtEndT ) : G(&G) {}

897

898

899

901 if (Index == (int)G.PostOrderRefSCCs.size())

902

903 return nullptr;

904

905 return G.PostOrderRefSCCs[Index];

906 }

907

908

909 void incrementUntilNonEmptyRefSCC() {

910 while (RC && RC->size() == 0)

911 increment();

912 }

913

914 void increment() {

915 assert(RC && "Cannot increment the end iterator!");

916 RC = getRC(*G, G->RefSCCIndices.find(RC)->second + 1);

917 }

918

919 public:

920 bool operator==(const postorder_ref_scc_iterator &Arg) const {

921 return G == Arg.G && RC == Arg.RC;

922 }

923

925

926 using iterator_facade_base::operator++;

928 increment();

929 incrementUntilNonEmptyRefSCC();

930 return *this;

931 }

932 };

933

934

935

936

937

938

941

944

945#if !defined(NDEBUG) || defined(EXPENSIVE_CHECKS)

946

948#endif

949

951 ModuleAnalysisManager::Invalidator &);

952

955

957

959 if (!EntryEdges.empty())

960 assert(!PostOrderRefSCCs.empty() &&

961 "Must form RefSCCs before iterating them!");

963 }

965 if (!EntryEdges.empty())

966 assert(!PostOrderRefSCCs.empty() &&

967 "Must form RefSCCs before iterating them!");

969 postorder_ref_scc_iterator::IsAtEndT());

970 }

971

975

976

978

979

980

981

982

984

985

986

987

988

991 return &C->getOuterRefSCC();

992

993 return nullptr;

994 }

995

996

997

999 Node *&N = NodeMap[&F];

1000 if (N)

1001 return *N;

1002

1003 return insertInto(F, N);

1004 }

1005

1006

1007

1008

1009

1011 return LibFunctions.getArrayRef();

1012 }

1013

1014

1015

1016

1017

1018

1019

1021

1022

1023

1024

1025

1026

1027

1028

1029

1030

1031

1032

1033

1035

1036

1040

1041

1043

1044

1048

1049

1050

1051

1052

1053

1054

1055

1056

1057

1058

1059

1060

1061

1062

1064

1065

1066

1067

1068

1070

1071

1072

1073

1074

1075

1076

1077

1078

1079

1080

1081

1084

1085

1086

1087

1088

1089

1090

1091

1092

1096

1097

1098

1099

1100

1101

1102

1103

1104

1105

1106

1107

1108

1109

1110

1111

1112

1116

1117

1118

1119private:

1122

1123

1125

1126

1128

1129

1130

1131

1132

1133 EdgeSequence EntryEdges;

1134

1135

1137

1138

1140

1141

1143

1144

1145

1146

1148

1149

1150

1152

1153

1154

1155

1157

1158

1159

1161

1162

1163

1164

1166

1167

1168 void updateGraphPtrs();

1169

1170

1171

1172

1173 template <typename... Ts> SCC *createSCC(Ts &&...Args) {

1174 return new (SCCBPA.Allocate()) SCC(std::forward(Args)...);

1175 }

1176

1177

1178

1179

1180 template <typename... Ts> RefSCC *createRefSCC(Ts &&...Args) {

1181 return new (RefSCCBPA.Allocate()) RefSCC(std::forward(Args)...);

1182 }

1183

1184

1185

1186

1187

1188

1189

1190

1191

1192

1193

1194

1195 template <typename RootsT, typename GetBeginT, typename GetEndT,

1196 typename GetNodeT, typename FormSCCCallbackT>

1197 static void buildGenericSCCs(RootsT &&Roots, GetBeginT &&GetBegin,

1198 GetEndT &&GetEnd, GetNodeT &&GetNode,

1199 FormSCCCallbackT &&FormSCC);

1200

1201

1202 void buildSCCs(RefSCC &RC, node_stack_range Nodes);

1203

1204

1205

1206

1207

1208 int getRefSCCIndex(RefSCC &RC) {

1209 auto IndexIt = RefSCCIndices.find(&RC);

1210 assert(IndexIt != RefSCCIndices.end() && "RefSCC doesn't have an index!");

1211 assert(PostOrderRefSCCs[IndexIt->second] == &RC &&

1212 "Index does not point back at RC!");

1213 return IndexIt->second;

1214 }

1215};

1216

1217inline LazyCallGraph::Edge::Edge() = default;

1218inline LazyCallGraph::Edge::Edge(Node &N, Kind K) : Value(&N, K) {}

1219

1220inline LazyCallGraph::Edge::operator bool() const {

1221 return Value.getPointer() && !Value.getPointer()->isDead();

1222}

1223

1224inline LazyCallGraph::Edge::Kind LazyCallGraph::Edge::getKind() const {

1225 assert(*this && "Queried a null edge!");

1226 return Value.getInt();

1227}

1228

1229inline bool LazyCallGraph::Edge::isCall() const {

1230 assert(*this && "Queried a null edge!");

1232}

1233

1235 assert(*this && "Queried a null edge!");

1236 return *Value.getPointer();

1237}

1238

1239inline Function &LazyCallGraph::Edge::getFunction() const {

1240 assert(*this && "Queried a null edge!");

1241 return getNode().getFunction();

1242}

1243

1244

1261

1262

1265

1267

1268public:

1269

1271

1272

1273

1274

1275

1284};

1285

1286

1287

1288

1290 : public PassInfoMixin {

1292

1293public:

1295

1297

1299};

1300

1301

1302

1303

1305 : public PassInfoMixin {

1307

1308public:

1310

1312

1314};

1315

1317 Any::TypeId<const LazyCallGraph::SCC *>;

1318}

1319

1320#endif

assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")

static msgpack::DocNode getNode(msgpack::DocNode DN, msgpack::Type Type, MCValue Val)

This file defines the BumpPtrAllocator interface.

This file provides Any, a non-template class modeled in the spirit of std::any.

static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")

#define LLVM_TEMPLATE_ABI

This file defines the DenseMap class.

This header defines various interfaces for pass management in LLVM.

FunctionAnalysisManager FAM

This file defines the PointerIntPair class.

This file implements a set that has insertion order iteration characteristics.

This file defines the SmallVector class.

PassT::Result & getResult(IRUnitT &IR, ExtraArgTs... ExtraArgs)

Get the result of an analysis pass for a given IR unit.

ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...

This is an important base class in LLVM.

An analysis pass which computes the call graph for a module.

Definition LazyCallGraph.h:1263

LazyCallGraph run(Module &M, ModuleAnalysisManager &AM)

Compute the LazyCallGraph for the module M.

Definition LazyCallGraph.h:1276

LazyCallGraph Result

Inform generic clients of the result type.

Definition LazyCallGraph.h:1270

LLVM_ABI LazyCallGraphDOTPrinterPass(raw_ostream &OS)

LLVM_ABI PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM)

static bool isRequired()

Definition LazyCallGraph.h:1313

LLVM_ABI PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM)

LLVM_ABI LazyCallGraphPrinterPass(raw_ostream &OS)

static bool isRequired()

Definition LazyCallGraph.h:1298

An iterator over specifically call edges.

Definition LazyCallGraph.h:223

call_iterator & operator++()

Definition LazyCallGraph.h:245

friend class LazyCallGraph

Definition LazyCallGraph.h:224

An iterator used for the edges to both entry nodes and child nodes.

Definition LazyCallGraph.h:192

iterator & operator++()

Definition LazyCallGraph.h:209

friend class LazyCallGraph

Definition LazyCallGraph.h:193

The edge sequence object.

Definition LazyCallGraph.h:180

bool empty()

Definition LazyCallGraph.h:279

friend class LazyCallGraph::Node

Definition LazyCallGraph.h:182

iterator end()

Definition LazyCallGraph.h:253

iterator begin()

Definition LazyCallGraph.h:252

call_iterator call_end()

Definition LazyCallGraph.h:273

friend class LazyCallGraph

Definition LazyCallGraph.h:181

Edge & operator[](Node &N)

Definition LazyCallGraph.h:255

call_iterator call_begin()

Definition LazyCallGraph.h:270

iterator_range< call_iterator > calls()

Definition LazyCallGraph.h:275

Edge * lookup(Node &N)

Definition LazyCallGraph.h:262

A class used to represent edges in the call graph.

Definition LazyCallGraph.h:129

Function & getFunction() const

Get the function referenced by this edge.

Definition LazyCallGraph.h:1239

bool isCall() const

Test whether the edge represents a direct call to a function.

Definition LazyCallGraph.h:1229

Kind

The kind of edge in the graph.

Definition LazyCallGraph.h:132

@ Call

Definition LazyCallGraph.h:132

@ Ref

Definition LazyCallGraph.h:132

Kind getKind() const

Returns the Kind of the edge.

Definition LazyCallGraph.h:1224

Node & getNode() const

Get the call graph node referenced by this edge.

Definition LazyCallGraph.h:1234

A node in the call graph.

Definition LazyCallGraph.h:313

LazyCallGraph & getGraph() const

Definition LazyCallGraph.h:318

EdgeSequence & populate()

Populate the edges of this node if necessary.

Definition LazyCallGraph.h:362

bool isDead() const

Tests whether this is actually a dead node and no longer valid.

Definition LazyCallGraph.h:336

friend class LazyCallGraph

Definition LazyCallGraph.h:314

bool operator!=(const Node &N) const

Definition LazyCallGraph.h:326

bool isPopulated() const

Tests whether the node has been populated with edges.

Definition LazyCallGraph.h:329

bool operator==(const Node &N) const

Equality is defined as address equality.

Definition LazyCallGraph.h:325

friend raw_ostream & operator<<(raw_ostream &OS, const Node &N)

Print the name of this node's function.

Definition LazyCallGraph.h:398

EdgeSequence * operator->() const

Definition LazyCallGraph.h:348

StringRef getName() const

Definition LazyCallGraph.h:322

EdgeSequence & operator*() const

Definition LazyCallGraph.h:344

Function & getFunction() const

Definition LazyCallGraph.h:320

A RefSCC of the call graph.

Definition LazyCallGraph.h:542

LLVM_ABI SmallVector< RefSCC *, 1 > insertIncomingRefEdge(Node &SourceN, Node &TargetN)

Insert an edge whose source is in a descendant RefSCC and target is in this RefSCC.

LLVM_ABI bool switchInternalEdgeToCall(Node &SourceN, Node &TargetN, function_ref< void(ArrayRef< SCC * > MergedSCCs)> MergeCB={})

Make an existing internal ref edge into a call edge.

LLVM_ABI bool isAncestorOf(const RefSCC &RC) const

Test if this RefSCC is an ancestor of RC.

LLVM_ABI void insertTrivialRefEdge(Node &SourceN, Node &TargetN)

A convenience wrapper around the above to handle trivial cases of inserting a new ref edge.

iterator find(SCC &C) const

Definition LazyCallGraph.h:617

SCC & operator[](int Idx)

Definition LazyCallGraph.h:615

bool isDescendantOf(const RefSCC &RC) const

Test if this RefSCC is a descendant of RC.

Definition LazyCallGraph.h:645

bool isChildOf(const RefSCC &RC) const

Test if this RefSCC is a child of RC.

Definition LazyCallGraph.h:638

LLVM_ABI void switchOutgoingEdgeToCall(Node &SourceN, Node &TargetN)

Make an existing outgoing ref edge into a call edge.

iterator_range< iterator > range

Definition LazyCallGraph.h:606

LLVM_ABI void replaceNodeFunction(Node &N, Function &NewF)

Directly replace a node's function with a new function.

LLVM_ABI void insertOutgoingEdge(Node &SourceN, Node &TargetN, Edge::Kind EK)

Insert an edge whose parent is in this RefSCC and child is in some child RefSCC.

friend class LazyCallGraph

Definition LazyCallGraph.h:543

LLVM_ABI SmallVector< RefSCC *, 1 > removeInternalRefEdges(ArrayRef< std::pair< Node *, Node * > > Edges)

Remove a list of ref edges which are entirely within this RefSCC.

LLVM_ABI iterator_range< iterator > switchInternalEdgeToRef(Node &SourceN, Node &TargetN)

Make an existing internal call edge within a single SCC into a ref edge.

LLVM_ABI void insertInternalRefEdge(Node &SourceN, Node &TargetN)

Insert a ref edge from one node in this RefSCC to another in this RefSCC.

LLVM_ABI void insertTrivialCallEdge(Node &SourceN, Node &TargetN)

A convenience wrapper around the above to handle trivial cases of inserting a new call edge.

LLVM_ABI void removeOutgoingEdge(Node &SourceN, Node &TargetN)

Remove an edge whose source is in this RefSCC and target is not.

std::string getName() const

Provide a short name by printing this RefSCC to a std::string.

Definition LazyCallGraph.h:653

ssize_t size() const

Definition LazyCallGraph.h:613

iterator end() const

Definition LazyCallGraph.h:611

iterator begin() const

Definition LazyCallGraph.h:610

pointee_iterator< SmallVectorImpl< SCC * >::const_iterator > iterator

Definition LazyCallGraph.h:605

pointee_iterator< SmallPtrSetImpl< RefSCC * >::const_iterator > parent_iterator

Definition LazyCallGraph.h:607

LLVM_ABI void switchOutgoingEdgeToRef(Node &SourceN, Node &TargetN)

Make an existing outgoing call edge into a ref edge.

friend raw_ostream & operator<<(raw_ostream &OS, const RefSCC &RC)

Print a short description useful for debugging or logging.

Definition LazyCallGraph.h:570

LLVM_ABI void switchTrivialInternalEdgeToRef(Node &SourceN, Node &TargetN)

Make an existing internal call edge between separate SCCs into a ref edge.

LLVM_ABI bool isParentOf(const RefSCC &RC) const

Test if this RefSCC is a parent of RC.

An SCC of the call graph.

Definition LazyCallGraph.h:417

iterator end() const

Definition LazyCallGraph.h:476

pointee_iterator< SmallVectorImpl< Node * >::const_iterator > iterator

Definition LazyCallGraph.h:473

int size() const

Definition LazyCallGraph.h:478

bool isChildOf(const SCC &C) const

Test if this SCC is a child of C.

Definition LazyCallGraph.h:500

friend class LazyCallGraph

Definition LazyCallGraph.h:418

friend raw_ostream & operator<<(raw_ostream &OS, const SCC &C)

Print a short description useful for debugging or logging.

Definition LazyCallGraph.h:440

bool isDescendantOf(const SCC &C) const

Test if this SCC is a descendant of C.

Definition LazyCallGraph.h:506

std::string getName() const

Provide a short name by printing this SCC to a std::string.

Definition LazyCallGraph.h:512

iterator begin() const

Definition LazyCallGraph.h:475

RefSCC & getOuterRefSCC() const

Definition LazyCallGraph.h:480

A post-order depth-first RefSCC iterator over the call graph.

Definition LazyCallGraph.h:880

reference operator*() const

Definition LazyCallGraph.h:924

friend class LazyCallGraph

Definition LazyCallGraph.h:881

postorder_ref_scc_iterator & operator++()

Definition LazyCallGraph.h:927

bool operator==(const postorder_ref_scc_iterator &Arg) const

Definition LazyCallGraph.h:920

A lazily constructed view of the call graph of a module.

Definition LazyCallGraph.h:109

bool isLibFunction(Function &F) const

Test whether a function is a known and defined library function tracked by the call graph.

Definition LazyCallGraph.h:1020

EdgeSequence::iterator begin()

Definition LazyCallGraph.h:953

RefSCC * lookupRefSCC(Node &N) const

Lookup a function's RefSCC in the graph.

Definition LazyCallGraph.h:989

LLVM_ABI void insertEdge(Node &SourceN, Node &TargetN, Edge::Kind EK)

Update the call graph after inserting a new edge.

LLVM_ABI LazyCallGraph(Module &M, function_ref< TargetLibraryInfo &(Function &)> GetTLI)

Construct a graph for the given module.

LLVM_ABI void buildRefSCCs()

static LLVM_ABI void visitReferences(SmallVectorImpl< Constant * > &Worklist, SmallPtrSetImpl< Constant * > &Visited, function_ref< void(Function &)> Callback)

Recursively visits the defined functions whose address is reachable from every constant in the Workli...

LLVM_ABI void markDeadFunction(Function &F)

Mark a function as dead to be removed later by removeDeadFunctions().

LLVM_ABI void addSplitFunction(Function &OriginalFunction, Function &NewFunction)

Add a new function split/outlined from an existing function.

LLVM_ABI void addSplitRefRecursiveFunctions(Function &OriginalFunction, ArrayRef< Function * > NewFunctions)

Add new ref-recursive functions split/outlined from an existing function.

LLVM_ABI void removeDeadFunctions(ArrayRef< Function * > DeadFs)

Remove dead functions from the call graph.

postorder_ref_scc_iterator postorder_ref_scc_begin()

Definition LazyCallGraph.h:958

ArrayRef< Function * > getLibFunctions() const

Get the sequence of known and defined library functions.

Definition LazyCallGraph.h:1010

postorder_ref_scc_iterator postorder_ref_scc_end()

Definition LazyCallGraph.h:964

LLVM_ABI void removeEdge(Node &SourceN, Node &TargetN)

Update the call graph after deleting an edge.

void removeEdge(Function &Source, Function &Target)

Update the call graph after deleting an edge.

Definition LazyCallGraph.h:1045

void insertEdge(Function &Source, Function &Target, Edge::Kind EK)

Update the call graph after inserting a new edge.

Definition LazyCallGraph.h:1037

Node & get(Function &F)

Get a graph node for a given function, scanning it to populate the graph data as necessary.

Definition LazyCallGraph.h:998

SCC * lookupSCC(Node &N) const

Lookup a function's SCC in the graph.

Definition LazyCallGraph.h:983

iterator_range< postorder_ref_scc_iterator > postorder_ref_sccs()

Definition LazyCallGraph.h:972

LLVM_ABI LazyCallGraph & operator=(LazyCallGraph &&RHS)

LLVM_ABI bool invalidate(Module &, const PreservedAnalyses &PA, ModuleAnalysisManager::Invalidator &)

void verify()

Verify that every RefSCC is valid.

EdgeSequence::iterator end()

Definition LazyCallGraph.h:954

Node * lookup(const Function &F) const

Lookup a function in the graph which has already been scanned and added.

Definition LazyCallGraph.h:977

A Module instance is used to store all the information related to an LLVM module.

PointerIntPair - This class implements a pair of a pointer and small integer.

void setInt(IntType IntVal) &

A set of analyses that are preserved following a run of a transformation pass.

A templated base class for SmallPtrSet which provides the typesafe interface that is common across al...

A SetVector that performs no allocations if smaller than a certain size.

This class consists of common code factored out of the SmallVector class to reduce code duplication b...

typename SuperClass::iterator iterator

std::reverse_iterator< iterator > reverse_iterator

This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.

A BumpPtrAllocator that allows only elements of a specific type to be allocated.

T * Allocate(size_t num=1)

Allocate space for an array of objects without constructing them.

StringRef - Represent a constant reference to a string, i.e.

Analysis pass providing the TargetLibraryInfo.

Provides information about what library functions are available for the current target.

Target - Wrapper for Target specific information.

An efficient, type-erasing, non-owning reference to a callable.

CRTP base class for adapting an iterator to a different type.

iterator_adaptor_base()=default

CRTP base class which implements the entire standard iterator facade in terms of a minimal subset of ...

A range adaptor for a pair of iterators.

This class implements an extremely fast bulk output stream that can only output to a stream.

A raw_ostream that writes to an std::string.

This provides a very simple, boring adaptor for a begin and end iterator into a range type.

@ C

The default llvm calling convention, compatible with C.

This is an optimization pass for GlobalISel generic memory operations.

void dump(const SparseBitVector< ElementSize > &LHS, raw_ostream &out)

iterator_range< T > make_range(T x, T y)

Convenience function for iterating over sub-ranges.

InnerAnalysisManagerProxy< FunctionAnalysisManager, Module > FunctionAnalysisManagerModuleProxy

Provide the FunctionAnalysisManager to Module proxy.

AnalysisManager< Function > FunctionAnalysisManager

Convenience typedef for the Function analysis manager.

AnalysisManager< Module > ModuleAnalysisManager

Convenience typedef for the Module analysis manager.

Implement std::hash so that hash_code can be used in STL containers.

A CRTP mix-in that provides informational APIs needed for analysis passes.

A special type used by analysis passes to provide an address that identifies that particular analysis...

static ChildIteratorType child_begin(NodeRef N)

Definition LazyCallGraph.h:1258

LazyCallGraph::EdgeSequence::iterator ChildIteratorType

Definition LazyCallGraph.h:1255

LazyCallGraph::Node * NodeRef

Definition LazyCallGraph.h:1254

static ChildIteratorType child_end(NodeRef N)

Definition LazyCallGraph.h:1259

static NodeRef getEntryNode(NodeRef N)

Definition LazyCallGraph.h:1257

static NodeRef getEntryNode(NodeRef N)

Definition LazyCallGraph.h:1249

static ChildIteratorType child_end(NodeRef N)

Definition LazyCallGraph.h:1251

LazyCallGraph::EdgeSequence::iterator ChildIteratorType

Definition LazyCallGraph.h:1247

LazyCallGraph::Node * NodeRef

Definition LazyCallGraph.h:1246

static ChildIteratorType child_begin(NodeRef N)

Definition LazyCallGraph.h:1250

A CRTP mix-in to automatically provide informational APIs needed for passes.

An iterator type that allows iterating over the pointees via some other iterator.