From f1c97eb52e55d2d1340a0345ed91e345fddcb65d Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Tue, 21 Apr 2009 04:41:23 +0000 Subject: use of predefined identifiers like __func__ at global scope warn in sema, but crashed codegen. Fix this to report the name of the llvm function. This fixes rdar://6808051 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69658 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/CGExpr.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/CodeGen/CGExpr.cpp') diff --git a/lib/CodeGen/CGExpr.cpp b/lib/CodeGen/CGExpr.cpp index 906a1e2cd6..3ca625cc72 100644 --- a/lib/CodeGen/CGExpr.cpp +++ b/lib/CodeGen/CGExpr.cpp @@ -753,7 +753,7 @@ LValue CodeGenFunction::EmitPredefinedFunctionName(unsigned Type) { } std::string FunctionName; - if(const FunctionDecl *FD = dyn_cast(CurFuncDecl)) { + if (const FunctionDecl *FD = dyn_cast_or_null(CurFuncDecl)) { FunctionName = CGM.getMangledName(FD); } else { // Just get the mangled name; skipping the asm prefix if it -- cgit v1.2.3