]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm/tools/clang/include/clang/CodeGen/CodeGenAction.h
Upgrade to OpenSSH 5.6p1.
[FreeBSD/FreeBSD.git] / contrib / llvm / tools / clang / include / clang / CodeGen / CodeGenAction.h
1 //===--- CodeGenAction.h - LLVM Code Generation Frontend Action -*- C++ -*-===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9
10 #ifndef LLVM_CLANG_CODEGEN_CODE_GEN_ACTION_H
11 #define LLVM_CLANG_CODEGEN_CODE_GEN_ACTION_H
12
13 #include "clang/Frontend/FrontendAction.h"
14 #include "llvm/ADT/OwningPtr.h"
15
16 namespace llvm {
17   class Module;
18 }
19
20 namespace clang {
21
22 class CodeGenAction : public ASTFrontendAction {
23 private:
24   unsigned Act;
25   llvm::OwningPtr<llvm::Module> TheModule;
26
27 protected:
28   CodeGenAction(unsigned _Act);
29
30   virtual bool hasIRSupport() const;
31
32   virtual ASTConsumer *CreateASTConsumer(CompilerInstance &CI,
33                                          llvm::StringRef InFile);
34
35   virtual void ExecuteAction();
36
37   virtual void EndSourceFileAction();
38
39 public:
40   ~CodeGenAction();
41
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();
45 };
46
47 class EmitAssemblyAction : public CodeGenAction {
48 public:
49   EmitAssemblyAction();
50 };
51
52 class EmitBCAction : public CodeGenAction {
53 public:
54   EmitBCAction();
55 };
56
57 class EmitLLVMAction : public CodeGenAction {
58 public:
59   EmitLLVMAction();
60 };
61
62 class EmitLLVMOnlyAction : public CodeGenAction {
63 public:
64   EmitLLVMOnlyAction();
65 };
66
67 class EmitCodeGenOnlyAction : public CodeGenAction {
68 public:
69   EmitCodeGenOnlyAction();
70 };
71
72 class EmitObjAction : public CodeGenAction {
73 public:
74   EmitObjAction();
75 };
76
77 }
78
79 #endif