Elts.push_back(C);
// __FuncPtr
- std::string Name;
+ const char *Name;
if (const NamedDecl *ND = dyn_cast<NamedDecl>(CurFuncDecl))
- Name = ND->getNameAsString();
+ Name = ND->getNameAsCString();
BlockInfo Info(0, Name);
llvm::Function *Fn = CodeGenFunction(*this).GenerateBlockFunction(BE, Info);
Elts.push_back(Fn);
}
llvm::Constant *
-CodeGenModule::GetAddrOfGlobalBlock(const BlockExpr *BE, std::string n) {
+CodeGenModule::GetAddrOfGlobalBlock(const BlockExpr *BE, const char * n) {
// Generate the block descriptor.
const llvm::Type *UnsignedLongTy = Types.ConvertType(Context.UnsignedLongTy);
const llvm::IntegerType *IntTy = cast<llvm::IntegerType>(
const llvm::Type *BlockLiteralTy;
/// Name - the name of the function this block was created for, if any
- std::string Name;
+ const char *Name;
- BlockInfo(const llvm::Type *blt, std::string n)
+ BlockInfo(const llvm::Type *blt, const char *n)
: BlockLiteralTy(blt), Name(n) {}
};
llvm::Function *GenerateBlockFunction(const BlockExpr *Expr,
const BlockInfo& Info);
-
+
void GenerateCode(const FunctionDecl *FD,
llvm::Function *Fn);
void StartFunction(const Decl *D, QualType RetTy,
llvm::Constant *GetAddrOfConstantCString(const std::string &str,
const char *GlobalName=0);
- llvm::Constant *GetAddrOfGlobalBlock(const BlockExpr *BE, std::string);
+ llvm::Constant *GetAddrOfGlobalBlock(const BlockExpr *BE, const char *);
/// getBuiltinLibFunction - Given a builtin id for a function like
/// "__builtin_fabsf", return a Function* for "fabsf".