diff options
author | Andreas Gampe <agampe@google.com> | 2014-11-03 22:57:30 -0800 |
---|---|---|
committer | Andreas Gampe <agampe@google.com> | 2014-11-03 23:40:41 -0800 |
commit | 785d2f2116bb57418d81bb55b55a087afee11053 (patch) | |
tree | 34e7ea4f2c7473c8fe173c64451b4153fc909cd7 /compiler/dex/mir_optimization.cc | |
parent | 07f09809c0575e985249450843b06f266b831fe1 (diff) | |
download | art-785d2f2116bb57418d81bb55b55a087afee11053.tar.gz art-785d2f2116bb57418d81bb55b55a087afee11053.tar.bz2 art-785d2f2116bb57418d81bb55b55a087afee11053.zip |
ART: Replace COMPILE_ASSERT with static_assert (compiler)
Replace all occurrences of COMPILE_ASSERT in the compiler tree.
Change-Id: Icc40a38c8bdeaaf7305ab3352a838a2cd7e7d840
Diffstat (limited to 'compiler/dex/mir_optimization.cc')
-rw-r--r-- | compiler/dex/mir_optimization.cc | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/compiler/dex/mir_optimization.cc b/compiler/dex/mir_optimization.cc index 8e583ccff..846dbb79b 100644 --- a/compiler/dex/mir_optimization.cc +++ b/compiler/dex/mir_optimization.cc @@ -215,8 +215,8 @@ static constexpr ConditionCode kIfCcZConditionCodes[] = { kCondEq, kCondNe, kCondLt, kCondGe, kCondGt, kCondLe }; -COMPILE_ASSERT(arraysize(kIfCcZConditionCodes) == Instruction::IF_LEZ - Instruction::IF_EQZ + 1, - if_ccz_ccodes_size1); +static_assert(arraysize(kIfCcZConditionCodes) == Instruction::IF_LEZ - Instruction::IF_EQZ + 1, + "if_ccz_ccodes_size1"); static constexpr bool IsInstructionIfCcZ(Instruction::Code opcode) { return Instruction::IF_EQZ <= opcode && opcode <= Instruction::IF_LEZ; @@ -226,12 +226,12 @@ static constexpr ConditionCode ConditionCodeForIfCcZ(Instruction::Code opcode) { return kIfCcZConditionCodes[opcode - Instruction::IF_EQZ]; } -COMPILE_ASSERT(ConditionCodeForIfCcZ(Instruction::IF_EQZ) == kCondEq, check_if_eqz_ccode); -COMPILE_ASSERT(ConditionCodeForIfCcZ(Instruction::IF_NEZ) == kCondNe, check_if_nez_ccode); -COMPILE_ASSERT(ConditionCodeForIfCcZ(Instruction::IF_LTZ) == kCondLt, check_if_ltz_ccode); -COMPILE_ASSERT(ConditionCodeForIfCcZ(Instruction::IF_GEZ) == kCondGe, check_if_gez_ccode); -COMPILE_ASSERT(ConditionCodeForIfCcZ(Instruction::IF_GTZ) == kCondGt, check_if_gtz_ccode); -COMPILE_ASSERT(ConditionCodeForIfCcZ(Instruction::IF_LEZ) == kCondLe, check_if_lez_ccode); +static_assert(ConditionCodeForIfCcZ(Instruction::IF_EQZ) == kCondEq, "if_eqz ccode"); +static_assert(ConditionCodeForIfCcZ(Instruction::IF_NEZ) == kCondNe, "if_nez ccode"); +static_assert(ConditionCodeForIfCcZ(Instruction::IF_LTZ) == kCondLt, "if_ltz ccode"); +static_assert(ConditionCodeForIfCcZ(Instruction::IF_GEZ) == kCondGe, "if_gez ccode"); +static_assert(ConditionCodeForIfCcZ(Instruction::IF_GTZ) == kCondGt, "if_gtz ccode"); +static_assert(ConditionCodeForIfCcZ(Instruction::IF_LEZ) == kCondLe, "if_lez ccode"); int MIRGraph::GetSSAUseCount(int s_reg) { DCHECK_LT(static_cast<size_t>(s_reg), ssa_subscripts_.size()); @@ -1087,7 +1087,7 @@ void MIRGraph::EliminateNullChecksEnd() { for (BasicBlock* bb = iter.Next(); bb != nullptr; bb = iter.Next()) { for (MIR* mir = bb->first_mir_insn; mir != NULL; mir = mir->next) { constexpr int kMarkToIgnoreNullCheckShift = kMIRMark - kMIRIgnoreNullCheck; - COMPILE_ASSERT(kMarkToIgnoreNullCheckShift > 0, check_valid_shift_right); + static_assert(kMarkToIgnoreNullCheckShift > 0, "Not a valid right-shift"); uint16_t mirMarkAdjustedToIgnoreNullCheck = (mir->optimization_flags & MIR_MARK) >> kMarkToIgnoreNullCheckShift; mir->optimization_flags |= mirMarkAdjustedToIgnoreNullCheck; |