Use getNameAsCString instead of getNameAsString and reflow the type.

Thanks Anders.

llvm-svn: 64571
This commit is contained in:
Mike Stump 2009-02-14 22:49:33 +00:00
parent 2d5a2878d4
commit 0e7d7b68c8
3 changed files with 7 additions and 7 deletions

View File

@ -147,9 +147,9 @@ llvm::Constant *CodeGenFunction::BuildBlockLiteralTmp(const BlockExpr *BE) {
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);
@ -292,7 +292,7 @@ RValue CodeGenFunction::EmitBlockCallExpr(const CallExpr* E) {
}
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>(

View File

@ -256,15 +256,15 @@ public:
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,

View File

@ -219,7 +219,7 @@ public:
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".