| Index: tools/clang/plugins/FindBadConstructsConsumer.cpp
|
| diff --git a/tools/clang/plugins/FindBadConstructsConsumer.cpp b/tools/clang/plugins/FindBadConstructsConsumer.cpp
|
| index 1400171de647bf0c2ca6a97ca755f33ea72fe143..c99c389879270d6e0283e0c2c5c503218c77b52f 100644
|
| --- a/tools/clang/plugins/FindBadConstructsConsumer.cpp
|
| +++ b/tools/clang/plugins/FindBadConstructsConsumer.cpp
|
| @@ -641,20 +641,10 @@ FindBadConstructsConsumer::CheckRecordForRefcountIssue(
|
|
|
| // Returns true if |base| specifies one of the Chromium reference counted
|
| // classes (base::RefCounted / base::RefCountedThreadSafe).
|
| -#if defined(LLVM_FORCE_HEAD_REVISION)
|
| bool FindBadConstructsConsumer::IsRefCounted(
|
| const CXXBaseSpecifier* base,
|
| CXXBasePath& path) {
|
| FindBadConstructsConsumer* self = this;
|
| -#else
|
| -// static
|
| -bool FindBadConstructsConsumer::IsRefCountedCallback(
|
| - const CXXBaseSpecifier* base,
|
| - CXXBasePath& path,
|
| - void* user_data) {
|
| - FindBadConstructsConsumer* self =
|
| - static_cast<FindBadConstructsConsumer*>(user_data);
|
| -#endif
|
| const TemplateSpecializationType* base_type =
|
| dyn_cast<TemplateSpecializationType>(
|
| UnwrapType(base->getType().getTypePtr()));
|
| @@ -740,17 +730,11 @@ void FindBadConstructsConsumer::CheckRefCountedDtors(
|
|
|
| // Determine if the current type is even ref-counted.
|
| CXXBasePaths refcounted_path;
|
| -#if defined(LLVM_FORCE_HEAD_REVISION)
|
| if (!record->lookupInBases(
|
| [this](const CXXBaseSpecifier* base, CXXBasePath& path) {
|
| return IsRefCounted(base, path);
|
| },
|
| refcounted_path)) {
|
| -#else
|
| - if (!record->lookupInBases(&FindBadConstructsConsumer::IsRefCountedCallback,
|
| - this,
|
| - refcounted_path)) {
|
| -#endif
|
| return; // Class does not derive from a ref-counted base class.
|
| }
|
|
|
| @@ -800,18 +784,12 @@ void FindBadConstructsConsumer::CheckRefCountedDtors(
|
| // Find all public destructors. This will record the class hierarchy
|
| // that leads to the public destructor in |dtor_paths|.
|
| CXXBasePaths dtor_paths;
|
| -#if defined(LLVM_FORCE_HEAD_REVISION)
|
| if (!record->lookupInBases(
|
| [](const CXXBaseSpecifier* base, CXXBasePath& path) {
|
| // TODO(thakis): Inline HasPublicDtorCallback() after clang roll.
|
| return HasPublicDtorCallback(base, path, nullptr);
|
| },
|
| dtor_paths)) {
|
| -#else
|
| - if (!record->lookupInBases(&FindBadConstructsConsumer::HasPublicDtorCallback,
|
| - nullptr,
|
| - dtor_paths)) {
|
| -#endif
|
| return;
|
| }
|
|
|
|
|