From: Paul Robinson Date: Thu, 25 Jun 2015 17:50:43 +0000 (+0000) Subject: Omit 'nodebug' methods from the class description. X-Git-Tag: llvmorg-3.7.0-rc1~1527 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6a7511bea952aff59756cc7407be608b4d179548;p=platform%2Fupstream%2Fllvm.git Omit 'nodebug' methods from the class description. llvm-svn: 240664 --- diff --git a/clang/lib/CodeGen/CGDebugInfo.cpp b/clang/lib/CodeGen/CGDebugInfo.cpp index 8a7d3af..a139ce0 100644 --- a/clang/lib/CodeGen/CGDebugInfo.cpp +++ b/clang/lib/CodeGen/CGDebugInfo.cpp @@ -1179,12 +1179,13 @@ void CGDebugInfo::CollectCXXMemberFunctions( // the member being added to type units by LLVM, while still allowing it // to be emitted into the type declaration/reference inside the compile // unit. + // Ditto 'nodebug' methods, for consistency with CodeGenFunction.cpp. // FIXME: Handle Using(Shadow?)Decls here to create // DW_TAG_imported_declarations inside the class for base decls brought into // derived classes. GDB doesn't seem to notice/leverage these when I tried // it, so I'm not rushing to fix this. (GCC seems to produce them, if // referenced) - if (!Method || Method->isImplicit()) + if (!Method || Method->isImplicit() || Method->hasAttr()) continue; if (Method->getType()->getAs()->getContainedAutoType()) diff --git a/clang/test/CodeGenCXX/debug-info-method-nodebug.cpp b/clang/test/CodeGenCXX/debug-info-method-nodebug.cpp new file mode 100644 index 0000000..474053a --- /dev/null +++ b/clang/test/CodeGenCXX/debug-info-method-nodebug.cpp @@ -0,0 +1,12 @@ +// RUN: %clang_cc1 -emit-llvm -g %s -o - | FileCheck %s + +class C { + void present(); + void absent() __attribute__((nodebug)); +}; + +C c; + +// CHECK-NOT: name: "absent" +// CHECK: name: "present" +// CHECK-NOT: name: "absent"