clang: include/clang/CodeGen/CodeGenAction.h Source File (original) (raw)

1

2

3

4

5

6

7

8

9#ifndef LLVM_CLANG_CODEGEN_CODEGENACTION_H

10#define LLVM_CLANG_CODEGEN_CODEGENACTION_H

11

13#include

14

15namespace llvm {

16 class LLVMContext;

18}

19

21class BackendConsumer;

22class CodeGenerator;

23

25private:

26

28

29

30 struct LinkModule {

31

32 std::unique_ptrllvm::Module Module;

33

34

35

36

37 bool PropagateAttrs;

38

39

40 bool Internalize;

41

42

43 unsigned LinkFlags;

44 };

45

46 unsigned Act;

47 std::unique_ptrllvm::Module TheModule;

48

49

51 llvm::LLVMContext *VMContext;

52 bool OwnsVMContext;

53

54 std::unique_ptrllvm::Module loadModule(llvm::MemoryBufferRef MBRef);

55

56

58

59protected:

61

62

63

64

65 CodeGenAction(unsigned _Act, llvm::LLVMContext *_VMContext = nullptr);

66

68

70 StringRef InFile) override;

71

73

75

76public:

78

79

80

81 std::unique_ptrllvm::Module takeModule();

82

83

85

87

89};

90

92 virtual void anchor();

93public:

95};

96

98 virtual void anchor();

99public:

100 EmitBCAction(llvm::LLVMContext *_VMContext = nullptr);

101};

102

104 virtual void anchor();

105public:

106 EmitLLVMAction(llvm::LLVMContext *_VMContext = nullptr);

107};

108

110 virtual void anchor();

111public:

113};

114

116 virtual void anchor();

117public:

119};

120

122 virtual void anchor();

123public:

124 EmitObjAction(llvm::LLVMContext *_VMContext = nullptr);

125};

126

127}

128

129#endif

Defines the clang::FrontendAction interface and various convenience abstract classes (clang::ASTFront...

Abstract base class to use for AST consumer-based frontend actions.

std::unique_ptr< ASTConsumer > CreateASTConsumer(CompilerInstance &CI, StringRef InFile) override

Create the AST consumer object for this action, if supported.

CodeGenerator * getCodeGenerator() const

void EndSourceFileAction() override

Callback at the end of processing a single input.

bool BeginSourceFileAction(CompilerInstance &CI) override

Callback at the start of processing a single input.

~CodeGenAction() override

llvm::LLVMContext * takeLLVMContext()

Take the LLVM context used by this action.

BackendConsumer * BEConsumer

bool hasIRSupport() const override

Does this action support use with IR files?

void ExecuteAction() override

Callback to run the program action, using the initialized compiler instance.

std::unique_ptr< llvm::Module > takeModule()

Take the generated LLVM module, for use after the action has been run.

The primary public interface to the Clang code generator.

CompilerInstance - Helper class for managing a single instance of the Clang compiler.

Describes a module or submodule.

The JSON file list parser is used to communicate input to InstallAPI.

@ Module

Module linkage, which indicates that the entity can be referred to from other translation units withi...

Diagnostic wrappers for TextAPI types for error reporting.