[cfe-commits] r64851 - /cfe/trunk/lib/CodeGen/CGBlocks.cpp

Mike Stump mrs at apple.com
Tue Feb 17 15:25:52 PST 2009


Author: mrs
Date: Tue Feb 17 17:25:52 2009
New Revision: 64851

URL: http://llvm.org/viewvc/llvm-project?rev=64851&view=rev
Log:
Avoid getNameAsCString when the decl doesn't have a name.
Build of the parm list with the iterator, not end().

Modified:
    cfe/trunk/lib/CodeGen/CGBlocks.cpp

Modified: cfe/trunk/lib/CodeGen/CGBlocks.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGBlocks.cpp?rev=64851&r1=64850&r2=64851&view=diff

==============================================================================
--- cfe/trunk/lib/CodeGen/CGBlocks.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGBlocks.cpp Tue Feb 17 17:25:52 2009
@@ -149,7 +149,8 @@
     // __FuncPtr
     const char *Name = "";
     if (const NamedDecl *ND = dyn_cast<NamedDecl>(CurFuncDecl))
-      Name = ND->getNameAsCString();
+      if (ND->getIdentifier())
+        Name = ND->getNameAsCString();
     BlockInfo Info(0, Name);
     llvm::Function *Fn = CodeGenFunction(*this).GenerateBlockFunction(BE, Info);
     Elts.push_back(Fn);
@@ -371,7 +372,7 @@
 
   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);





More information about the cfe-commits mailing list