[Lldb-commits] [PATCH] D70001: [lldb][NFC] Refactor some IsClangType checks in ClangASTContext

Raphael Isemann via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Fri Nov 8 03:05:13 PST 2019


This revision was not accepted when it landed; it landed in state "Needs Review".
This revision was automatically updated to reflect the committed changes.
Closed by commit rG79b3cce7f143: [lldb][NFC] Refactor some IsClangType checks in ClangASTContext (authored by teemperor).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D70001/new/

https://reviews.llvm.org/D70001

Files:
  lldb/source/Symbol/ClangASTContext.cpp
  lldb/source/Symbol/ClangUtil.cpp


Index: lldb/source/Symbol/ClangUtil.cpp
===================================================================
--- lldb/source/Symbol/ClangUtil.cpp
+++ lldb/source/Symbol/ClangUtil.cpp
@@ -15,6 +15,10 @@
 using namespace lldb_private;
 
 bool ClangUtil::IsClangType(const CompilerType &ct) {
+  // Invalid types are never Clang types.
+  if (!ct)
+    return false;
+
   if (llvm::dyn_cast_or_null<ClangASTContext>(ct.GetTypeSystem()) == nullptr)
     return false;
 
Index: lldb/source/Symbol/ClangASTContext.cpp
===================================================================
--- lldb/source/Symbol/ClangASTContext.cpp
+++ lldb/source/Symbol/ClangASTContext.cpp
@@ -3601,7 +3601,7 @@
 }
 
 bool ClangASTContext::IsObjCClassType(const CompilerType &type) {
-  if (type) {
+  if (ClangUtil::IsClangType(type)) {
     clang::QualType qual_type(ClangUtil::GetCanonicalQualType(type));
 
     const clang::ObjCObjectPointerType *obj_pointer_type =
@@ -3886,7 +3886,7 @@
 
 bool ClangASTContext::IsObjCObjectPointerType(const CompilerType &type,
                                               CompilerType *class_type_ptr) {
-  if (!type)
+  if (!ClangUtil::IsClangType(type))
     return false;
 
   clang::QualType qual_type(ClangUtil::GetCanonicalQualType(type));


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D70001.228399.patch
Type: text/x-patch
Size: 1264 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20191108/7917baf4/attachment.bin>


More information about the lldb-commits mailing list