summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGenCXX/debug-info-template-member.cpp
diff options
context:
space:
mode:
authorDavid Blaikie <dblaikie@gmail.com>2013-08-09 17:20:05 +0000
committerDavid Blaikie <dblaikie@gmail.com>2013-08-09 17:20:05 +0000
commitfd07c604a929849fd6c4880974d1d4c255ce95f1 (patch)
treed37dde0cf5cc5f2a2dfeddc67ab312c29b00b528 /clang/test/CodeGenCXX/debug-info-template-member.cpp
parent604e8486552ee7c3d249aa0f1772f5d1cdc11745 (diff)
downloadbcm5719-llvm-fd07c604a929849fd6c4880974d1d4c255ce95f1.tar.gz
bcm5719-llvm-fd07c604a929849fd6c4880974d1d4c255ce95f1.zip
Only emit debug info for implicit members that actually get codegen, not just ODR use.
This includes special members (copy/default ctor, copy assign, default ctor) and template specializations for member function templates. Good for a 5% decrease (1.80 to 1.71 GB) in size on Clang+LLVM's .dwo files (when using fission). llvm-svn: 188085
Diffstat (limited to 'clang/test/CodeGenCXX/debug-info-template-member.cpp')
-rw-r--r--clang/test/CodeGenCXX/debug-info-template-member.cpp30
1 files changed, 14 insertions, 16 deletions
diff --git a/clang/test/CodeGenCXX/debug-info-template-member.cpp b/clang/test/CodeGenCXX/debug-info-template-member.cpp
index 6be7f9bd249..2354a1a5125 100644
--- a/clang/test/CodeGenCXX/debug-info-template-member.cpp
+++ b/clang/test/CodeGenCXX/debug-info-template-member.cpp
@@ -1,21 +1,19 @@
// RUN: %clang_cc1 -emit-llvm -g -triple x86_64-apple-darwin %s -o - | FileCheck %s
-class MyClass
-{
-public:
- int add2(int j)
- {
- return add<2>(j);
- }
-private:
- template <int i> int add(int j)
- {
- return i + j;
- }
+struct MyClass {
+ template <int i> int add(int j) {
+ return i + j;
+ }
};
-MyClass m;
+int add2(int x) {
+ return MyClass().add<2>(x);
+}
-// CHECK: metadata [[C_MEM:![0-9]*]], i32 0, null, null} ; [ DW_TAG_class_type ] [MyClass]
-// CHECK: [[C_MEM]] = metadata !{metadata {{.*}}, metadata [[C_TEMP:![0-9]*]], metadata {{.*}}}
-// CHECK: [[C_TEMP]] = {{.*}} ; [ DW_TAG_subprogram ] [line 11] [private] [add<2>]
+inline int add3(int x) {
+ return MyClass().add<3>(x); // even though add<3> is ODR used, don't emit it since we don't codegen it
+}
+
+// CHECK: metadata [[C_MEM:![0-9]*]], i32 0, null, null} ; [ DW_TAG_structure_type ] [MyClass]
+// CHECK: [[C_MEM]] = metadata !{metadata [[C_TEMP:![0-9]*]]}
+// CHECK: [[C_TEMP]] = {{.*}} ; [ DW_TAG_subprogram ] [line 4] [add<2>]
OpenPOWER on IntegriCloud