diff options
Diffstat (limited to 'compiler/optimizing/nodes.h')
-rw-r--r-- | compiler/optimizing/nodes.h | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/compiler/optimizing/nodes.h b/compiler/optimizing/nodes.h index 26eee1c52e..0f5b1abbbf 100644 --- a/compiler/optimizing/nodes.h +++ b/compiler/optimizing/nodes.h @@ -160,6 +160,8 @@ class HGraph : public ArenaObject<kArenaAllocMisc> { const GrowableArray<HBasicBlock*>& GetBlocks() const { return blocks_; } HBasicBlock* GetBlock(size_t id) const { return blocks_.Get(id); } + bool IsInSsaForm() const { return in_ssa_form_; } + HBasicBlock* GetEntryBlock() const { return entry_block_; } HBasicBlock* GetExitBlock() const { return exit_block_; } bool HasExitBlock() const { return exit_block_ != nullptr; } @@ -183,6 +185,9 @@ class HGraph : public ArenaObject<kArenaAllocMisc> { return true; } + void ComputeDominanceInformation(); + void ClearDominanceInformation(); + void BuildDominatorTree(); void TransformToSsa(); void SimplifyCFG(); @@ -590,11 +595,10 @@ class HBasicBlock : public ArenaObject<kArenaAllocMisc> { LOG(FATAL) << "Unreachable"; UNREACHABLE(); } + void ClearDominanceInformation(); int NumberOfBackEdges() const { - return loop_information_ == nullptr - ? 0 - : loop_information_->NumberOfBackEdges(); + return IsLoopHeader() ? loop_information_->NumberOfBackEdges() : 0; } HInstruction* GetFirstInstruction() const { return instructions_.first_instruction_; } |