Logan Chien | f04364f | 2012-02-10 12:01:39 +0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2012 The Android Open Source Project |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
| 17 | #ifndef ART_SRC_COMPILER_LLVM_UPCALL_COMPILER_H_ |
| 18 | #define ART_SRC_COMPILER_LLVM_UPCALL_COMPILER_H_ |
| 19 | |
| 20 | #include "constants.h" |
| 21 | |
| 22 | #include <stdint.h> |
| 23 | |
| 24 | namespace art { |
| 25 | class CompiledInvokeStub; |
| 26 | class Compiler; |
| 27 | } |
| 28 | |
| 29 | namespace llvm { |
| 30 | class LLVMContext; |
| 31 | class Module; |
| 32 | } |
| 33 | |
| 34 | namespace art { |
| 35 | namespace compiler_llvm { |
| 36 | |
| 37 | class CompilerLLVM; |
| 38 | class IRBuilder; |
| 39 | |
| 40 | class UpcallCompiler { |
| 41 | public: |
| 42 | UpcallCompiler(InstructionSet insn_set, Compiler& compiler); |
| 43 | |
| 44 | CompiledInvokeStub* CreateStub(bool is_static, char const* shorty); |
| 45 | |
| 46 | private: |
| 47 | InstructionSet insn_set_; |
| 48 | Compiler const* compiler_; |
| 49 | CompilerLLVM* compiler_llvm_; |
| 50 | llvm::Module* module_; |
| 51 | llvm::LLVMContext* context_; |
| 52 | IRBuilder& irb_; |
| 53 | }; |
| 54 | |
| 55 | |
| 56 | } // namespace compiler_llvm |
| 57 | } // namespace art |
| 58 | |
| 59 | |
| 60 | #endif // ART_SRC_COMPILER_LLVM_UPCALL_COMPILER_H_ |