Index: clang/lib/CodeGen/CGDebugInfo.cpp =================================================================== --- clang/lib/CodeGen/CGDebugInfo.cpp +++ clang/lib/CodeGen/CGDebugInfo.cpp @@ -3656,7 +3656,11 @@ Fn); } else { // Use llvm function name. - Name = Fn->getName(); + if (Fn->getName().startswith("___Z")) + LinkageName = Fn->getName(); + else + Name = Fn->getName(); + Flags |= llvm::DINode::FlagPrototyped; } if (Name.startswith("\01")) Index: clang/test/CodeGenCXX/debug-info-block-invocation-linkage-name.cpp =================================================================== --- /dev/null +++ clang/test/CodeGenCXX/debug-info-block-invocation-linkage-name.cpp @@ -0,0 +1,14 @@ +// RUN: %clang_cc1 -emit-llvm -debug-info-kind=standalone -fblocks -triple %itanium_abi_triple %s -o - | FileCheck %s + +// CHECK: !DISubprogram(linkageName: "___Z1fU13block_pointerFviE_block_invoke" +void g(void (^call)(int)); + +void f(void (^callback)(int)) { + g(^(int x){ + callback(x); + }); +} + +void h() { + f(^(int x){}); +}