diff options
author | Nicolas Geoffray <ngeoffray@google.com> | 2014-02-25 14:22:56 +0000 |
---|---|---|
committer | Nicolas Geoffray <ngeoffray@google.com> | 2014-02-26 13:24:04 +0000 |
commit | be9a92aa804c0d210f80966b74ef8ed3987f335a (patch) | |
tree | 10d58622f626f03156e0dec1f1fc00616554b336 /compiler/utils | |
parent | 3188d117d6f1ba5f3a30d0ff231d816ebb59a7f7 (diff) | |
download | android_art-be9a92aa804c0d210f80966b74ef8ed3987f335a.tar.gz android_art-be9a92aa804c0d210f80966b74ef8ed3987f335a.tar.bz2 android_art-be9a92aa804c0d210f80966b74ef8ed3987f335a.zip |
Add conditional branches, and build dominator tree.
Change-Id: I4b151a07b72692961235a1419b54b6b45cf54e63
Diffstat (limited to 'compiler/utils')
-rw-r--r-- | compiler/utils/growable_array.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/compiler/utils/growable_array.h b/compiler/utils/growable_array.h index b59187032e..82b6a607e7 100644 --- a/compiler/utils/growable_array.h +++ b/compiler/utils/growable_array.h @@ -161,6 +161,18 @@ class GrowableArray { size_t Size() const { return num_used_; } + bool IsEmpty() const { return num_used_ == 0; } + + T Pop() { + DCHECK_GE(num_used_, (size_t)0); + return elem_list_[--num_used_]; + } + + T Peek() const { + DCHECK_GE(num_used_, (size_t)0); + return elem_list_[num_used_ - 1]; + } + void SetSize(size_t new_size) { Resize(new_size); num_used_ = new_size; |