]> granicus.if.org Git - clang/commitdiff
Move BlockByrefHelpers back to CodeGenModule.h to placate MSVC.
authorJohn McCall <rjmccall@apple.com>
Tue, 8 Sep 2015 08:21:11 +0000 (08:21 +0000)
committerJohn McCall <rjmccall@apple.com>
Tue, 8 Sep 2015 08:21:11 +0000 (08:21 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@246986 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CGBlocks.h
lib/CodeGen/CodeGenModule.h

index 6be47c55b8e2f3dc20ff0dfc9b0d0186766d640f..1edabef4ec7431e6c5a53285445ef8e4ed3ed550 100644 (file)
@@ -149,34 +149,6 @@ public:
   CharUnits FieldOffset;
 };
 
-/// A pair of helper functions for a __block variable.
-class BlockByrefHelpers : public llvm::FoldingSetNode {
-public:
-  llvm::Constant *CopyHelper;
-  llvm::Constant *DisposeHelper;
-
-  /// The alignment of the field.  This is important because
-  /// different offsets to the field within the byref struct need to
-  /// have different helper functions.
-  CharUnits Alignment;
-
-  BlockByrefHelpers(CharUnits alignment) : Alignment(alignment) {}
-  BlockByrefHelpers(const BlockByrefHelpers &) = default;
-  virtual ~BlockByrefHelpers();
-
-  void Profile(llvm::FoldingSetNodeID &id) const {
-    id.AddInteger(Alignment.getQuantity());
-    profileImpl(id);
-  }
-  virtual void profileImpl(llvm::FoldingSetNodeID &id) const = 0;
-
-  virtual bool needsCopy() const { return true; }
-  virtual void emitCopy(CodeGenFunction &CGF, Address dest, Address src) = 0;
-
-  virtual bool needsDispose() const { return true; }
-  virtual void emitDispose(CodeGenFunction &CGF, Address field) = 0;
-};
-
 /// CGBlockInfo - Information to generate a block literal.
 class CGBlockInfo {
 public:
index fcc499392e5361d2ad0382f42527caaf0ad2569b..4bb50a35f40a1cbe5b1ae5c0e8362f319fc6be1e 100644 (file)
@@ -79,7 +79,6 @@ class CoverageSourceInfo;
 
 namespace CodeGen {
 
-class BlockByrefHelpers;
 class CallArgList;
 class CodeGenFunction;
 class CodeGenTBAA;
@@ -210,6 +209,36 @@ public:
   void reportDiagnostics(DiagnosticsEngine &Diags, StringRef MainFile);
 };
 
+/// A pair of helper functions for a __block variable.
+class BlockByrefHelpers : public llvm::FoldingSetNode {
+  // MSVC requires this type to be complete in order to process this
+  // header.
+public:
+  llvm::Constant *CopyHelper;
+  llvm::Constant *DisposeHelper;
+
+  /// The alignment of the field.  This is important because
+  /// different offsets to the field within the byref struct need to
+  /// have different helper functions.
+  CharUnits Alignment;
+
+  BlockByrefHelpers(CharUnits alignment) : Alignment(alignment) {}
+  BlockByrefHelpers(const BlockByrefHelpers &) = default;
+  virtual ~BlockByrefHelpers();
+
+  void Profile(llvm::FoldingSetNodeID &id) const {
+    id.AddInteger(Alignment.getQuantity());
+    profileImpl(id);
+  }
+  virtual void profileImpl(llvm::FoldingSetNodeID &id) const = 0;
+
+  virtual bool needsCopy() const { return true; }
+  virtual void emitCopy(CodeGenFunction &CGF, Address dest, Address src) = 0;
+
+  virtual bool needsDispose() const { return true; }
+  virtual void emitDispose(CodeGenFunction &CGF, Address field) = 0;
+};
+
 /// This class organizes the cross-function state that is used while generating
 /// LLVM code.
 class CodeGenModule : public CodeGenTypeCache {