diff options
Diffstat (limited to 'clang')
| -rw-r--r-- | clang/lib/CodeGen/CodeGenFunction.cpp | 4 | ||||
| -rw-r--r-- | clang/test/CodeGenCXX/PR4890-debug-info-dtor.cpp | 6 | 
2 files changed, 8 insertions, 2 deletions
diff --git a/clang/lib/CodeGen/CodeGenFunction.cpp b/clang/lib/CodeGen/CodeGenFunction.cpp index d42d0723fa8..a3ce8a59586 100644 --- a/clang/lib/CodeGen/CodeGenFunction.cpp +++ b/clang/lib/CodeGen/CodeGenFunction.cpp @@ -175,8 +175,8 @@ void CodeGenFunction::StartFunction(GlobalDecl GD, QualType RetTy,    // 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. diff --git a/clang/test/CodeGenCXX/PR4890-debug-info-dtor.cpp b/clang/test/CodeGenCXX/PR4890-debug-info-dtor.cpp new file mode 100644 index 00000000000..a0d3a8ddac2 --- /dev/null +++ b/clang/test/CodeGenCXX/PR4890-debug-info-dtor.cpp @@ -0,0 +1,6 @@ +// RUN: clang-cc -emit-llvm-only -g %s +struct X { +  ~X(); +}; + +X::~X() { }  | 

