From e6b7c28d17edf428c58ba65c549109c0a488a5be Mon Sep 17 00:00:00 2001 From: David Blaikie Date: Tue, 11 Apr 2017 20:46:34 +0000 Subject: Modular Codegen: Add/use a bit in serialized function definitions to track whether they are the subject of modular codegen Some decls are created not where they are written, but in other module files/users (implicit special members and function template implicit specializations). To correctly identify them, use a bit next to the definition to track the modular codegen property. Discussed whether the module file bit could be omitted in favor of reconstituting from the modular codegen decls list - best guess today is that the efficiency improvement of not having to deserialize the whole list whenever any function is queried by a module user is worth it for the small size increase of this redundant (list + bit-on-def) representation. Reviewers: rsmith Differential Revision: https://reviews.llvm.org/D29901 llvm-svn: 299982 --- clang/test/Modules/Inputs/codegen/foo.h | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'clang/test/Modules/Inputs/codegen/foo.h') diff --git a/clang/test/Modules/Inputs/codegen/foo.h b/clang/test/Modules/Inputs/codegen/foo.h index 3fcab718573..e77e8d1824e 100644 --- a/clang/test/Modules/Inputs/codegen/foo.h +++ b/clang/test/Modules/Inputs/codegen/foo.h @@ -2,3 +2,29 @@ inline void f1(const char* fmt, ...) { __builtin_va_list args; __builtin_va_start(args, fmt); } + +struct non_trivial_dtor { + ~non_trivial_dtor(); +}; + +struct implicit_dtor { + non_trivial_dtor d; +}; + +struct uninst_implicit_dtor { + non_trivial_dtor d; +}; + +inline void use_implicit_dtor() { + implicit_dtor d; +} + +template +void inst() { +} + +inline void inst_decl() { + // cause inst's declaration to be instantiated, without a definition. + (void)sizeof(&inst); + inst(); +} -- cgit v1.2.3