This repository was archived by the owner on Jun 20, 2019. It is now read-only.
File tree 2 files changed +24
-2
lines changed
2 files changed +24
-2
lines changed Original file line number Diff line number Diff line change 24
24
(build_closure): Don't set chain field for functions without context
25
25
pointer.
26
26
27
+ 2018-01-21 Iain Buclaw <
[email protected] >
28
+
29
+ * decls.cc (get_symbol_decl): Handle pragma(inline) attributes.
30
+
27
31
2018-01-21 Iain Buclaw <
[email protected] >
28
32
29
33
* decl.cc (DeclVisitor::visit(StructDeclaration)): Mark compiler
Original file line number Diff line number Diff line change @@ -1131,8 +1131,16 @@ get_symbol_decl (Declaration *decl)
1131
1131
d_keep (newfntype);
1132
1132
}
1133
1133
1134
- /* Miscellaneous function flags. */
1135
- if (fd->isMember2 () || fd->isFuncLiteralDeclaration ())
1134
+ /* In [pragma/inline], The attribute pragma(inline) affects whether a
1135
+ function should be inlined or not. */
1136
+ if (fd->inlining == PINLINEnever)
1137
+ DECL_UNINLINABLE (decl->csym ) = 1 ;
1138
+ else if (fd->inlining == PINLINEalways)
1139
+ {
1140
+ DECL_DECLARED_INLINE_P (decl->csym ) = 1 ;
1141
+ DECL_DISREGARD_INLINE_LIMITS (decl->csym ) = 1 ;
1142
+ }
1143
+ else if (fd->isMember2 () || fd->isFuncLiteralDeclaration ())
1136
1144
{
1137
1145
/* See grokmethod in cp/decl.c. Maybe we shouldn't be setting inline
1138
1146
flags without reason or proper handling. */
@@ -1240,6 +1248,16 @@ get_symbol_decl (Declaration *decl)
1240
1248
else
1241
1249
DECL_EXTERNAL (decl->csym ) = 1 ;
1242
1250
}
1251
+
1252
+ /* Don't keep functions declared pragma(inline, true) unless
1253
+ the user wants us to keep all inline functions. */
1254
+ if (fd && fd->inlining == PINLINEalways && TREE_PUBLIC (decl->csym ))
1255
+ {
1256
+ if (flag_keep_inline_functions)
1257
+ mark_needed (decl->csym );
1258
+
1259
+ d_comdat_linkage (decl->csym ) = 1 ;
1260
+ }
1243
1261
}
1244
1262
1245
1263
/* Symbol is going in thread local storage. */
You can’t perform that action at this time.
0 commit comments