class CodeGenerator
Declaration
class CodeGenerator : public ASTConsumer { /* full declaration omitted */ };
Description
The primary public interface to the Clang code generator. This is not really an abstract interface.
Declared at: clang/include/clang/CodeGen/ModuleBuilder.h:48
Inherits from: ASTConsumer
Member Variables
Method Overview
- public CodeGen::CodeGenModule & CGM()
- public llvm::Constant * GetAddrOfGlobal(clang::GlobalDecl decl, bool isForDefinition)
- public const clang::Decl * GetDeclForMangledName(llvm::StringRef MangledName)
- public llvm::StringRef GetMangledName(clang::GlobalDecl GD)
- public llvm::Module * GetModule()
- public llvm::Module * ReleaseModule()
- public llvm::Module * StartModule(llvm::StringRef ModuleName, llvm::LLVMContext & C)
- private virtual void anchor()
- public CodeGen::CGDebugInfo * getCGDebugInfo()
Inherited from ASTConsumer:
- public AssignInheritanceModel
- public CompleteExternalDeclaration
- public CompleteTentativeDefinition
- public GetASTDeserializationListener
- public GetASTMutationListener
- public HandleCXXImplicitFunctionInstantiation
- public HandleCXXStaticMemberVarInstantiation
- public HandleImplicitImportDecl
- public HandleInlineFunctionDefinition
- public HandleInterestingDecl
- public HandleTagDeclDefinition
- public HandleTagDeclRequiredDefinition
- public HandleTopLevelDecl
- public HandleTopLevelDeclInObjCContainer
- public HandleTranslationUnit
- public HandleVTable
- public Initialize
- public PrintStats
- public shouldSkipFunctionBody
Methods
¶CodeGen::CodeGenModule& CGM()
CodeGen::CodeGenModule& CGM()
Description
Return an opaque reference to the CodeGenModule object, which can be used in various secondary APIs. It is valid as long as the CodeGenerator exists.
Declared at: clang/include/clang/CodeGen/ModuleBuilder.h:55
¶llvm::Constant* GetAddrOfGlobal(
clang::GlobalDecl decl,
bool isForDefinition)
llvm::Constant* GetAddrOfGlobal(
clang::GlobalDecl decl,
bool isForDefinition)
Description
Return the LLVM address of the given global entity.
Declared at: clang/include/clang/CodeGen/ModuleBuilder.h:94
Parameters
- clang::GlobalDecl decl
- bool isForDefinition
- If true, the caller intends to define the entity; the object returned will be an llvm::GlobalValue of some sort. If false, the caller just intends to use the entity; the object returned may be any sort of constant value, and the code generator will schedule the entity for emission if a definition has been registered with this code generator.
¶const clang::Decl* GetDeclForMangledName(
llvm::StringRef MangledName)
const clang::Decl* GetDeclForMangledName(
llvm::StringRef MangledName)
Description
Given a mangled name, return a declaration which mangles that way which has been added to this code generator via a Handle method. This may return null if there was no matching declaration.
Declared at: clang/include/clang/CodeGen/ModuleBuilder.h:80
Parameters
- llvm::StringRef MangledName
¶llvm::StringRef GetMangledName(
clang::GlobalDecl GD)
llvm::StringRef GetMangledName(
clang::GlobalDecl GD)
Description
Given a global declaration, return a mangled name for this declaration which has been added to this code generator via a Handle method.
Declared at: clang/include/clang/CodeGen/ModuleBuilder.h:84
Parameters
¶llvm::Module* GetModule()
llvm::Module* GetModule()
Description
Return the module that this code generator is building into. This may return null after HandleTranslationUnit is called; this signifies that there was an error generating code. A diagnostic will have been generated in this case, and the module will be deleted. It will also return null if the module is released.
Declared at: clang/include/clang/CodeGen/ModuleBuilder.h:65
¶llvm::Module* ReleaseModule()
llvm::Module* ReleaseModule()
Description
Release ownership of the module to the caller. It is illegal to call methods other than GetModule on the CodeGenerator after releasing its module.
Declared at: clang/include/clang/CodeGen/ModuleBuilder.h:71
¶llvm::Module* StartModule(
llvm::StringRef ModuleName,
llvm::LLVMContext& C)
llvm::Module* StartModule(
llvm::StringRef ModuleName,
llvm::LLVMContext& C)
Description
Create a new \c llvm::Module after calling HandleTranslationUnit. This enable codegen in interactive processing environments.
Declared at: clang/include/clang/CodeGen/ModuleBuilder.h:98
Parameters
- llvm::StringRef ModuleName
- llvm::LLVMContext& C
¶virtual void anchor()
virtual void anchor()
Declared at: clang/include/clang/CodeGen/ModuleBuilder.h:49
¶CodeGen::CGDebugInfo* getCGDebugInfo()
CodeGen::CGDebugInfo* getCGDebugInfo()
Description
Return debug info code generator.
Declared at: clang/include/clang/CodeGen/ModuleBuilder.h:74