aboutsummaryrefslogtreecommitdiff
path: root/gcc/d/d-tree.h
diff options
context:
space:
mode:
authorIain Buclaw <ibuclaw@gdcproject.org>2022-08-15 19:00:43 +0200
committerIain Buclaw <ibuclaw@gdcproject.org>2022-08-15 21:35:10 +0200
commit8db5b71e212debcc4f6a17f80191ca187c307fcb (patch)
tree19dedca9ea02beaa0587e37b8b5f5301ca061361 /gcc/d/d-tree.h
parente206fecaac29f559f4990312b875604eb1ce3ef3 (diff)
downloadgcc-8db5b71e212debcc4f6a17f80191ca187c307fcb.zip
gcc-8db5b71e212debcc4f6a17f80191ca187c307fcb.tar.gz
gcc-8db5b71e212debcc4f6a17f80191ca187c307fcb.tar.bz2
d: Defer compiling inline definitions until after the module has finished.
This is to prevent the case of when generating the methods of a struct type, we don't accidentally emit an inline function that references it, as the outer struct itself would still be incomplete. gcc/d/ChangeLog: * d-tree.h (d_defer_declaration): Declare. * decl.cc (function_needs_inline_definition_p): Defer checking DECL_UNINLINABLE and DECL_DECLARED_INLINE_P. (maybe_build_decl_tree): Call d_defer_declaration instead of build_decl_tree. * modules.cc (deferred_inline_declarations): New variable. (build_module_tree): Set deferred_inline_declarations and a handle declarations pushed to it. (d_defer_declaration): New function.
Diffstat (limited to 'gcc/d/d-tree.h')
-rw-r--r--gcc/d/d-tree.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/gcc/d/d-tree.h b/gcc/d/d-tree.h
index 809a242..4885cfe 100644
--- a/gcc/d/d-tree.h
+++ b/gcc/d/d-tree.h
@@ -673,6 +673,7 @@ extern tree maybe_expand_intrinsic (tree);
extern void build_module_tree (Module *);
extern tree d_module_context (void);
extern void register_module_decl (Declaration *);
+extern void d_defer_declaration (Declaration *);
extern void d_finish_compilation (tree *, int);
/* In runtime.cc. */