Commit ce8a2038 authored by Michael Starzinger's avatar Michael Starzinger Committed by Commit Bot

[gcmole] Fix IsRawPointerType predicate.

R=mslekova@chromium.org
BUG=v8:8813

Change-Id: I4d35fdff0f398c4eac3a97932a5e6ce43a49d9c8
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1514683
Commit-Queue: Michael Starzinger <mstarzinger@chromium.org>
Reviewed-by: 's avatarMaya Lekova <mslekova@chromium.org>
Cr-Commit-Position: refs/heads/master@{#60171}
parent e3c0e27d
......@@ -1159,7 +1159,7 @@ class FunctionAnalyzer {
return record->getDefinition();
}
bool IsRawPointerType(const clang::PointerType* type, clang::QualType qtype) {
bool IsRawPointerType(const clang::PointerType* type) {
const clang::CXXRecordDecl* record = type->getPointeeCXXRecordDecl();
const clang::CXXRecordDecl* definition = GetDefinitionOrNull(record);
......@@ -1167,7 +1167,12 @@ class FunctionAnalyzer {
return false;
}
return !IsDerivedFrom(record, smi_decl_);
// TODO(mstarzinger): Unify the common parts of {IsRawPointerType} and
// {IsInternalPointerType} once gcmole is up and running again.
bool result = (IsDerivedFrom(record, object_decl_) &&
!IsDerivedFrom(record, smi_decl_)) ||
IsDerivedFrom(record, maybe_object_decl_);
return result;
}
bool IsInternalPointerType(clang::QualType qtype) {
......@@ -1185,8 +1190,12 @@ class FunctionAnalyzer {
return false;
}
return IsDerivedFrom(record, object_decl_) ||
IsDerivedFrom(record, maybe_object_decl_);
// TODO(mstarzinger): Unify the common parts of {IsRawPointerType} and
// {IsInternalPointerType} once gcmole is up and running again.
bool result = (IsDerivedFrom(record, object_decl_) &&
!IsDerivedFrom(record, smi_decl_)) ||
IsDerivedFrom(record, maybe_object_decl_);
return result;
}
// Returns weather the given type is a raw pointer or a wrapper around
......@@ -1195,7 +1204,7 @@ class FunctionAnalyzer {
const clang::PointerType* pointer_type =
llvm::dyn_cast_or_null<clang::PointerType>(qtype.getTypePtrOrNull());
if (pointer_type != NULL) {
return IsRawPointerType(pointer_type, qtype);
return IsRawPointerType(pointer_type);
} else {
return IsInternalPointerType(qtype);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment