Pass the GlobalDecl to getMangledName, fixes PR4890.

llvm-svn: 81486
diff --git a/clang/lib/CodeGen/CodeGenFunction.cpp b/clang/lib/CodeGen/CodeGenFunction.cpp
index d42d072..a3ce8a5 100644
--- a/clang/lib/CodeGen/CodeGenFunction.cpp
+++ b/clang/lib/CodeGen/CodeGenFunction.cpp
@@ -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.