From f0504cdc5b6400edd4b39eea64ac280465042d5b Mon Sep 17 00:00:00 2001 From: buzbee Date: Tue, 13 Nov 2012 16:31:10 -0800 Subject: Quick backend: rename target-specific #defines Another step towards a single compiler. The #include build mechanism relies on macros with the same name to take on different values for our various targets. This CL prepends a target-specific string (and exposes some needed by common code as functions rather than #defines). Macros and #defines still available for use from target-dependent code, but functions added for target independent use. For example, rRET0 for Arm becomes rARM_RET0 in target-dependent code, and targetRegister(kRet0) in target-independent code. No logic changes, other than adding functions to return previously #defined values. As of this CL, the primary target includes, xxxLIR.h, have no macro collisions. Change-Id: I5e11df844815b7d129b525a209dd7c46bd9a4a09 --- src/compiler/codegen/MethodCodegenDriver.cc | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'src/compiler/codegen/MethodCodegenDriver.cc') diff --git a/src/compiler/codegen/MethodCodegenDriver.cc b/src/compiler/codegen/MethodCodegenDriver.cc index 8fd6045a8d..3170abc7f0 100644 --- a/src/compiler/codegen/MethodCodegenDriver.cc +++ b/src/compiler/codegen/MethodCodegenDriver.cc @@ -25,8 +25,8 @@ const RegLocation badLoc = {kLocDalvikFrame, 0, 0, 0, 0, 0, 0, 0, 0, /* Mark register usage state and return long retloc */ RegLocation oatGetReturnWide(CompilationUnit* cUnit, bool isDouble) { - RegLocation gpr_res = LOC_C_RETURN_WIDE; - RegLocation fpr_res = LOC_C_RETURN_WIDE_DOUBLE; + RegLocation gpr_res = locCReturnWide(); + RegLocation fpr_res = locCReturnDouble(); RegLocation res = isDouble ? fpr_res : gpr_res; oatClobber(cUnit, res.lowReg); oatClobber(cUnit, res.highReg); @@ -38,8 +38,8 @@ RegLocation oatGetReturnWide(CompilationUnit* cUnit, bool isDouble) RegLocation oatGetReturn(CompilationUnit* cUnit, bool isFloat) { - RegLocation gpr_res = LOC_C_RETURN; - RegLocation fpr_res = LOC_C_RETURN_FLOAT; + RegLocation gpr_res = locCReturn(); + RegLocation fpr_res = locCReturnFloat(); RegLocation res = isFloat ? fpr_res : gpr_res; oatClobber(cUnit, res.lowReg); if (cUnit->instructionSet == kMips) { @@ -126,10 +126,11 @@ void genInvoke(CompilationUnit* cUnit, CallInfo* info) } LIR* callInst; if (cUnit->instructionSet != kX86) { - callInst = opReg(cUnit, kOpBlx, rINVOKE_TGT); + callInst = opReg(cUnit, kOpBlx, targetReg(kInvokeTgt)); } else { if (fastPath && info->type != kInterface) { - callInst = opMem(cUnit, kOpBlx, rARG0, AbstractMethod::GetCodeOffset().Int32Value()); + callInst = opMem(cUnit, kOpBlx, targetReg(kArg0), + AbstractMethod::GetCodeOffset().Int32Value()); } else { int trampoline = 0; switch (info->type) { -- cgit v1.2.3-59-g8ed1b