This revision was automatically updated to reflect the committed changes. Closed by commit rL304510: [TypeSystem] Handle Clang AttributedTypes (authored by spyffe).
Changed prior to commit: https://reviews.llvm.org/D33812?vs=101140&id=101158#toc Repository: rL LLVM https://reviews.llvm.org/D33812 Files: lldb/trunk/packages/Python/lldbsuite/test/lang/objc/objc-new-syntax/TestObjCNewSyntax.py lldb/trunk/source/Symbol/ClangASTContext.cpp
Index: lldb/trunk/packages/Python/lldbsuite/test/lang/objc/objc-new-syntax/TestObjCNewSyntax.py =================================================================== --- lldb/trunk/packages/Python/lldbsuite/test/lang/objc/objc-new-syntax/TestObjCNewSyntax.py +++ lldb/trunk/packages/Python/lldbsuite/test/lang/objc/objc-new-syntax/TestObjCNewSyntax.py @@ -26,16 +26,7 @@ # Find the line number to break inside main(). self.line = line_number('main.m', '// Set breakpoint 0 here.') - @skipUnlessDarwin - @expectedFailureAll( - oslist=['macosx'], - compiler='clang', - compiler_version=[ - '<', - '7.0.0']) - @skipIf(macos_version=["<", "10.12"]) - @expectedFailureAll(archs=["i[3-6]86"]) - def test_expr(self): + def runToBreakpoint(self): self.build() exe = os.path.join(os.getcwd(), "a.out") self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET) @@ -55,6 +46,18 @@ self.expect("breakpoint list -f", BREAKPOINT_HIT_ONCE, substrs=[' resolved, hit count = 1']) + @skipUnlessDarwin + @expectedFailureAll( + oslist=['macosx'], + compiler='clang', + compiler_version=[ + '<', + '7.0.0']) + @skipIf(macos_version=["<", "10.12"]) + @expectedFailureAll(archs=["i[3-6]86"]) + def test_read_array(self): + self.runToBreakpoint() + self.expect( "expr --object-description -- immutable_array[0]", VARIABLES_DISPLAYED_CORRECTLY, @@ -65,6 +68,18 @@ VARIABLES_DISPLAYED_CORRECTLY, substrs=["foo"]) + @skipUnlessDarwin + @expectedFailureAll( + oslist=['macosx'], + compiler='clang', + compiler_version=[ + '<', + '7.0.0']) + @skipIf(macos_version=["<", "10.12"]) + @expectedFailureAll(archs=["i[3-6]86"]) + def test_update_array(self): + self.runToBreakpoint() + self.expect( "expr --object-description -- mutable_array[0] = @\"bar\"", VARIABLES_DISPLAYED_CORRECTLY, @@ -75,6 +90,18 @@ VARIABLES_DISPLAYED_CORRECTLY, substrs=["bar"]) + @skipUnlessDarwin + @expectedFailureAll( + oslist=['macosx'], + compiler='clang', + compiler_version=[ + '<', + '7.0.0']) + @skipIf(macos_version=["<", "10.12"]) + @expectedFailureAll(archs=["i[3-6]86"]) + def test_read_dictionary(self): + self.runToBreakpoint() + self.expect( "expr --object-description -- immutable_dictionary[@\"key\"]", VARIABLES_DISPLAYED_CORRECTLY, @@ -85,6 +112,18 @@ VARIABLES_DISPLAYED_CORRECTLY, substrs=["value"]) + @skipUnlessDarwin + @expectedFailureAll( + oslist=['macosx'], + compiler='clang', + compiler_version=[ + '<', + '7.0.0']) + @skipIf(macos_version=["<", "10.12"]) + @expectedFailureAll(archs=["i[3-6]86"]) + def test_update_dictionary(self): + self.runToBreakpoint() + self.expect( "expr --object-description -- mutable_dictionary[@\"key\"] = @\"object\"", VARIABLES_DISPLAYED_CORRECTLY, @@ -95,24 +134,72 @@ VARIABLES_DISPLAYED_CORRECTLY, substrs=["object"]) + @skipUnlessDarwin + @expectedFailureAll( + oslist=['macosx'], + compiler='clang', + compiler_version=[ + '<', + '7.0.0']) + @skipIf(macos_version=["<", "10.12"]) + @expectedFailureAll(archs=["i[3-6]86"]) + def test_array_literal(self): + self.runToBreakpoint() + self.expect( "expr --object-description -- @[ @\"foo\", @\"bar\" ]", VARIABLES_DISPLAYED_CORRECTLY, substrs=[ "NSArray", "foo", "bar"]) + @skipUnlessDarwin + @expectedFailureAll( + oslist=['macosx'], + compiler='clang', + compiler_version=[ + '<', + '7.0.0']) + @skipIf(macos_version=["<", "10.12"]) + @expectedFailureAll(archs=["i[3-6]86"]) + def test_dictionary_literal(self): + self.runToBreakpoint() + self.expect( "expr --object-description -- @{ @\"key\" : @\"object\" }", VARIABLES_DISPLAYED_CORRECTLY, substrs=[ "key", "object"]) + @skipUnlessDarwin + @expectedFailureAll( + oslist=['macosx'], + compiler='clang', + compiler_version=[ + '<', + '7.0.0']) + @skipIf(macos_version=["<", "10.12"]) + @expectedFailureAll(archs=["i[3-6]86"]) + def test_char_literal(self): + self.runToBreakpoint() + self.expect("expr --object-description -- @'a'", VARIABLES_DISPLAYED_CORRECTLY, substrs=[str(ord('a'))]) + @skipUnlessDarwin + @expectedFailureAll( + oslist=['macosx'], + compiler='clang', + compiler_version=[ + '<', + '7.0.0']) + @skipIf(macos_version=["<", "10.12"]) + @expectedFailureAll(archs=["i[3-6]86"]) + def test_integer_literals(self): + self.runToBreakpoint() + self.expect( "expr --object-description -- @1", VARIABLES_DISPLAYED_CORRECTLY, @@ -138,9 +225,33 @@ VARIABLES_DISPLAYED_CORRECTLY, substrs=["1"]) + @skipUnlessDarwin + @expectedFailureAll( + oslist=['macosx'], + compiler='clang', + compiler_version=[ + '<', + '7.0.0']) + @skipIf(macos_version=["<", "10.12"]) + @expectedFailureAll(archs=["i[3-6]86"]) + def test_float_literal(self): + self.runToBreakpoint() + self.expect("expr -- @123.45", VARIABLES_DISPLAYED_CORRECTLY, substrs=["NSNumber", "123.45"]) + @skipUnlessDarwin + @expectedFailureAll( + oslist=['macosx'], + compiler='clang', + compiler_version=[ + '<', + '7.0.0']) + @skipIf(macos_version=["<", "10.12"]) + @expectedFailureAll(archs=["i[3-6]86"]) + def test_expressions_in_literals(self): + self.runToBreakpoint() + self.expect( "expr --object-description -- @( 1 + 3 )", VARIABLES_DISPLAYED_CORRECTLY, Index: lldb/trunk/source/Symbol/ClangASTContext.cpp =================================================================== --- lldb/trunk/source/Symbol/ClangASTContext.cpp +++ lldb/trunk/source/Symbol/ClangASTContext.cpp @@ -3938,6 +3938,11 @@ 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());
_______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits