summaryrefslogtreecommitdiff
path: root/compiler/sea_ir/code_gen.cc
diff options
context:
space:
mode:
author Dragos Sbirlea <dragoss@google.com> 2013-07-31 13:37:31 -0700
committer Dragos Sbirlea <dragoss@google.com> 2013-08-01 10:37:12 -0700
commitb40eddfc96b9ac235dea562e55ce2ad7b1cfb7c9 (patch)
tree9f33a14f2dd37980ff7e0434f913ad2aa91b1b2f /compiler/sea_ir/code_gen.cc
parent8d4fb0eb94ea3dd5db9461230e2c11926e4ebdb4 (diff)
Added SEA IR type infrastructure (and a bit of cleanup).
compiler/Android.mk: Added new files to compile. instruction_nodes.h, code_gen.cc: Renamed GetSSAUses to GetSSAProducers to avoid confusion (uses of what?). sea.cc: Added invoke of type inference framework. sea.h: Expose dex_file through GetDexFile(). Added GetPositionInSIgnature() for SignatureNodes. sea.cc: Cleanup of debug output. visitor.h: Removed dependence on LLVM (now only in code_gen.*). Corrected minor typo in comment. frontend.cc: Renamed access_flags for clarity. Change-Id: I211d2e9ff1e0c4f910de73a52a5ac2c50e4ca7df
Diffstat (limited to 'compiler/sea_ir/code_gen.cc')
-rw-r--r--compiler/sea_ir/code_gen.cc14
1 files changed, 7 insertions, 7 deletions
diff --git a/compiler/sea_ir/code_gen.cc b/compiler/sea_ir/code_gen.cc
index a513907b38..0ef21b4800 100644
--- a/compiler/sea_ir/code_gen.cc
+++ b/compiler/sea_ir/code_gen.cc
@@ -123,14 +123,14 @@ void CodeGenVisitor::Visit(ConstInstructionNode* instruction) {
void CodeGenVisitor::Visit(ReturnInstructionNode* instruction) {
std::string instr = instruction->GetInstruction()->DumpString(NULL);
std::cout << "2.Instruction: " << instr << std::endl;
- DCHECK_GT(instruction->GetSSAUses().size(), 0u);
- llvm::Value* return_value = llvm_data_->GetValue(instruction->GetSSAUses().at(0));
+ DCHECK_GT(instruction->GetSSAProducers().size(), 0u);
+ llvm::Value* return_value = llvm_data_->GetValue(instruction->GetSSAProducers().at(0));
llvm_data_->builder_.CreateRet(return_value);
}
void CodeGenVisitor::Visit(IfNeInstructionNode* instruction) {
std::string instr = instruction->GetInstruction()->DumpString(NULL);
std::cout << "3.Instruction: " << instr << std::endl;
- std::vector<InstructionNode*> ssa_uses = instruction->GetSSAUses();
+ std::vector<InstructionNode*> ssa_uses = instruction->GetSSAProducers();
DCHECK_GT(ssa_uses.size(), 1u);
InstructionNode* use_l = ssa_uses.at(0);
llvm::Value* left = llvm_data_->GetValue(use_l);
@@ -171,7 +171,7 @@ void CodeGenVisitor::Visit(MoveResultInstructionNode* instruction) {
// since their purpose of minimizing the number of opcodes in dex is
// not relevant for the IR. (Will need to have different
// instruction subclasses for functions and procedures.)
- std::vector<InstructionNode*> ssa_uses = instruction->GetSSAUses();
+ std::vector<InstructionNode*> ssa_uses = instruction->GetSSAProducers();
InstructionNode* use_l = ssa_uses.at(0);
llvm::Value* left = llvm_data_->GetValue(use_l);
llvm::Value* right = llvm::ConstantInt::get(*llvm_data_->context_, llvm::APInt(32, 0));
@@ -187,7 +187,7 @@ void CodeGenVisitor::Visit(InvokeStaticInstructionNode* invoke) {
// TODO: Add proper checking of the matching between formal and actual signature.
DCHECK(NULL != callee);
std::vector<llvm::Value*> parameter_values;
- std::vector<InstructionNode*> parameter_sources = invoke->GetSSAUses();
+ std::vector<InstructionNode*> parameter_sources = invoke->GetSSAProducers();
for (std::vector<InstructionNode*>::const_iterator cit = parameter_sources.begin();
cit != parameter_sources.end(); ++cit) {
llvm::Value* parameter_value = llvm_data_->GetValue((*cit));
@@ -201,7 +201,7 @@ void CodeGenVisitor::Visit(InvokeStaticInstructionNode* invoke) {
void CodeGenVisitor::Visit(AddIntInstructionNode* instruction) {
std::string instr = instruction->GetInstruction()->DumpString(NULL);
std::cout << "7.Instruction: " << instr << std::endl;
- std::vector<InstructionNode*> ssa_uses = instruction->GetSSAUses();
+ std::vector<InstructionNode*> ssa_uses = instruction->GetSSAProducers();
DCHECK_GT(ssa_uses.size(), 1u);
InstructionNode* use_l = ssa_uses.at(0);
InstructionNode* use_r = ssa_uses.at(1);
@@ -221,7 +221,7 @@ void CodeGenVisitor::Visit(GotoInstructionNode* instruction) {
void CodeGenVisitor::Visit(IfEqzInstructionNode* instruction) {
std::string instr = instruction->GetInstruction()->DumpString(NULL);
std::cout << "9. Instruction: " << instr << "; Id: " <<instruction << std::endl;
- std::vector<InstructionNode*> ssa_uses = instruction->GetSSAUses();
+ std::vector<InstructionNode*> ssa_uses = instruction->GetSSAProducers();
DCHECK_GT(ssa_uses.size(), 0u);
InstructionNode* use_l = ssa_uses.at(0);
llvm::Value* left = llvm_data_->GetValue(use_l);