forked from OSchip/llvm-project
Avoid getNameAsCString when the decl doesn't have a name.
Build of the parm list with the iterator, not end(). llvm-svn: 64851
This commit is contained in:
parent
491812cd76
commit
eecd39f2d7
|
@ -149,6 +149,7 @@ llvm::Constant *CodeGenFunction::BuildBlockLiteralTmp(const BlockExpr *BE) {
|
|||
// __FuncPtr
|
||||
const char *Name = "";
|
||||
if (const NamedDecl *ND = dyn_cast<NamedDecl>(CurFuncDecl))
|
||||
if (ND->getIdentifier())
|
||||
Name = ND->getNameAsCString();
|
||||
BlockInfo Info(0, Name);
|
||||
llvm::Function *Fn = CodeGenFunction(*this).GenerateBlockFunction(BE, Info);
|
||||
|
@ -371,7 +372,7 @@ llvm::Function *CodeGenFunction::GenerateBlockFunction(const BlockExpr *Expr,
|
|||
|
||||
for (BlockDecl::param_iterator i = BD->param_begin(),
|
||||
e = BD->param_end(); i != e; ++i)
|
||||
Args.push_back(std::make_pair(*e, (*e)->getType()));
|
||||
Args.push_back(std::make_pair(*i, (*i)->getType()));
|
||||
|
||||
const CGFunctionInfo &FI =
|
||||
CGM.getTypes().getFunctionInfo(FTy->getResultType(), Args);
|
||||
|
|
Loading…
Reference in New Issue