summaryrefslogtreecommitdiffstats
path: root/tools/clang/plugins
diff options
context:
space:
mode:
authortkent <tkent@chromium.org>2015-08-19 01:34:44 -0700
committerCommit bot <commit-bot@chromium.org>2015-08-19 08:35:23 +0000
commita75a81eccf8127052329c3270709a0bfb5d3b85b (patch)
treec2b50f50b403cbf6ca610a0aa15dddd6a618d600 /tools/clang/plugins
parentc91b178b07b0d9fb0c7a437df3a1da3db1887160 (diff)
downloadchromium_src-a75a81eccf8127052329c3270709a0bfb5d3b85b.zip
chromium_src-a75a81eccf8127052329c3270709a0bfb5d3b85b.tar.gz
chromium_src-a75a81eccf8127052329c3270709a0bfb5d3b85b.tar.bz2
Revert of Roll Clang 243039:245342 (patchset #6 id:100001 of https://codereview.chromium.org/1294763003/ )
Reason for revert: Broke StringHasherTest.StringHasher_addCharacters on WebKit Linux 32 bot. https://build.chromium.org/p/chromium.webkit/builders/WebKit%20Linux%2032/builds/39116 Original issue's description: > Roll Clang 243039:245342 > > BUG=518002 > > Committed: https://crrev.com/bf0ed49cacad046649c521b77d925d60ae2c3243 > Cr-Commit-Position: refs/heads/master@{#344152} TBR=thakis@chromium.org,hans@chromium.org NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=518002 Review URL: https://codereview.chromium.org/1286123007 Cr-Commit-Position: refs/heads/master@{#344177}
Diffstat (limited to 'tools/clang/plugins')
-rw-r--r--tools/clang/plugins/FindBadConstructsConsumer.cpp22
-rw-r--r--tools/clang/plugins/FindBadConstructsConsumer.h6
2 files changed, 28 insertions, 0 deletions
diff --git a/tools/clang/plugins/FindBadConstructsConsumer.cpp b/tools/clang/plugins/FindBadConstructsConsumer.cpp
index c99c389..1400171 100644
--- a/tools/clang/plugins/FindBadConstructsConsumer.cpp
+++ b/tools/clang/plugins/FindBadConstructsConsumer.cpp
@@ -641,10 +641,20 @@ 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()));
@@ -730,11 +740,17 @@ 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.
}
@@ -784,12 +800,18 @@ 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;
}
diff --git a/tools/clang/plugins/FindBadConstructsConsumer.h b/tools/clang/plugins/FindBadConstructsConsumer.h
index 8f8fc87..7ad0215 100644
--- a/tools/clang/plugins/FindBadConstructsConsumer.h
+++ b/tools/clang/plugins/FindBadConstructsConsumer.h
@@ -85,8 +85,14 @@ class FindBadConstructsConsumer
static RefcountIssue CheckRecordForRefcountIssue(
const clang::CXXRecordDecl* record,
clang::SourceLocation& loc);
+#if defined(LLVM_FORCE_HEAD_REVISION)
bool IsRefCounted(const clang::CXXBaseSpecifier* base,
clang::CXXBasePath& path);
+#else
+ static bool IsRefCountedCallback(const clang::CXXBaseSpecifier* base,
+ clang::CXXBasePath& path,
+ void* user_data);
+#endif
static bool HasPublicDtorCallback(const clang::CXXBaseSpecifier* base,
clang::CXXBasePath& path,
void* user_data);