Add some comments to r184252.

rdar://problem/14101097

llvm-svn: 184259
This commit is contained in:
Adrian Prantl
2013-06-18 23:32:21 +00:00
parent abe18db268
commit 1f56b2a4f1
2 changed files with 8 additions and 2 deletions

View File

@@ -1379,7 +1379,12 @@ llvm::DIType CGDebugInfo::getOrCreateInterfaceType(QualType D,
/// CreateType - get structure or union type.
llvm::DIType CGDebugInfo::CreateType(const RecordType *Ty, bool Declaration) {
RecordDecl *RD = Ty->getDecl();
// Limited debug info should only remove struct definitions that can
// safely be replaced by a forward declaration in the source code.
if (DebugKind <= CodeGenOptions::LimitedDebugInfo && Declaration) {
// FIXME: This implementation is problematic; there are some test
// cases where we violate the above principle, such as
// test/CodeGen/debug-info-records.c .
llvm::DIDescriptor FDContext =
getContextDescriptor(cast<Decl>(RD->getDeclContext()));
llvm::DIType RetTy = createRecordFwdDecl(RD, FDContext);

View File

@@ -3,7 +3,9 @@
// rdar://problem/14101097
//
// FIXME: This should work with -flimit-debug-info, too.
//
// Make sure this is not a forward declaration.
// CHECK-NOT: [ DW_TAG_structure_type ] [elusive_s] {{.*}} [fwd]
// CHECK: [ DW_TAG_member ] [foo]
// CHECK: [ DW_TAG_member ] [bar]
struct elusive_s {
@@ -16,4 +18,3 @@ int baz(void* x) {
elusive_t s = x;
return s->foo;
}