forked from OSchip/llvm-project
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 llvm-svn: 69658
This commit is contained in:
parent
92b29b2f9f
commit
a9aeea9f27
|
@ -753,7 +753,7 @@ LValue CodeGenFunction::EmitPredefinedFunctionName(unsigned Type) {
|
|||
}
|
||||
|
||||
std::string FunctionName;
|
||||
if(const FunctionDecl *FD = dyn_cast<FunctionDecl>(CurFuncDecl)) {
|
||||
if (const FunctionDecl *FD = dyn_cast_or_null<FunctionDecl>(CurFuncDecl)) {
|
||||
FunctionName = CGM.getMangledName(FD);
|
||||
} else {
|
||||
// Just get the mangled name; skipping the asm prefix if it
|
||||
|
|
|
@ -17,4 +17,10 @@ struct s0 f2(struct s0 a0) {
|
|||
return ^(struct s0 a1){ return a1; }(a0);
|
||||
}
|
||||
|
||||
// This should not crash: rdar://6808051
|
||||
void *P = ^{
|
||||
void *Q = __func__;
|
||||
};
|
||||
|
||||
|
||||
// RUN: true
|
||||
|
|
Loading…
Reference in New Issue