Migrate away from examining the syntax of a proto file via reflection.

PiperOrigin-RevId: 493088412
diff --git a/src/google/protobuf/compiler/csharp/csharp_helpers.h b/src/google/protobuf/compiler/csharp/csharp_helpers.h
index b9aa556..2c7715f 100644
--- a/src/google/protobuf/compiler/csharp/csharp_helpers.h
+++ b/src/google/protobuf/compiler/csharp/csharp_helpers.h
@@ -158,9 +158,8 @@
       descriptor->type() == FieldDescriptor::TYPE_MESSAGE) {
     return false;
   }
-  // has_optional_keyword() has more complex rules for proto2, but that
-  // doesn't matter given the first part of this condition.
-  return IsProto2(descriptor->file()) || descriptor->has_optional_keyword();
+
+  return descriptor->has_presence();
 }
 
 inline bool RequiresPresenceBit(const FieldDescriptor* descriptor) {