[cfe-commits] r115090 - in /cfe/trunk: lib/CodeGen/CGDebugInfo.cpp test/CodeGenCXX/debug-info-method.cpp

Devang Patel dpatel at apple.com
Wed Sep 29 14:46:16 PDT 2010


Author: dpatel
Date: Wed Sep 29 16:46:16 2010
New Revision: 115090

URL: http://llvm.org/viewvc/llvm-project?rev=115090&view=rev
Log:
Emit method access specifier.
Radar 8490416.

Added:
    cfe/trunk/test/CodeGenCXX/debug-info-method.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=115090&r1=115089&r2=115090&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGDebugInfo.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGDebugInfo.cpp Wed Sep 29 16:46:16 2010
@@ -701,6 +701,12 @@
   unsigned Flags = 0;
   if (Method->isImplicit())
     Flags |= llvm::DIDescriptor::FlagArtificial;
+  AccessSpecifier Access = Method->getAccess();
+  if (Access == clang::AS_private)
+    Flags |= llvm::DIDescriptor::FlagPrivate;
+  else if (Access == clang::AS_protected)
+    Flags |= llvm::DIDescriptor::FlagProtected;
+
   llvm::DISubprogram SP =
     DebugFactory.CreateSubprogram(RecordTy , MethodName, MethodName, 
                                   MethodLinkageName,

Added: cfe/trunk/test/CodeGenCXX/debug-info-method.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/debug-info-method.cpp?rev=115090&view=auto
==============================================================================
--- cfe/trunk/test/CodeGenCXX/debug-info-method.cpp (added)
+++ cfe/trunk/test/CodeGenCXX/debug-info-method.cpp Wed Sep 29 16:46:16 2010
@@ -0,0 +1,6 @@
+// RUN: %clang -fverbose-asm -cc1 -g -S %s -o - | grep DW_ACCESS_protected
+class A {
+protected:
+  int foo();
+}; 
+A a;





More information about the cfe-commits mailing list