diff options
| author | 2015-09-25 13:58:00 +0000 | |
|---|---|---|
| committer | 2015-09-25 13:58:00 +0000 | |
| commit | e92ed9d31bae7ccd48b60aa921e9dd2ca96ac9db (patch) | |
| tree | 497ad13136a0683b41e856899ad48c6c42bec15c /compiler/utils/array_ref.h | |
| parent | 1c79b7f7a2ef3fadd6de2d4ff70f6e6b6ddf56ef (diff) | |
| parent | 211c2119dc8932bdb264fae858adba6c0541ce3c (diff) | |
Merge "Optimizing: Rewrite DCE's MarkReachableBlocks()."
Diffstat (limited to 'compiler/utils/array_ref.h')
| -rw-r--r-- | compiler/utils/array_ref.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/compiler/utils/array_ref.h b/compiler/utils/array_ref.h index 303e0d5ad4..48f0328dce 100644 --- a/compiler/utils/array_ref.h +++ b/compiler/utils/array_ref.h @@ -161,6 +161,15 @@ class ArrayRef { value_type* data() { return array_; } const value_type* data() const { return array_; } + ArrayRef SubArray(size_type pos) const { + return SubArray(pos, size_ - pos); + } + ArrayRef SubArray(size_type pos, size_type length) const { + DCHECK_LE(pos, size()); + DCHECK_LE(length, size() - pos); + return ArrayRef(array_ + pos, length); + } + private: T* array_; size_t size_; |