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

1

2

3

4

5

6

7

8

9

10

11

12

13#ifndef LLVM_PASSINFO_H

14#define LLVM_PASSINFO_H

15

17#include

18

19namespace llvm {

20

22

23

24

25

26

27

28

30public:

32

33private:

34 StringRef PassName;

35 StringRef PassArgument;

36 const void *PassID;

37 const bool IsCFGOnlyPass = false;

38 const bool IsAnalysis;

40

41public:

42

43

45 bool isCFGOnly, bool is_analysis)

46 : PassName(name), PassArgument(arg), PassID(pi), IsCFGOnlyPass(isCFGOnly),

47 IsAnalysis(is_analysis), NormalCtor(normal) {}

48

51

52

54

55

56

57

59

60

61

62 const void *getTypeInfo() const { return PassID; }

63

64

65 bool isPassID(const void *IDPtr) const { return PassID == IDPtr; }

66

67 bool isAnalysis() const { return IsAnalysis; }

68

69

70

72

73

74

75

77 return NormalCtor;

78 }

80 NormalCtor = Ctor;

81 }

82

83

86 "Cannot call createPass on PassInfo without default ctor!");

87 return NormalCtor();

88 }

89};

90

91}

92

93#endif

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

bool isPassID(const void *IDPtr) const

Return true if this PassID implements the specified ID pointer.

Definition PassInfo.h:65

PassInfo & operator=(const PassInfo &)=delete

Pass *(*)() NormalCtor_t

Definition PassInfo.h:31

NormalCtor_t getNormalCtor() const

getNormalCtor - Return a pointer to a function, that when called, creates an instance of the pass and...

Definition PassInfo.h:76

bool isAnalysis() const

Definition PassInfo.h:67

PassInfo(const PassInfo &)=delete

void setNormalCtor(NormalCtor_t Ctor)

Definition PassInfo.h:79

PassInfo(StringRef name, StringRef arg, const void *pi, NormalCtor_t normal, bool isCFGOnly, bool is_analysis)

PassInfo ctor - Do not call this directly, this should only be invoked through RegisterPass.

Definition PassInfo.h:44

StringRef getPassArgument() const

getPassArgument - Return the command line option that may be passed to 'opt' that will cause this pas...

Definition PassInfo.h:58

StringRef getPassName() const

getPassName - Return the friendly name for the pass, never returns null

Definition PassInfo.h:53

bool isCFGOnlyPass() const

isCFGOnlyPass - return true if this pass only looks at the CFG for the function.

Definition PassInfo.h:71

Pass * createPass() const

createPass() - Use this method to create an instance of this pass.

Definition PassInfo.h:84

const void * getTypeInfo() const

getTypeInfo - Return the id object for the pass... TODO : Rename

Definition PassInfo.h:62

Pass interface - Implemented by all 'passes'.

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

This is an optimization pass for GlobalISel generic memory operations.