2015-09-09 04:41:52 +08:00
|
|
|
// Test that debug info is emitted for an Objective-C module and
|
|
|
|
// a precompiled header.
|
|
|
|
|
|
|
|
// REQUIRES: asserts, shell
|
|
|
|
|
|
|
|
// Modules:
|
|
|
|
// RUN: rm -rf %t
|
2015-10-03 01:36:10 +08:00
|
|
|
// RUN: %clang_cc1 -x objective-c -fmodules -fmodule-format=obj \
|
|
|
|
// RUN: -fimplicit-module-maps -DMODULES -fmodules-cache-path=%t %s \
|
|
|
|
// RUN: -I %S/Inputs -I %t -emit-llvm -o %t.ll \
|
|
|
|
// RUN: -mllvm -debug-only=pchcontainer &>%t-mod.ll
|
2015-09-09 04:41:52 +08:00
|
|
|
// RUN: cat %t-mod.ll | FileCheck %s
|
2015-10-01 08:48:51 +08:00
|
|
|
// RUN: cat %t-mod.ll | FileCheck %s --check-prefix=MODULE-CHECK
|
2015-09-09 04:41:52 +08:00
|
|
|
|
|
|
|
// PCH:
|
2015-10-03 01:36:10 +08:00
|
|
|
// RUN: %clang_cc1 -x objective-c -emit-pch -fmodule-format=obj -I %S/Inputs \
|
|
|
|
// RUN: -o %t.pch %S/Inputs/DebugObjC.h \
|
|
|
|
// RUN: -mllvm -debug-only=pchcontainer &>%t-pch.ll
|
2015-09-09 04:41:52 +08:00
|
|
|
// RUN: cat %t-pch.ll | FileCheck %s
|
|
|
|
|
|
|
|
#ifdef MODULES
|
|
|
|
@import DebugObjC;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
// CHECK: distinct !DICompileUnit(language: DW_LANG_ObjC
|
|
|
|
// CHECK-SAME: isOptimized: false,
|
2015-10-01 08:48:51 +08:00
|
|
|
// CHECK: !DICompositeType(tag: DW_TAG_structure_type,
|
2015-10-02 00:57:02 +08:00
|
|
|
// CHECK-SAME: name: "FwdDecl",
|
|
|
|
// CHECK: !DICompositeType(tag: DW_TAG_structure_type,
|
2015-10-01 08:48:51 +08:00
|
|
|
// CHECK-SAME: name: "ObjCClass",
|
2015-09-09 04:41:52 +08:00
|
|
|
// CHECK: !DIObjCProperty(name: "property",
|
|
|
|
// CHECK: !DIDerivedType(tag: DW_TAG_member, name: "ivar"
|
2015-10-24 01:25:17 +08:00
|
|
|
// CHECK: !DIDerivedType(tag: DW_TAG_typedef, name: "InnerEnum"
|
2015-09-09 04:41:52 +08:00
|
|
|
// CHECK: !DISubprogram(name: "+[ObjCClass classMethod]"
|
|
|
|
// CHECK: !DISubprogram(name: "-[ObjCClass instanceMethodWithInt:]"
|
Stop back-patching 'readonly' Objective-C properties with 'readwrite' ones.
A 'readonly' Objective-C property declared in the primary class can
effectively be shadowed by a 'readwrite' property declared within an
extension of that class, so long as the types and attributes of the
two property declarations are compatible.
Previously, this functionality was implemented by back-patching the
original 'readonly' property to make it 'readwrite', destroying source
information and causing some hideously redundant, incorrect
code. Simplify the implementation to express how this should actually
be modeled: as a separate property declaration in the extension that
shadows (via the name lookup rules) the declaration in the primary
class. While here, correct some broken Fix-Its, eliminate a pile of
redundant code, clean up the ARC migrator's handling of properties
declared in extensions, and fix debug info's naming of methods that
come from categories.
A wonderous side effect of doing this write is that it eliminates the
"AddedObjCPropertyInClassExtension" method from the AST mutation
listener, which in turn eliminates the last place where we rewrite
entire declarations in a chained PCH file or a module file. This
change (which fixes rdar://problem/18475765) will allow us to
eliminate the rewritten-decls logic from the serialization library,
and fixes a crash (rdar://problem/23247794) illustrated by the
test/PCH/chain-categories.m example.
llvm-svn: 251874
2015-11-03 09:15:46 +08:00
|
|
|
// CHECK: !DISubprogram(name: "-[Category(Category) categoryMethod]"
|
2015-10-01 08:48:51 +08:00
|
|
|
|
2015-10-24 01:25:17 +08:00
|
|
|
// MODULE-CHECK: !DICompositeType(tag: DW_TAG_enumeration_type,
|
2015-10-01 08:48:51 +08:00
|
|
|
// MODULE-CHECK-SAME: scope: ![[MODULE:[0-9]+]],
|
|
|
|
// MODULE-CHECK: ![[MODULE]] = !DIModule(scope: null, name: "DebugObjC"
|
2015-10-02 00:57:02 +08:00
|
|
|
// MODULE-CHECK: !DICompositeType(tag: DW_TAG_structure_type,
|
2015-10-24 01:25:17 +08:00
|
|
|
// MODULE-CHECK-SAME: name: "FwdDecl",
|
|
|
|
// MODULE-CHECK-SAME: scope: ![[MODULE]],
|
|
|
|
// MODULE-CHECK: !DICompositeType(tag: DW_TAG_structure_type,
|
2015-10-02 00:57:02 +08:00
|
|
|
// MODULE-CHECK-SAME: name: "ObjCClass",
|
|
|
|
// MODULE-CHECK-SAME: scope: ![[MODULE]],
|
2015-10-05 07:23:04 +08:00
|
|
|
// MODULE-CHECK: !DISubprogram(name: "+[ObjCClass classMethod]",
|
|
|
|
// MODULE-CHECK-SAME: scope: ![[MODULE]],
|
2015-10-03 01:36:14 +08:00
|
|
|
|
|
|
|
// The forward declaration should not be in the module scope.
|
|
|
|
// MODULE-CHECK: !DICompositeType(tag: DW_TAG_structure_type, name: "OpaqueData", file
|