diff options
author | Mike Stump <mrs@apple.com> | 2009-03-04 15:35:22 +0000 |
---|---|---|
committer | Mike Stump <mrs@apple.com> | 2009-03-04 15:35:22 +0000 |
commit | d883d841c20729972e70853cb08c2e4c7d044d2d (patch) | |
tree | 567e64294e912b329f8ff487ef343d633d2be1c0 /lib/CodeGen | |
parent | 96bd13ae1ab89f5a04b3ad3ec8ec1864cbba3482 (diff) |
Start the migration of more of the blocks code out of sight for most
people. De-duplicates BLOCK_NEEDS_FREE and friends.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66035 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen')
-rw-r--r-- | lib/CodeGen/CGBlocks.h | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/lib/CodeGen/CGBlocks.h b/lib/CodeGen/CGBlocks.h new file mode 100644 index 0000000000..4ba699b7da --- /dev/null +++ b/lib/CodeGen/CGBlocks.h @@ -0,0 +1,54 @@ +//===-- CGBlocks.h - state for LLVM CodeGen for blocks ----------*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +// This is the internal state used for llvm translation for block literals. +// +//===----------------------------------------------------------------------===// + +#ifndef CLANG_CODEGEN_CGBLOCKS_H +#define CLANG_CODEGEN_CGBLOCKS_H + +namespace clang { + +namespace CodeGen { + +class BlockBase { +public: + enum { + BLOCK_NEEDS_FREE = (1 << 24), + BLOCK_HAS_COPY_DISPOSE = (1 << 25), + BLOCK_HAS_CXX_OBJ = (1 << 26), + BLOCK_IS_GC = (1 << 27), + BLOCK_IS_GLOBAL = (1 << 28), + BLOCK_HAS_DESCRIPTOR = (1 << 29) + }; +}; + +class BlockModule : public BlockBase { +}; + +class BlockFunction : public BlockBase { +public: + enum { + BLOCK_FIELD_IS_OBJECT = 3, /* id, NSObject, __attribute__((NSObject)), + block, ... */ + BLOCK_FIELD_IS_BLOCK = 7, /* a block variable */ + BLOCK_FIELD_IS_BYREF = 8, /* the on stack structure holding the __block + variable */ + BLOCK_FIELD_IS_WEAK = 16, /* declared __weak, only used in byref copy + helpers */ + BLOCK_BYREF_CALLER = 128 /* called from __block (byref) copy/dispose + support routines */ + }; +}; + +} // end namespace CodeGen +} // end namespace clang + +#endif |