[cfe-commits] r81486 - in /cfe/trunk: lib/CodeGen/CodeGenFunction.cpp test/CodeGenCXX/PR4890-debug-info-dtor.cpp

Anders Carlsson andersca at mac.com
Thu Sep 10 17:11:35 PDT 2009


Author: andersca
Date: Thu Sep 10 19:11:35 2009
New Revision: 81486

URL: http://llvm.org/viewvc/llvm-project?rev=81486&view=rev
Log:
Pass the GlobalDecl to getMangledName, fixes PR4890.

Added:
    cfe/trunk/test/CodeGenCXX/PR4890-debug-info-dtor.cpp
Modified:
    cfe/trunk/lib/CodeGen/CodeGenFunction.cpp

Modified: cfe/trunk/lib/CodeGen/CodeGenFunction.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CodeGenFunction.cpp?rev=81486&r1=81485&r2=81486&view=diff

==============================================================================
--- cfe/trunk/lib/CodeGen/CodeGenFunction.cpp (original)
+++ cfe/trunk/lib/CodeGen/CodeGenFunction.cpp Thu Sep 10 19:11:35 2009
@@ -175,8 +175,8 @@
   // FIXME: The cast here is a huge hack.
   if (CGDebugInfo *DI = getDebugInfo()) {
     DI->setLocation(StartLoc);
-    if (const FunctionDecl *FD = dyn_cast_or_null<FunctionDecl>(D)) {
-      DI->EmitFunctionStart(CGM.getMangledName(FD), RetTy, CurFn, Builder);
+    if (isa<FunctionDecl>(D)) {
+      DI->EmitFunctionStart(CGM.getMangledName(GD), RetTy, CurFn, Builder);
     } else {
       // Just use LLVM function name.
 

Added: cfe/trunk/test/CodeGenCXX/PR4890-debug-info-dtor.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/PR4890-debug-info-dtor.cpp?rev=81486&view=auto

==============================================================================
--- cfe/trunk/test/CodeGenCXX/PR4890-debug-info-dtor.cpp (added)
+++ cfe/trunk/test/CodeGenCXX/PR4890-debug-info-dtor.cpp Thu Sep 10 19:11:35 2009
@@ -0,0 +1,6 @@
+// RUN: clang-cc -emit-llvm-only -g %s
+struct X {
+  ~X();
+};
+
+X::~X() { }





More information about the cfe-commits mailing list