diff options
author | Daniel Dunbar <daniel@zuster.org> | 2009-02-25 19:24:29 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2009-02-25 19:24:29 +0000 |
commit | 22a87f94a9259c9295dc22d3d7e4b6c54e242f19 (patch) | |
tree | 9e0f5322bbe19a9f7f0fbb5a0e54158dd2b893c1 /clang/lib/CodeGen/CodeGenFunction.cpp | |
parent | af618171f48e2c571ab47daf1e71ec2d4e4b84bd (diff) | |
download | bcm5719-llvm-22a87f94a9259c9295dc22d3d7e4b6c54e242f19.tar.gz bcm5719-llvm-22a87f94a9259c9295dc22d3d7e4b6c54e242f19.zip |
Pull COdeGenFunction::CreateStaticBlockVarDecl (just for creating the
global variable) out of GenerateStaticBlockVarDecl.
- No intended functionality change.
- Prep for some mild cleanups and PR3662.
llvm-svn: 65466
Diffstat (limited to 'clang/lib/CodeGen/CodeGenFunction.cpp')
-rw-r--r-- | clang/lib/CodeGen/CodeGenFunction.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/clang/lib/CodeGen/CodeGenFunction.cpp b/clang/lib/CodeGen/CodeGenFunction.cpp index ccd961ac283..879b85891de 100644 --- a/clang/lib/CodeGen/CodeGenFunction.cpp +++ b/clang/lib/CodeGen/CodeGenFunction.cpp @@ -53,14 +53,15 @@ llvm::BasicBlock *CodeGenFunction::getBasicBlockForLabel(const LabelStmt *S) { return BB = createBasicBlock(S->getName()); } -llvm::Constant * -CodeGenFunction::GetAddrOfStaticLocalVar(const VarDecl *BVD) { - return cast<llvm::Constant>(LocalDeclMap[BVD]); +llvm::Value *CodeGenFunction::GetAddrOfLocalVar(const VarDecl *VD) { + llvm::Value *Res = LocalDeclMap[VD]; + assert(Res && "Invalid argument to GetAddrOfLocalVar(), no decl!"); + return Res; } -llvm::Value *CodeGenFunction::GetAddrOfLocalVar(const VarDecl *VD) -{ - return LocalDeclMap[VD]; +llvm::Constant * +CodeGenFunction::GetAddrOfStaticLocalVar(const VarDecl *BVD) { + return cast<llvm::Constant>(GetAddrOfLocalVar(BVD)); } const llvm::Type *CodeGenFunction::ConvertTypeForMem(QualType T) { |