LLVM: lib/Transforms/IPO/StripDeadPrototypes.cpp Source File (original) (raw)

Go to the documentation of this file.

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

19

20using namespace llvm;

21

22#define DEBUG_TYPE "strip-dead-prototypes"

23

24STATISTIC(NumDeadPrototypes, "Number of dead prototypes removed");

25

27 bool MadeChange = false;

28

29

31

32 if (F.isDeclaration() && F.use_empty()) {

33 F.eraseFromParent();

34 ++NumDeadPrototypes;

35 MadeChange = true;

36 }

37 }

38

39

41

42 if (GV.isDeclaration() && GV.use_empty())

43 GV.eraseFromParent();

44 }

45

46

47 return MadeChange;

48}

49

Module.h This file contains the declarations for the Module class.

This file defines the 'Statistic' class, which is designed to be an easy way to expose various metric...

#define STATISTIC(VARNAME, DESC)

static bool stripDeadPrototypes(Module &M)

Definition StripDeadPrototypes.cpp:26

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

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

static PreservedAnalyses none()

Convenience factory function for the empty preserved set.

static PreservedAnalyses all()

Construct a special preserved set that preserves all passes.

This is an optimization pass for GlobalISel generic memory operations.

iterator_range< early_inc_iterator_impl< detail::IterOfRange< RangeT > > > make_early_inc_range(RangeT &&Range)

Make a range that does early increment to allow mutation of the underlying range without disrupting i...

AnalysisManager< Module > ModuleAnalysisManager

Convenience typedef for the Module analysis manager.

LLVM_ABI PreservedAnalyses run(Module &M, ModuleAnalysisManager &)

Definition StripDeadPrototypes.cpp:50