r184259 - Add some comments to r184252.
Adrian Prantl
aprantl at apple.com
Tue Jun 18 16:32:21 PDT 2013
Author: adrian
Date: Tue Jun 18 18:32:21 2013
New Revision: 184259
URL: http://llvm.org/viewvc/llvm-project?rev=184259&view=rev
Log:
Add some comments to r184252.
rdar://problem/14101097
Modified:
cfe/trunk/lib/CodeGen/CGDebugInfo.cpp
cfe/trunk/test/CodeGen/debug-info-record.c
Modified: cfe/trunk/lib/CodeGen/CGDebugInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGDebugInfo.cpp?rev=184259&r1=184258&r2=184259&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGDebugInfo.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGDebugInfo.cpp Tue Jun 18 18:32:21 2013
@@ -1379,7 +1379,12 @@ llvm::DIType CGDebugInfo::getOrCreateInt
/// 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);
Modified: cfe/trunk/test/CodeGen/debug-info-record.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/debug-info-record.c?rev=184259&r1=184258&r2=184259&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/debug-info-record.c (original)
+++ cfe/trunk/test/CodeGen/debug-info-record.c Tue Jun 18 18:32:21 2013
@@ -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;
}
-
More information about the cfe-commits
mailing list