From fd07c604a929849fd6c4880974d1d4c255ce95f1 Mon Sep 17 00:00:00 2001 From: David Blaikie Date: Fri, 9 Aug 2013 17:20:05 +0000 Subject: 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 --- .../test/CodeGenCXX/debug-info-template-member.cpp | 30 ++++++++++------------ 1 file changed, 14 insertions(+), 16 deletions(-) (limited to 'clang/test/CodeGenCXX/debug-info-template-member.cpp') 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 add(int j) - { - return i + j; - } +struct MyClass { + template 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>] -- cgit v1.2.3