1 //===--- CodeGenAction.h - LLVM Code Generation Frontend Action -*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #ifndef LLVM_CLANG_CODEGEN_CODE_GEN_ACTION_H
11 #define LLVM_CLANG_CODEGEN_CODE_GEN_ACTION_H
13 #include "clang/Frontend/FrontendAction.h"
14 #include "llvm/ADT/OwningPtr.h"
22 class CodeGenAction : public ASTFrontendAction {
25 llvm::OwningPtr<llvm::Module> TheModule;
28 CodeGenAction(unsigned _Act);
30 virtual bool hasIRSupport() const;
32 virtual ASTConsumer *CreateASTConsumer(CompilerInstance &CI,
33 llvm::StringRef InFile);
35 virtual void ExecuteAction();
37 virtual void EndSourceFileAction();
42 /// takeModule - Take the generated LLVM module, for use after the action has
43 /// been run. The result may be null on failure.
44 llvm::Module *takeModule();
47 class EmitAssemblyAction : public CodeGenAction {
52 class EmitBCAction : public CodeGenAction {
57 class EmitLLVMAction : public CodeGenAction {
62 class EmitLLVMOnlyAction : public CodeGenAction {
67 class EmitCodeGenOnlyAction : public CodeGenAction {
69 EmitCodeGenOnlyAction();
72 class EmitObjAction : public CodeGenAction {