[cfe-commits] r64571 - in /cfe/trunk/lib/CodeGen: CGBlocks.cpp CodeGenFunction.h CodeGenModule.h
Mike Stump
mrs at apple.com
Sat Feb 14 14:49:33 PST 2009
Author: mrs
Date: Sat Feb 14 16:49:33 2009
New Revision: 64571
URL: http://llvm.org/viewvc/llvm-project?rev=64571&view=rev
Log:
Use getNameAsCString instead of getNameAsString and reflow the type.
Thanks Anders.
Modified:
cfe/trunk/lib/CodeGen/CGBlocks.cpp
cfe/trunk/lib/CodeGen/CodeGenFunction.h
cfe/trunk/lib/CodeGen/CodeGenModule.h
Modified: cfe/trunk/lib/CodeGen/CGBlocks.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGBlocks.cpp?rev=64571&r1=64570&r2=64571&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGBlocks.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGBlocks.cpp Sat Feb 14 16:49:33 2009
@@ -147,9 +147,9 @@
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 @@
}
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>(
Modified: cfe/trunk/lib/CodeGen/CodeGenFunction.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CodeGenFunction.h?rev=64571&r1=64570&r2=64571&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CodeGenFunction.h (original)
+++ cfe/trunk/lib/CodeGen/CodeGenFunction.h Sat Feb 14 16:49:33 2009
@@ -256,15 +256,15 @@
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,
Modified: cfe/trunk/lib/CodeGen/CodeGenModule.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CodeGenModule.h?rev=64571&r1=64570&r2=64571&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CodeGenModule.h (original)
+++ cfe/trunk/lib/CodeGen/CodeGenModule.h Sat Feb 14 16:49:33 2009
@@ -219,7 +219,7 @@
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".
More information about the cfe-commits
mailing list