Author: rjmccall Date: Tue Sep 8 03:21:11 2015 New Revision: 246986 URL: http://llvm.org/viewvc/llvm-project?rev=246986&view=rev Log: Move BlockByrefHelpers back to CodeGenModule.h to placate MSVC.
Modified: cfe/trunk/lib/CodeGen/CGBlocks.h cfe/trunk/lib/CodeGen/CodeGenModule.h Modified: cfe/trunk/lib/CodeGen/CGBlocks.h URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGBlocks.h?rev=246986&r1=246985&r2=246986&view=diff ============================================================================== --- cfe/trunk/lib/CodeGen/CGBlocks.h (original) +++ cfe/trunk/lib/CodeGen/CGBlocks.h Tue Sep 8 03:21:11 2015 @@ -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: Modified: cfe/trunk/lib/CodeGen/CodeGenModule.h URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CodeGenModule.h?rev=246986&r1=246985&r2=246986&view=diff ============================================================================== --- cfe/trunk/lib/CodeGen/CodeGenModule.h (original) +++ cfe/trunk/lib/CodeGen/CodeGenModule.h Tue Sep 8 03:21:11 2015 @@ -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 { _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits