]> granicus.if.org Git - clang/commitdiff
DebugInfo: omit debug info for friends
authorDavid Blaikie <dblaikie@gmail.com>
Fri, 13 Sep 2013 18:45:00 +0000 (18:45 +0000)
committerDavid Blaikie <dblaikie@gmail.com>
Fri, 13 Sep 2013 18:45:00 +0000 (18:45 +0000)
GCC ToT doesn't do this & it's worth about 3.2% on Clang's DWO file size
with Clang. Some or all of this may be due to things like r190715 which
could have source fixes/improvements, but it's not clear that's the case
and that doesn't help other source bases.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190716 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CGDebugInfo.cpp
lib/CodeGen/CGDebugInfo.h
test/CodeGenCXX/debug-info-friend.cpp

index f81d2cf683e53ef80a59e3c03eb4693763d05721..0069d577f24a431b9ef3b8a7b6908f6885f4f45e 100644 (file)
@@ -1139,23 +1139,6 @@ CollectCXXMemberFunctions(const CXXRecordDecl *RD, llvm::DIFile Unit,
   }
 }
 
-/// CollectCXXFriends - A helper function to collect debug info for
-/// C++ base classes. This is used while creating debug info entry for
-/// a Record.
-void CGDebugInfo::
-CollectCXXFriends(const CXXRecordDecl *RD, llvm::DIFile Unit,
-                SmallVectorImpl<llvm::Value *> &EltTys,
-                llvm::DIType RecordTy) {
-  for (CXXRecordDecl::friend_iterator BI = RD->friend_begin(),
-         BE = RD->friend_end(); BI != BE; ++BI) {
-    if ((*BI)->isUnsupportedFriend())
-      continue;
-    if (TypeSourceInfo *TInfo = (*BI)->getFriendType())
-      EltTys.push_back(DBuilder.createFriend(
-          RecordTy, getOrCreateType(TInfo->getType(), Unit)));
-  }
-}
-
 /// CollectCXXBases - A helper function to collect debug info for
 /// C++ base classes. This is used while creating debug info entry for
 /// a Record.
@@ -1528,7 +1511,6 @@ llvm::DIType CGDebugInfo::CreateTypeDefinition(const RecordType *Ty) {
   CollectRecordFields(RD, DefUnit, EltTys, FwdDecl);
   if (CXXDecl) {
     CollectCXXMemberFunctions(CXXDecl, DefUnit, EltTys, FwdDecl);
-    CollectCXXFriends(CXXDecl, DefUnit, EltTys, FwdDecl);
   }
 
   LexicalBlockStack.pop_back();
index d480d9bbc872e9910ea91da1da8f300ceddc997e..0ca274f56881874e17df80a486d09ca76d7e7a39 100644 (file)
@@ -155,11 +155,6 @@ class CGDebugInfo {
                                  SmallVectorImpl<llvm::Value *> &E,
                                  llvm::DIType T);
 
-  void CollectCXXFriends(const CXXRecordDecl *Decl,
-                       llvm::DIFile F,
-                       SmallVectorImpl<llvm::Value *> &EltTys,
-                       llvm::DIType RecordTy);
-
   void CollectCXXBases(const CXXRecordDecl *Decl,
                        llvm::DIFile F,
                        SmallVectorImpl<llvm::Value *> &EltTys,
index cf6651cde18edb353c95bee857178ef983ff7da6..b103b142a2ae098693c3825ef95d1c06db30785f 100644 (file)
@@ -14,4 +14,7 @@ struct MyFriend {
   }
 };
 
-// CHECK: DW_TAG_friend
+// Emitting debug info for friends unnecessarily bloats debug info without any
+// known benefit or debugger feature that requires it. Re-enable this is a
+// use-case appears.
+// CHECK-NOT: DW_TAG_friend