diff options
| author | 2015-07-08 16:44:00 +0100 | |
|---|---|---|
| committer | 2015-07-08 19:02:18 +0100 | |
| commit | 6cd788f2b00e6a8149f46a17aab9162314960c00 (patch) | |
| tree | f40acd7129e406a5774b2cbd39233bb48277bf5b /compiler/optimizing/builder.cc | |
| parent | 4880fd5695ea1726dde27bb448dae1338d0a0973 (diff) | |
Address small comments in HGraphBuilder
Change-Id: Ife0a19f6e07146c8e03922f1330527d092f5e236
Diffstat (limited to 'compiler/optimizing/builder.cc')
| -rw-r--r-- | compiler/optimizing/builder.cc | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/compiler/optimizing/builder.cc b/compiler/optimizing/builder.cc index 8bf744d0e5..bb1b40a1b5 100644 --- a/compiler/optimizing/builder.cc +++ b/compiler/optimizing/builder.cc @@ -272,11 +272,7 @@ static const DexFile::TryItem* GetTryItem(HBasicBlock* block, // Instructions in the block may throw. Find a TryItem covering this block. int32_t try_item_idx = DexFile::FindTryItem(code_item, block->GetDexPc()); - if (try_item_idx == -1) { - return nullptr; - } else { - return DexFile::GetTryItems(code_item, try_item_idx); - } + return (try_item_idx == -1) ? nullptr : DexFile::GetTryItems(code_item, try_item_idx); } void HGraphBuilder::CreateBlocksForTryCatch(const DexFile::CodeItem& code_item) { @@ -357,13 +353,9 @@ void HGraphBuilder::InsertTryBoundaryBlocks(const DexFile::CodeItem& code_item) // (c) link the new blocks to corresponding exception handlers. // We cannot iterate only over blocks in `branch_targets_` because switch-case // blocks share the same dex_pc. - for (size_t block_id = 1; block_id < num_blocks - 1; ++block_id) { + for (size_t block_id = 0; block_id < num_blocks; ++block_id) { HBasicBlock* try_block = graph_->GetBlocks().Get(block_id); - // Iteration starts from 1 to skip the entry block. - DCHECK_NE(try_block, entry_block_); - // Iteration ends at num_blocks - 1 to skip the exit block. - DCHECK_NE(try_block, exit_block_); // TryBoundary blocks are added at the end of the list and not iterated over. DCHECK(!try_block->IsSingleTryBoundary()); |