From d883d841c20729972e70853cb08c2e4c7d044d2d Mon Sep 17 00:00:00 2001 From: Mike Stump Date: Wed, 4 Mar 2009 15:35:22 +0000 Subject: [PATCH] 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 --- lib/CodeGen/CGBlocks.h | 54 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 lib/CodeGen/CGBlocks.h 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 -- 2.40.0