diff options
| author | Ian Rogers <irogers@google.com> | 2014-03-06 12:13:39 -0800 |
|---|---|---|
| committer | Ian Rogers <irogers@google.com> | 2014-03-06 19:16:01 -0800 |
| commit | 719d1a33f6569864f529e5a3fff59e7bca97aad0 (patch) | |
| tree | fcd84efd7b9806b93ec1a44e2317e6f882e7fe0e /runtime/indirect_reference_table.cc | |
| parent | 5365eea9940269b662cfbe103caa348816ff1558 (diff) | |
| download | art-719d1a33f6569864f529e5a3fff59e7bca97aad0.tar.gz art-719d1a33f6569864f529e5a3fff59e7bca97aad0.tar.bz2 art-719d1a33f6569864f529e5a3fff59e7bca97aad0.zip | |
Enable annotalysis on clang ART builds.
Fix clang build errors aswell as restructure locking/mutex code for correct
thread safety analysis support.
Reorder make dependencies so that host builds build first as they should
provide better compilation errors than target.
Remove host's use of -fno-omit-frame-pointer as it has no value with correct
use of CFI, which we should have.
Change-Id: I72cea8da9a3757b1a0b3acb4081feccb7c6cef90
Diffstat (limited to 'runtime/indirect_reference_table.cc')
| -rw-r--r-- | runtime/indirect_reference_table.cc | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/runtime/indirect_reference_table.cc b/runtime/indirect_reference_table.cc index 82b53f6a89..c8855e368b 100644 --- a/runtime/indirect_reference_table.cc +++ b/runtime/indirect_reference_table.cc @@ -27,6 +27,32 @@ namespace art { +template<typename T> +class MutatorLockedDumpable { + public: + explicit MutatorLockedDumpable(T& value) + SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) : value_(value) { + } + + void Dump(std::ostream& os) const SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) { + value_.Dump(os); + } + + private: + T& value_; + + DISALLOW_COPY_AND_ASSIGN(MutatorLockedDumpable); +}; + +template<typename T> +std::ostream& operator<<(std::ostream& os, const MutatorLockedDumpable<T>& rhs) +// TODO: should be SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) however annotalysis +// currently fails for this. + NO_THREAD_SAFETY_ANALYSIS { + rhs.Dump(os); + return os; +} + static void AbortMaybe() { // If -Xcheck:jni is on, it'll give a more detailed error before aborting. if (!Runtime::Current()->GetJavaVM()->check_jni) { |
