[compiler-rt] r178238 - [Sanitizer] Minor enhancements in InternalVector container
Alexey Samsonov
samsonov at google.com
Thu Mar 28 08:37:12 PDT 2013
Author: samsonov
Date: Thu Mar 28 10:37:11 2013
New Revision: 178238
URL: http://llvm.org/viewvc/llvm-project?rev=178238&view=rev
Log:
[Sanitizer] Minor enhancements in InternalVector container
Modified:
compiler-rt/trunk/lib/sanitizer_common/sanitizer_common.h
Modified: compiler-rt/trunk/lib/sanitizer_common/sanitizer_common.h
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_common.h?rev=178238&r1=178237&r2=178238&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_common.h (original)
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_common.h Thu Mar 28 10:37:11 2013
@@ -282,7 +282,11 @@ class InternalVector {
UnmapOrDie(data_, capacity_ * sizeof(T));
}
T &operator[](uptr i) {
- CHECK_LT(i, size_);
+ DCHECK_LT(i, size_);
+ return data_[i];
+ }
+ const T &operator[](uptr i) const {
+ DCHECK_LT(i, size_);
return data_[i];
}
void push_back(const T &element) {
@@ -301,7 +305,7 @@ class InternalVector {
CHECK_GT(size_, 0);
size_--;
}
- uptr size() {
+ uptr size() const {
return size_;
}
More information about the llvm-commits
mailing list