diff options
| author | 2012-02-21 19:14:55 +0800 | |
|---|---|---|
| committer | 2012-02-29 17:11:27 -0800 | |
| commit | 8b977d38483aaa08abcbdaa5fa888076c1142169 (patch) | |
| tree | ae61c7cb1c397582f22c5c585bb0b531fd8f59b0 /src/compiler_llvm/compiler_llvm.h | |
| parent | 88894ee835411de72025cd8a5d8d111a6f2a004a (diff) | |
Compile llvm.Module into ELF object file.
Change-Id: I8faf7427944324c9bac12573d217cde2a2e658f1
Diffstat (limited to 'src/compiler_llvm/compiler_llvm.h')
| -rw-r--r-- | src/compiler_llvm/compiler_llvm.h | 31 |
1 files changed, 17 insertions, 14 deletions
diff --git a/src/compiler_llvm/compiler_llvm.h b/src/compiler_llvm/compiler_llvm.h index 29d32a54bf..208edfcd22 100644 --- a/src/compiler_llvm/compiler_llvm.h +++ b/src/compiler_llvm/compiler_llvm.h @@ -47,6 +47,7 @@ namespace llvm { namespace art { namespace compiler_llvm { +class CompilationUnit; class IRBuilder; class CompilerLLVM { @@ -55,9 +56,7 @@ class CompilerLLVM { ~CompilerLLVM(); - void MaterializeLLVMModule(); - - void WriteBitcodeToFile(std::string const &filename); + void MaterializeEveryCompilationUnit(); Compiler* GetCompiler() const { return compiler_; @@ -67,16 +66,12 @@ class CompilerLLVM { return insn_set_; } - llvm::Module* GetModule() const { - return module_; - } - - llvm::LLVMContext* GetLLVMContext() const { - return context_.get(); + void SetElfFileName(std::string const& filename) { + elf_filename_ = filename; } - IRBuilder* GetIRBuilder() const { - return irb_.get(); + void SetBitcodeFileName(std::string const& filename) { + bitcode_filename_ = filename; } CompiledMethod* CompileDexMethod(OatCompilationUnit* oat_compilation_unit); @@ -86,17 +81,25 @@ class CompilerLLVM { CompiledInvokeStub* CreateInvokeStub(bool is_static, char const *shorty); private: + void EnsureCompilationUnit(); + + void MaterializeCompilationUnit(); + + void MaterializeCompilationUnitSafePoint(); + Compiler* compiler_; Mutex compiler_lock_; InstructionSet insn_set_; - UniquePtr<llvm::LLVMContext> context_; + UniquePtr<CompilationUnit> cunit_; + + unsigned cunit_counter_; - UniquePtr<IRBuilder> irb_; + std::string elf_filename_; - llvm::Module* module_; + std::string bitcode_filename_; DISALLOW_COPY_AND_ASSIGN(CompilerLLVM); }; |