[cfe-commits] r66034 - in /cfe/trunk/lib/CodeGen: CodeGenFunction.h CodeGenModule.h
Mike Stump
mrs at apple.com
Wed Mar 4 07:32:57 PST 2009
Author: mrs
Date: Wed Mar 4 09:32:52 2009
New Revision: 66034
URL: http://llvm.org/viewvc/llvm-project?rev=66034&view=rev
Log:
Start the migration of more of the blocks code out of sight for most
people. De-duplicates BLOCK_NEEDS_FREE and friends.
Modified:
cfe/trunk/lib/CodeGen/CodeGenFunction.h
cfe/trunk/lib/CodeGen/CodeGenModule.h
Modified: cfe/trunk/lib/CodeGen/CodeGenFunction.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CodeGenFunction.h?rev=66034&r1=66033&r2=66034&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CodeGenFunction.h (original)
+++ cfe/trunk/lib/CodeGen/CodeGenFunction.h Wed Mar 4 09:32:52 2009
@@ -25,6 +25,7 @@
#include <vector>
#include <map>
+#include "CGBlocks.h"
#include "CGBuilder.h"
#include "CGCall.h"
#include "CGValue.h"
@@ -61,7 +62,7 @@
/// CodeGenFunction - This class organizes the per-function state that is used
/// while generating LLVM code.
-class CodeGenFunction {
+ class CodeGenFunction : public BlockFunction {
CodeGenFunction(const CodeGenFunction&); // DO NOT IMPLEMENT
void operator=(const CodeGenFunction&); // DO NOT IMPLEMENT
public:
@@ -264,27 +265,6 @@
// Block Bits
//===--------------------------------------------------------------------===//
- 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 */
- };
-
- 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)
- };
-
llvm::Value *BuildCopyHelper(int flag);
llvm::Value *BuildDestroyHelper(int flag);
Modified: cfe/trunk/lib/CodeGen/CodeGenModule.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CodeGenModule.h?rev=66034&r1=66033&r2=66034&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CodeGenModule.h (original)
+++ cfe/trunk/lib/CodeGen/CodeGenModule.h Wed Mar 4 09:32:52 2009
@@ -20,6 +20,7 @@
#include "llvm/ADT/StringMap.h"
#include "llvm/ADT/StringSet.h"
+#include "CGBlocks.h"
#include "CGCall.h"
#include <list>
@@ -62,7 +63,7 @@
/// CodeGenModule - This class organizes the cross-function state that is used
/// while generating LLVM code.
-class CodeGenModule {
+ class CodeGenModule : public BlockModule {
CodeGenModule(const CodeGenModule&); // DO NOT IMPLEMENT
void operator=(const CodeGenModule&); // DO NOT IMPLEMENT
@@ -139,15 +140,6 @@
/// strings. This value has type int * but is actually an Obj-C class pointer.
llvm::Constant *CFConstantStringClassRef;
- 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)
- };
-
/// NSConcreteGlobalBlock - Cached reference to the class pointer for global
/// blocks.
llvm::Constant *NSConcreteGlobalBlock;
More information about the cfe-commits
mailing list