blob: cf0ea3ec4b60cd95ff82fa135587543a2bd33480 [file] [log] [blame]
Shih-wei Liaod1fec812012-02-13 09:51:10 -08001/*
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#include "method_compiler.h"
18
19#include "compiler.h"
20#include "ir_builder.h"
21#include "logging.h"
22#include "object.h"
23#include "object_utils.h"
24#include "stl_util.h"
25
26#include <iomanip>
27
28#include <llvm/Analysis/Verifier.h>
29#include <llvm/Function.h>
30
Logan Chien83426162011-12-09 09:29:50 +080031namespace art {
32namespace compiler_llvm {
Shih-wei Liaod1fec812012-02-13 09:51:10 -080033
34
Logan Chien83426162011-12-09 09:29:50 +080035MethodCompiler::MethodCompiler(InstructionSet insn_set,
36 Compiler* compiler,
37 ClassLinker* class_linker,
38 ClassLoader const* class_loader,
39 DexFile const* dex_file,
40 DexCache* dex_cache,
41 DexFile::CodeItem const* code_item,
Shih-wei Liaod1fec812012-02-13 09:51:10 -080042 uint32_t method_idx,
43 uint32_t access_flags)
44: insn_set_(insn_set),
45 compiler_(compiler), compiler_llvm_(compiler->GetCompilerLLVM()),
46 class_linker_(class_linker), class_loader_(class_loader),
47 dex_file_(dex_file), dex_cache_(dex_cache), code_item_(code_item),
48 method_(dex_cache->GetResolvedMethod(method_idx)),
49 method_helper_(method_), method_idx_(method_idx),
50 access_flags_(access_flags), module_(compiler_llvm_->GetModule()),
51 context_(compiler_llvm_->GetLLVMContext()),
52 irb_(*compiler_llvm_->GetIRBuilder()), func_(NULL) {
53}
54
55
56MethodCompiler::~MethodCompiler() {
57}
58
59
60void MethodCompiler::EmitPrologue() {
Logan Chien83426162011-12-09 09:29:50 +080061 // UNIMPLEMENTED(WARNING);
Shih-wei Liaod1fec812012-02-13 09:51:10 -080062}
63
64
Logan Chien83426162011-12-09 09:29:50 +080065void MethodCompiler::EmitInstructions() {
66 // UNIMPLEMENTED(WARNING);
Shih-wei Liaod1fec812012-02-13 09:51:10 -080067}
68
69
Logan Chien83426162011-12-09 09:29:50 +080070void MethodCompiler::EmitInstruction(uint32_t dex_pc,
71 Instruction const* insn) {
72 // UNIMPLEMENTED(WARNING);
Shih-wei Liaod1fec812012-02-13 09:51:10 -080073}
74
75
Logan Chien83426162011-12-09 09:29:50 +080076CompiledMethod *MethodCompiler::Compile() {
77 // UNIMPLEMENTED(WARNING);
78 return new CompiledMethod(insn_set_, NULL);
Shih-wei Liaod1fec812012-02-13 09:51:10 -080079}
Logan Chien83426162011-12-09 09:29:50 +080080
81
82} // namespace compiler_llvm
83} // namespace art