r240664 - Omit 'nodebug' methods from the class description.

Paul Robinson paul_robinson at playstation.sony.com
Thu Jun 25 10:50:43 PDT 2015


Author: probinson
Date: Thu Jun 25 12:50:43 2015
New Revision: 240664

URL: http://llvm.org/viewvc/llvm-project?rev=240664&view=rev
Log:
Omit 'nodebug' methods from the class description.

Added:
    cfe/trunk/test/CodeGenCXX/debug-info-method-nodebug.cpp
Modified:
    cfe/trunk/lib/CodeGen/CGDebugInfo.cpp

Modified: cfe/trunk/lib/CodeGen/CGDebugInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGDebugInfo.cpp?rev=240664&r1=240663&r2=240664&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGDebugInfo.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGDebugInfo.cpp Thu Jun 25 12:50:43 2015
@@ -1179,12 +1179,13 @@ void CGDebugInfo::CollectCXXMemberFuncti
     // 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<NoDebugAttr>())
       continue;
 
     if (Method->getType()->getAs<FunctionProtoType>()->getContainedAutoType())

Added: cfe/trunk/test/CodeGenCXX/debug-info-method-nodebug.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/debug-info-method-nodebug.cpp?rev=240664&view=auto
==============================================================================
--- cfe/trunk/test/CodeGenCXX/debug-info-method-nodebug.cpp (added)
+++ cfe/trunk/test/CodeGenCXX/debug-info-method-nodebug.cpp Thu Jun 25 12:50:43 2015
@@ -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"





More information about the cfe-commits mailing list