[ObjC] Don't rely so heavily on fwd decls in the headers.

This past reliance doesn't work well with Swift, and the sources
were trying to over hand optimize to minimize rebuilds, and that
likely isn't worth the trouble, so explicit imports.

The remaining places that still use them are where they are
needed within the header to deal with relationships between
the local definitions or where there is a cycle between the
headers and it allows either one to be imported first and still
get a complete definition in the using context.

PiperOrigin-RevId: 671379912
This commit is contained in:
Thomas Van Lenten 2024-09-05 08:21:23 -07:00 committed by Copybara-Service
parent 3c3d4900bc
commit 231b968b9c
20 changed files with 44 additions and 38 deletions

View file

@ -7,7 +7,7 @@
#import "GPBArray.h"
@class GPBMessage;
#import "GPBMessage.h"
//%PDDM-DEFINE DECLARE_ARRAY_EXTRAS()
//%ARRAY_INTERFACE_EXTRAS(Int32, int32_t)

View file

@ -9,7 +9,7 @@
#import "GPBExtensionRegistry.h"
@class GPBMessage;
#import "GPBMessage.h"
NS_ASSUME_NONNULL_BEGIN

View file

@ -11,8 +11,10 @@
#import "GPBCodedInputStream.h"
#import "GPBDescriptor.h"
#import "GPBUnknownFieldSet.h"
@class GPBUnknownFieldSet;
@class GPBFieldDescriptor;
typedef struct GPBCodedInputStreamState {
const uint8_t *bytes;

View file

@ -10,15 +10,9 @@
#import "GPBRuntimeTypes.h"
#import "GPBWireFormat.h"
@class GPBBoolArray;
@class GPBDoubleArray;
@class GPBEnumArray;
@class GPBFloatArray;
@class GPBMessage;
@class GPBInt32Array;
@class GPBInt64Array;
@class GPBUInt32Array;
@class GPBUInt64Array;
#import "GPBArray.h"
#import "GPBUnknownFieldSet.h"
@class GPBUnknownFieldSet;
NS_ASSUME_NONNULL_BEGIN

View file

@ -5,8 +5,12 @@
// license that can be found in the LICENSE file or at
// https://developers.google.com/open-source/licenses/bsd
#import <Foundation/Foundation.h>
#import "GPBCodedOutputStream.h"
#import "GPBMessage.h"
NS_ASSUME_NONNULL_BEGIN
CF_EXTERN_C_BEGIN

View file

@ -9,10 +9,10 @@
#import "GPBDictionary.h"
@class GPBCodedInputStream;
@class GPBCodedOutputStream;
@protocol GPBExtensionRegistry;
@class GPBFieldDescriptor;
#import "GPBCodedInputStream.h"
#import "GPBCodedOutputStream.h"
#import "GPBDescriptor.h"
#import "GPBExtensionRegistry.h"
@protocol GPBDictionaryInternalsProtocol
- (size_t)computeSerializedSizeAsField:(GPBFieldDescriptor *)field;

View file

@ -7,11 +7,12 @@
#import <Foundation/Foundation.h>
#import "GPBCodedOutputStream.h"
#import "GPBDescriptor.h"
@class GPBCodedOutputStream;
size_t GPBComputeExtensionSerializedSizeIncludingTag(
GPBExtensionDescriptor *extension, id value);
size_t GPBComputeExtensionSerializedSizeIncludingTag(GPBExtensionDescriptor *extension, id value);
void GPBWriteExtensionValueToOutputStream(GPBExtensionDescriptor *extension, id value,
void GPBWriteExtensionValueToOutputStream(GPBExtensionDescriptor *extension,
id value,
GPBCodedOutputStream *output);

View file

@ -7,8 +7,7 @@
#import <Foundation/Foundation.h>
@class GPBDescriptor;
@class GPBExtensionDescriptor;
#import "GPBDescriptor.h"
NS_ASSUME_NONNULL_BEGIN

View file

@ -8,13 +8,15 @@
#import <Foundation/Foundation.h>
#import "GPBBootstrap.h"
#import "GPBCodedInputStream.h"
#import "GPBCodedOutputStream.h"
#import "GPBDescriptor.h"
#import "GPBExtensionRegistry.h"
#import "GPBUnknownFieldSet.h"
#import "GPBUnknownFields.h"
@class GPBDescriptor;
@class GPBCodedInputStream;
@class GPBCodedOutputStream;
@class GPBExtensionDescriptor;
@class GPBFieldDescriptor;
@class GPBUnknownFieldSet;
@class GPBUnknownFields;

View file

@ -7,7 +7,7 @@
#import <Foundation/Foundation.h>
@class GPBExtensionRegistry;
#import "GPBExtensionRegistry.h"
NS_ASSUME_NONNULL_BEGIN

View file

@ -9,7 +9,7 @@
#import "GPBRootObject.h"
@class GPBExtensionDescriptor;
#import "GPBDescriptor.h"
@interface GPBRootObject ()

View file

@ -11,7 +11,6 @@
@class GPBEnumDescriptor;
@class GPBMessage;
@class GPBInt32Array;
/**
* Verifies that a given value can be represented by an enum type.

View file

@ -7,9 +7,10 @@
#import <Foundation/Foundation.h>
@class GPBCodedOutputStream;
@class GPBUInt32Array;
@class GPBUInt64Array;
#import "GPBArray.h"
#import "GPBUnknownFieldSet.h"
#import "GPBUnknownFields.h"
@class GPBUnknownFieldSet;
@class GPBUnknownFields;

View file

@ -7,6 +7,8 @@
#import <Foundation/Foundation.h>
#import "GPBUnknownField.h"
@class GPBUnknownField;
NS_ASSUME_NONNULL_BEGIN

View file

@ -7,11 +7,10 @@
#import <Foundation/Foundation.h>
#import "GPBCodedInputStream.h"
#import "GPBCodedOutputStream.h"
#import "GPBUnknownFieldSet.h"
@class GPBCodedOutputStream;
@class GPBCodedInputStream;
@interface GPBUnknownFieldSet ()
- (NSData *)data;

View file

@ -9,6 +9,8 @@
#import "GPBUnknownField.h"
#import "GPBArray.h"
@class GPBCodedOutputStream;
@interface GPBUnknownField () {

View file

@ -7,6 +7,9 @@
#import <Foundation/Foundation.h>
#import "GPBMessage.h"
#import "GPBUnknownField.h"
@class GPBMessage;
@class GPBUnknownField;

View file

@ -9,8 +9,6 @@
#import "GPBUnknownFields.h"
@class GPBCodedOutputStream;
@interface GPBUnknownFields ()
- (nonnull NSData *)serializeAsData;

View file

@ -8,11 +8,10 @@
#import <Foundation/Foundation.h>
#import "GPBArray.h"
#import "GPBDescriptor.h"
#import "GPBMessage.h"
#import "GPBRuntimeTypes.h"
@class GPBOneofDescriptor;
CF_EXTERN_C_BEGIN
NS_ASSUME_NONNULL_BEGIN

View file

@ -9,6 +9,7 @@
#import "GPBUtilities.h"
#import "GPBDescriptor.h"
#import "GPBDescriptor_PackagePrivate.h"
// Macros for stringifying library symbols. These are used in the generated