summaryrefslogtreecommitdiffstats
path: root/lldb/source/Symbol/ClangASTContext.cpp
diff options
context:
space:
mode:
authorSean Callanan <scallanan@apple.com>2017-06-02 01:24:18 +0000
committerSean Callanan <scallanan@apple.com>2017-06-02 01:24:18 +0000
commitddf802a04d5e873d7d58c0e85b8b243af0c13315 (patch)
tree31e24960d7aa5c61fda1a4317c8ee678504d4bce /lldb/source/Symbol/ClangASTContext.cpp
parenta44a6ac81f0d2acffecbe422a166c7392a19160c (diff)
downloadbcm5719-llvm-ddf802a04d5e873d7d58c0e85b8b243af0c13315.tar.gz
bcm5719-llvm-ddf802a04d5e873d7d58c0e85b8b243af0c13315.zip
[TypeSystem] Handle Clang AttributedTypes
When parsing types originating in modules, it is possible to encounter AttributedTypes (such as the type generated for NSString *_Nonnull). Some of LLDB's ClangASTContext methods deal with them; others do not. In particular, one function that did not was GetTypeInfo, causing TestObjCNewSyntax to fail. This fixes that, treating AttributedType as essentially transparent and getting the information for the modified type. In addition, however, TestObjCNewSyntax is a monolithic test that verifies a bunch of different things, all of which can break independently of one another. I broke it apart into smaller tests so that we get more precise failures when something (like this) breaks. Differential Revision: https://reviews.llvm.org/D33812 llvm-svn: 304510
Diffstat (limited to 'lldb/source/Symbol/ClangASTContext.cpp')
-rw-r--r--lldb/source/Symbol/ClangASTContext.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/lldb/source/Symbol/ClangASTContext.cpp b/lldb/source/Symbol/ClangASTContext.cpp
index 94c91fe335a..c8738e6e550 100644
--- a/lldb/source/Symbol/ClangASTContext.cpp
+++ b/lldb/source/Symbol/ClangASTContext.cpp
@@ -3938,6 +3938,11 @@ ClangASTContext::GetTypeInfo(lldb::opaque_compiler_type_t type,
const clang::Type::TypeClass type_class = qual_type->getTypeClass();
switch (type_class) {
+ case clang::Type::Attributed:
+ return GetTypeInfo(
+ qual_type->getAs<clang::AttributedType>()
+ ->getModifiedType().getAsOpaquePtr(),
+ pointee_or_element_clang_type);
case clang::Type::Builtin: {
const clang::BuiltinType *builtin_type = llvm::dyn_cast<clang::BuiltinType>(
qual_type->getCanonicalTypeInternal());
OpenPOWER on IntegriCloud