diff options
| author | 2014-02-26 14:01:05 +0000 | |
|---|---|---|
| committer | 2014-02-26 14:01:06 +0000 | |
| commit | 504e6997501aa19c7e7973e70f187314af95602c (patch) | |
| tree | 7314b38ad594ac1360861a62c574ee8e5d892233 /compiler/utils/growable_array.h | |
| parent | ef2cc5a9c6e508a3e8b24d04ca35f7422f27e112 (diff) | |
| parent | be9a92aa804c0d210f80966b74ef8ed3987f335a (diff) | |
Merge "Add conditional branches, and build dominator tree."
Diffstat (limited to 'compiler/utils/growable_array.h')
| -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; |