summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2012-10-25 18:06:53 +0000
committerFariborz Jahanian <fjahanian@apple.com>2012-10-25 18:06:53 +0000
commitbf7bf29166cdc2a2d8b033135650ac38d5d816dd (patch)
tree27f7326ca66963f4868fc5da753fb41fedec1610 /clang/lib/CodeGen
parente337f71203e794186c354f9a0a1cf621a4ca0f5b (diff)
downloadbcm5719-llvm-bf7bf29166cdc2a2d8b033135650ac38d5d816dd.tar.gz
bcm5719-llvm-bf7bf29166cdc2a2d8b033135650ac38d5d816dd.zip
Provide comment describing what buildBlockDescriptor does.
llvm-svn: 166703
Diffstat (limited to 'clang/lib/CodeGen')
-rw-r--r--clang/lib/CodeGen/CGBlocks.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CGBlocks.cpp b/clang/lib/CodeGen/CGBlocks.cpp
index 7915c371759..3e126f85051 100644
--- a/clang/lib/CodeGen/CGBlocks.cpp
+++ b/clang/lib/CodeGen/CGBlocks.cpp
@@ -56,7 +56,18 @@ static llvm::Constant *buildDisposeHelper(CodeGenModule &CGM,
return CodeGenFunction(CGM).GenerateDestroyHelperFunction(blockInfo);
}
-/// Build the block descriptor constant for a block.
+/// buildBlockDescriptor - Build the block descriptor meta-data for a block.
+/// buildBlockDescriptor is accessed from 5th field of the Block_literal
+/// meta-data and contains stationary information about the block literal.
+/// Its definition will have 4 (or optinally 6) words.
+/// struct Block_descriptor {
+/// unsigned long reserved;
+/// unsigned long size; // size of Block_literal metadata in bytes.
+/// void *copy_func_helper_decl; // optional copy helper.
+/// void *destroy_func_decl; // optioanl destructor helper.
+/// void *block_method_encoding_address;//@encode for block literal signature.
+/// void *block_layout_info; // encoding of captured block variables.
+/// };
static llvm::Constant *buildBlockDescriptor(CodeGenModule &CGM,
const CGBlockInfo &blockInfo) {
ASTContext &C = CGM.getContext();
OpenPOWER on IntegriCloud