From 8472fa6c54c9d044adcd147f6826bccebd730f30 Mon Sep 17 00:00:00 2001 From: David Blaikie Date: Sat, 8 Jun 2019 00:01:21 +0000 Subject: DebugInfo: Add support for 'nodebug' attribute on typedefs and alias templates Seems like a logical extension to me - and of interest because it might help reduce the debug info size of libc++ by applying this attribute to type traits that have a disproportionate debug info cost compared to the benefit (& possibly harm/confusion) they cause users. llvm-svn: 362856 --- clang/test/CodeGenCXX/debug-info-nodebug.cpp | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'clang/test/CodeGenCXX/debug-info-nodebug.cpp') diff --git a/clang/test/CodeGenCXX/debug-info-nodebug.cpp b/clang/test/CodeGenCXX/debug-info-nodebug.cpp index 9f140efaed6..1962b8cf574 100644 --- a/clang/test/CodeGenCXX/debug-info-nodebug.cpp +++ b/clang/test/CodeGenCXX/debug-info-nodebug.cpp @@ -1,5 +1,5 @@ -// RUN: %clang_cc1 -DSETNODEBUG=0 -emit-llvm -debug-info-kind=limited %s -o - | FileCheck %s --check-prefix=YESINFO -// RUN: %clang_cc1 -DSETNODEBUG=1 -emit-llvm -debug-info-kind=limited %s -o - | FileCheck %s --check-prefix=NOINFO +// RUN: %clang_cc1 -DSETNODEBUG=0 -emit-llvm -std=c++14 -debug-info-kind=limited %s -o - | FileCheck %s --check-prefix=YESINFO +// RUN: %clang_cc1 -DSETNODEBUG=1 -emit-llvm -std=c++14 -debug-info-kind=limited %s -o - | FileCheck %s --check-prefix=NOINFO #if SETNODEBUG #define NODEBUG __attribute__((nodebug)) @@ -53,3 +53,15 @@ void func4() { // NOINFO-NOT: !DIGlobalVariable(name: "static_local" // YESINFO-DAG: !DILocalVariable(name: "normal_local" // NOINFO-NOT: !DILocalVariable(name: "normal_local" + +template +using y NODEBUG = int; +void func5() { + NODEBUG typedef int x; + x a; + y b; +} +// YESINFO-DAG: !DIDerivedType(tag: DW_TAG_typedef, name: "x" +// NOINFO-NOT: !DIDerivedType(tag: DW_TAG_typedef, name: "x" +// YESINFO-DAG: !DIDerivedType(tag: DW_TAG_typedef, name: "y" +// NOINFO-NOT: !DIDerivedType(tag: DW_TAG_typedef, name: "y" -- cgit v1.2.3