r273008 - [codeview] Stop emitting fully qualified subprogram display names

Reid Kleckner via cfe-commits cfe-commits at lists.llvm.org
Fri Jun 17 09:11:20 PDT 2016


Author: rnk
Date: Fri Jun 17 11:11:20 2016
New Revision: 273008

URL: http://llvm.org/viewvc/llvm-project?rev=273008&view=rev
Log:
[codeview] Stop emitting fully qualified subprogram display names

This effectively reverts r255744, and leaves the printing option tweaks.

We can add the name qualifiers easily in the backend.

Modified:
    cfe/trunk/lib/CodeGen/CGDebugInfo.cpp
    cfe/trunk/test/CodeGenCXX/debug-info-codeview-display-name.cpp

Modified: cfe/trunk/lib/CodeGen/CGDebugInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGDebugInfo.cpp?rev=273008&r1=273007&r2=273008&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGDebugInfo.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGDebugInfo.cpp Fri Jun 17 11:11:20 2016
@@ -184,30 +184,24 @@ StringRef CGDebugInfo::getFunctionName(c
   FunctionTemplateSpecializationInfo *Info =
       FD->getTemplateSpecializationInfo();
 
-  if (!Info && FII && !CGM.getCodeGenOpts().EmitCodeView)
+  if (!Info && FII)
     return FII->getName();
 
   // Otherwise construct human readable name for debug info.
   SmallString<128> NS;
   llvm::raw_svector_ostream OS(NS);
   PrintingPolicy Policy(CGM.getLangOpts());
+  Policy.MSVCFormatting = CGM.getCodeGenOpts().EmitCodeView;
 
-  if (CGM.getCodeGenOpts().EmitCodeView) {
-    // Print a fully qualified name like MSVC would.
-    Policy.MSVCFormatting = true;
-    FD->printQualifiedName(OS, Policy);
-  } else {
-    // Print the unqualified name with some template arguments. This is what
-    // DWARF-based debuggers expect.
-    FD->printName(OS);
-    // Add any template specialization args.
-    if (Info) {
-      const TemplateArgumentList *TArgs = Info->TemplateArguments;
-      const TemplateArgument *Args = TArgs->data();
-      unsigned NumArgs = TArgs->size();
-      TemplateSpecializationType::PrintTemplateArgumentList(OS, Args, NumArgs,
-                                                            Policy);
-    }
+  // Print the unqualified name with some template arguments.
+  FD->printName(OS);
+  // Add any template specialization args.
+  if (Info) {
+    const TemplateArgumentList *TArgs = Info->TemplateArguments;
+    const TemplateArgument *Args = TArgs->data();
+    unsigned NumArgs = TArgs->size();
+    TemplateSpecializationType::PrintTemplateArgumentList(OS, Args, NumArgs,
+                                                          Policy);
   }
 
   // Copy this name on the side and use its reference.

Modified: cfe/trunk/test/CodeGenCXX/debug-info-codeview-display-name.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/debug-info-codeview-display-name.cpp?rev=273008&r1=273007&r2=273008&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/debug-info-codeview-display-name.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/debug-info-codeview-display-name.cpp Fri Jun 17 11:11:20 2016
@@ -6,9 +6,9 @@ void freefunc() { }
 
 namespace N {
   int b() { return 0; }
-// CHECK-DAG: "N::b"
+// CHECK-DAG: "b"
   namespace { void func() { } }
-// CHECK-DAG: "N::`anonymous namespace'::func
+// CHECK-DAG: "func"
 }
 
 void _c(void) {
@@ -19,19 +19,19 @@ void _c(void) {
 struct foo {
   int operator+(int);
   foo(){}
-// CHECK-DAG: "foo::foo"
+// CHECK-DAG: "foo"
 
   ~foo(){}
-// CHECK-DAG: "foo::~foo"
+// CHECK-DAG: "~foo"
 
   foo(int i){}
-// CHECK-DAG: "foo::foo"
+// CHECK-DAG: "foo"
 
   foo(char *q){}
-// CHECK-DAG: "foo::foo"
+// CHECK-DAG: "foo"
 
   static foo* static_method() { return 0; }
-// CHECK-DAG: "foo::static_method"
+// CHECK-DAG: "static_method"
 
 };
 
@@ -40,7 +40,7 @@ void use_foo() {
   foo::static_method();
 }
 
-// CHECK-DAG: "foo::operator+"
+// CHECK-DAG: "operator+"
 int foo::operator+(int a) { return a; }
 
 // PR17371
@@ -60,14 +60,14 @@ void OverloadedNewDelete::operator delet
 void OverloadedNewDelete::operator delete[](void *) { }
 int OverloadedNewDelete::operator+(int x) { return x; };
 
-// CHECK-DAG: "OverloadedNewDelete::operator new"
-// CHECK-DAG: "OverloadedNewDelete::operator new[]"
-// CHECK-DAG: "OverloadedNewDelete::operator delete"
-// CHECK-DAG: "OverloadedNewDelete::operator delete[]"
-// CHECK-DAG: "OverloadedNewDelete::operator+"
+// CHECK-DAG: "operator new"
+// CHECK-DAG: "operator new[]"
+// CHECK-DAG: "operator delete"
+// CHECK-DAG: "operator delete[]"
+// CHECK-DAG: "operator+"
 
-template <void (*)(void)>
+template <typename T, void (*)(void)>
 void fn_tmpl() {}
 
-template void fn_tmpl<freefunc>();
-// CHECK-DAG: "fn_tmpl"
+template void fn_tmpl<int, freefunc>();
+// CHECK-DAG: "fn_tmpl<int,&freefunc>"




More information about the cfe-commits mailing list