@ -353,7 +353,7 @@ inline bool HasFastArraySerialization(const FileDescriptor* file,
inline bool IsProto2MessageSet ( const Descriptor * descriptor ,
inline bool IsProto2MessageSet ( const Descriptor * descriptor ,
const Options & options ) {
const Options & options ) {
return ! options . opensource_runtime & &
return ! options . opensource_runtime & &
! options . enforce_lit e & &
options . enforce_mode ! = EnforceOptimizeMode : : kLiteRuntim e & &
! options . lite_implicit_weak_fields & &
! options . lite_implicit_weak_fields & &
descriptor - > options ( ) . message_set_wire_format ( ) & &
descriptor - > options ( ) . message_set_wire_format ( ) & &
descriptor - > full_name ( ) = = " google.protobuf.bridge.MessageSet " ;
descriptor - > full_name ( ) = = " google.protobuf.bridge.MessageSet " ;
@ -362,7 +362,7 @@ inline bool IsProto2MessageSet(const Descriptor* descriptor,
inline bool IsProto2MessageSetFile ( const FileDescriptor * file ,
inline bool IsProto2MessageSetFile ( const FileDescriptor * file ,
const Options & options ) {
const Options & options ) {
return ! options . opensource_runtime & &
return ! options . opensource_runtime & &
! options . enforce_lit e & &
options . enforce_mode ! = EnforceOptimizeMode : : kLiteRuntim e & &
! options . lite_implicit_weak_fields & &
! options . lite_implicit_weak_fields & &
file - > name ( ) = = " net/proto2/bridge/proto/message_set.proto " ;
file - > name ( ) = = " net/proto2/bridge/proto/message_set.proto " ;
}
}
@ -419,9 +419,15 @@ bool IsWellKnownMessage(const FileDescriptor* descriptor);
inline FileOptions_OptimizeMode GetOptimizeFor ( const FileDescriptor * file ,
inline FileOptions_OptimizeMode GetOptimizeFor ( const FileDescriptor * file ,
const Options & options ) {
const Options & options ) {
return options . enforce_lite
switch ( options . enforce_mode ) {
? FileOptions : : LITE_RUNTIME
case EnforceOptimizeMode : : kSpeed :
: file - > options ( ) . optimize_for ( ) ;
return FileOptions : : SPEED ;
case EnforceOptimizeMode : : kLiteRuntime :
return FileOptions : : LITE_RUNTIME ;
case EnforceOptimizeMode : : kNoEnforcement :
default :
return file - > options ( ) . optimize_for ( ) ;
}
}
}
// This orders the messages in a .pb.cc as it's outputted by file.cc
// This orders the messages in a .pb.cc as it's outputted by file.cc