r190716 - DebugInfo: omit debug info for friends
David Blaikie
dblaikie at gmail.com
Fri Sep 13 11:45:00 PDT 2013
Author: dblaikie
Date: Fri Sep 13 13:45:00 2013
New Revision: 190716
URL: http://llvm.org/viewvc/llvm-project?rev=190716&view=rev
Log:
DebugInfo: omit debug info for friends
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.
Modified:
cfe/trunk/lib/CodeGen/CGDebugInfo.cpp
cfe/trunk/lib/CodeGen/CGDebugInfo.h
cfe/trunk/test/CodeGenCXX/debug-info-friend.cpp
Modified: cfe/trunk/lib/CodeGen/CGDebugInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGDebugInfo.cpp?rev=190716&r1=190715&r2=190716&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGDebugInfo.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGDebugInfo.cpp Fri Sep 13 13:45:00 2013
@@ -1139,23 +1139,6 @@ CollectCXXMemberFunctions(const CXXRecor
}
}
-/// 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::CreateTypeDefi
CollectRecordFields(RD, DefUnit, EltTys, FwdDecl);
if (CXXDecl) {
CollectCXXMemberFunctions(CXXDecl, DefUnit, EltTys, FwdDecl);
- CollectCXXFriends(CXXDecl, DefUnit, EltTys, FwdDecl);
}
LexicalBlockStack.pop_back();
Modified: cfe/trunk/lib/CodeGen/CGDebugInfo.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGDebugInfo.h?rev=190716&r1=190715&r2=190716&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGDebugInfo.h (original)
+++ cfe/trunk/lib/CodeGen/CGDebugInfo.h Fri Sep 13 13:45:00 2013
@@ -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,
Modified: cfe/trunk/test/CodeGenCXX/debug-info-friend.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/debug-info-friend.cpp?rev=190716&r1=190715&r2=190716&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/debug-info-friend.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/debug-info-friend.cpp Fri Sep 13 13:45:00 2013
@@ -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
More information about the cfe-commits
mailing list