summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Robinson <paul_robinson@playstation.sony.com>2015-06-25 17:50:43 +0000
committerPaul Robinson <paul_robinson@playstation.sony.com>2015-06-25 17:50:43 +0000
commit6a7511bea952aff59756cc7407be608b4d179548 (patch)
tree81e46a8783a120bcb9ae7962e71683b2fca670ca
parentb289cba50eac84289220e48cc5a043a4fa9301bd (diff)
downloadbcm5719-llvm-6a7511bea952aff59756cc7407be608b4d179548.tar.gz
bcm5719-llvm-6a7511bea952aff59756cc7407be608b4d179548.zip
Omit 'nodebug' methods from the class description.
llvm-svn: 240664
-rw-r--r--clang/lib/CodeGen/CGDebugInfo.cpp3
-rw-r--r--clang/test/CodeGenCXX/debug-info-method-nodebug.cpp12
2 files changed, 14 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CGDebugInfo.cpp b/clang/lib/CodeGen/CGDebugInfo.cpp
index 8a7d3af61fd..a139ce0e073 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<NoDebugAttr>())
continue;
if (Method->getType()->getAs<FunctionProtoType>()->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 00000000000..474053a4caa
--- /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"
OpenPOWER on IntegriCloud