summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGBlocks.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-12-05 08:21:30 +0000
committerChris Lattner <sabre@nondot.org>2009-12-05 08:21:30 +0000
commite08ea7874a5ee932d874596e51f84d9c8d9046fe (patch)
tree9bf7c672346abb883c96e6b82c6d1c50be2dd089 /clang/lib/CodeGen/CGBlocks.cpp
parent29d63902494b802602f0bf84fecb67cd188bd2c1 (diff)
downloadbcm5719-llvm-e08ea7874a5ee932d874596e51f84d9c8d9046fe.tar.gz
bcm5719-llvm-e08ea7874a5ee932d874596e51f84d9c8d9046fe.zip
various cleanups.
llvm-svn: 90657
Diffstat (limited to 'clang/lib/CodeGen/CGBlocks.cpp')
-rw-r--r--clang/lib/CodeGen/CGBlocks.cpp20
1 files changed, 11 insertions, 9 deletions
diff --git a/clang/lib/CodeGen/CGBlocks.cpp b/clang/lib/CodeGen/CGBlocks.cpp
index 2df779ce9f5..9fc2c1a97d6 100644
--- a/clang/lib/CodeGen/CGBlocks.cpp
+++ b/clang/lib/CodeGen/CGBlocks.cpp
@@ -1136,36 +1136,38 @@ BlockFunction::GeneratebyrefDestroyHelperFunction(const llvm::Type *T,
}
llvm::Constant *BlockFunction::BuildbyrefCopyHelper(const llvm::Type *T,
- int flag, unsigned Align) {
- // All alignments below that of pointer alignment collpase down to just
+ int Flag, unsigned Align) {
+ // All alignments below that of pointer alignment collapse down to just
// pointer alignment, as we always have at least that much alignment to begin
// with.
Align /= unsigned(CGF.Target.getPointerAlign(0)/8);
+
// As an optimization, we only generate a single function of each kind we
// might need. We need a different one for each alignment and for each
// setting of flags. We mix Align and flag to get the kind.
- uint64_t kind = (uint64_t)Align*BLOCK_BYREF_CURRENT_MAX + flag;
- llvm::Constant *& Entry = CGM.AssignCache[kind];
+ uint64_t Kind = (uint64_t)Align*BLOCK_BYREF_CURRENT_MAX + Flag;
+ llvm::Constant *&Entry = CGM.AssignCache[Kind];
if (Entry)
return Entry;
- return Entry=CodeGenFunction(CGM).GeneratebyrefCopyHelperFunction(T, flag);
+ return Entry = CodeGenFunction(CGM).GeneratebyrefCopyHelperFunction(T, Flag);
}
llvm::Constant *BlockFunction::BuildbyrefDestroyHelper(const llvm::Type *T,
- int flag,
+ int Flag,
unsigned Align) {
// All alignments below that of pointer alignment collpase down to just
// pointer alignment, as we always have at least that much alignment to begin
// with.
Align /= unsigned(CGF.Target.getPointerAlign(0)/8);
+
// As an optimization, we only generate a single function of each kind we
// might need. We need a different one for each alignment and for each
// setting of flags. We mix Align and flag to get the kind.
- uint64_t kind = (uint64_t)Align*BLOCK_BYREF_CURRENT_MAX + flag;
- llvm::Constant *& Entry = CGM.DestroyCache[kind];
+ uint64_t Kind = (uint64_t)Align*BLOCK_BYREF_CURRENT_MAX + Flag;
+ llvm::Constant *&Entry = CGM.DestroyCache[Kind];
if (Entry)
return Entry;
- return Entry=CodeGenFunction(CGM).GeneratebyrefDestroyHelperFunction(T, flag);
+ return Entry=CodeGenFunction(CGM).GeneratebyrefDestroyHelperFunction(T, Flag);
}
llvm::Value *BlockFunction::getBlockObjectDispose() {
OpenPOWER on IntegriCloud