aboutsummaryrefslogtreecommitdiffhomepage
path: root/third_party/protobuf/add_noinlines.patch
blob: af74798f0678d84d26681e947cef416a79090aa0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
diff -u -r a/src/google/protobuf/compiler/cpp/cpp_file.cc b/src/google/protobuf/compiler/cpp/cpp_file.cc
--- a/src/google/protobuf/compiler/cpp/cpp_file.cc	2017-02-10 23:55:34.000000000 +0100
+++ b/src/google/protobuf/compiler/cpp/cpp_file.cc	2017-03-21 13:41:46.931979154 +0100
@@ -557,7 +557,7 @@
         "      $metadata$, $enum_descriptors$, $service_descriptors$);\n"
         "}\n"
         "\n"
-        "void protobuf_AssignDescriptorsOnce() {\n"
+        "GOOGLE_ATTRIBUTE_NOINLINE void protobuf_AssignDescriptorsOnce() {\n"
         "  static GOOGLE_PROTOBUF_DECLARE_ONCE(once);\n"
         "  ::google::protobuf::GoogleOnceInit(&once, &protobuf_AssignDescriptors);\n"
         "}\n"
@@ -656,7 +656,7 @@
   printer->Print(
       "}\n"
       "\n"
-      "void InitDefaults() {\n"
+      "GOOGLE_ATTRIBUTE_NOINLINE void InitDefaults() {\n"
       "  static GOOGLE_PROTOBUF_DECLARE_ONCE(once);\n"
       "  ::google::protobuf::GoogleOnceInit(&once, &TableStruct::InitDefaultsImpl);\n"
       "}\n");
@@ -737,7 +737,7 @@
   printer->Print(
       "}\n"
       "\n"
-      "void AddDescriptors() {\n"
+      "GOOGLE_ATTRIBUTE_NOINLINE void AddDescriptors() {\n"
       "  static GOOGLE_PROTOBUF_DECLARE_ONCE(once);\n"
       "  ::google::protobuf::GoogleOnceInit(&once, &AddDescriptorsImpl);\n"
       "}\n");