diff options
author | David Blaikie <dblaikie@gmail.com> | 2017-04-11 21:13:37 +0000 |
---|---|---|
committer | David Blaikie <dblaikie@gmail.com> | 2017-04-11 21:13:37 +0000 |
commit | 1ac9c98e6c40d9a1e6cb904b414161388af4a89c (patch) | |
tree | 1928c119f565401a0a8d7221f85fe4f0c3190d0b /clang/test | |
parent | ddb9ae192a0df1497eeda6e2627e82db3c85c0f0 (diff) | |
download | bcm5719-llvm-1ac9c98e6c40d9a1e6cb904b414161388af4a89c.tar.gz bcm5719-llvm-1ac9c98e6c40d9a1e6cb904b414161388af4a89c.zip |
Modular Codegen: Support homing debug info for types in modular objects
Matching the function-homing support for modular codegen. Any type
implicitly (implicit template specializations) or explicitly defined in
a module is attached to that module's object file and omitted elsewhere
(only a declaration used if necessary for references).
llvm-svn: 299987
Diffstat (limited to 'clang/test')
-rw-r--r-- | clang/test/Modules/Inputs/codegen-nodep/foo.h | 10 | ||||
-rw-r--r-- | clang/test/Modules/codegen-nodep.test | 6 | ||||
-rw-r--r-- | clang/test/Modules/codegen.test | 12 |
3 files changed, 21 insertions, 7 deletions
diff --git a/clang/test/Modules/Inputs/codegen-nodep/foo.h b/clang/test/Modules/Inputs/codegen-nodep/foo.h index af91e8d263b..e7b20a512db 100644 --- a/clang/test/Modules/Inputs/codegen-nodep/foo.h +++ b/clang/test/Modules/Inputs/codegen-nodep/foo.h @@ -1,5 +1,11 @@ template <typename T> -void ftempl() { +void foot() { } -inline void f() { +inline void foo() { } + +template <typename T> +struct bart { +}; +struct bar { +}; diff --git a/clang/test/Modules/codegen-nodep.test b/clang/test/Modules/codegen-nodep.test index cb2b4e37e9d..0c3eb47a1ea 100644 --- a/clang/test/Modules/codegen-nodep.test +++ b/clang/test/Modules/codegen-nodep.test @@ -7,7 +7,7 @@ RUN: %S/Inputs/codegen-nodep/foo.modulemap -o - \ RUN: | llvm-bcanalyzer - -dump \ RUN: | FileCheck %s -Ensure there's only one modular codegen decl - the sentinel plain inline -function, not any for the function template. +Ensure there are only two modular codegen decls (one for the class, one for the +function - none for the class and function templates). -CHECK: <MODULAR_CODEGEN_DECLS op0={{[0-9]+}}/> +CHECK: <MODULAR_CODEGEN_DECLS op0={{[0-9]+}} op1={{[0-9]+}}/> diff --git a/clang/test/Modules/codegen.test b/clang/test/Modules/codegen.test index 6807640e603..ce252e89ebd 100644 --- a/clang/test/Modules/codegen.test +++ b/clang/test/Modules/codegen.test @@ -3,8 +3,8 @@ REQUIRES: x86-registered-target RUN: %clang_cc1 -triple=x86_64-linux-gnu -fmodules-codegen -x c++ -fmodules -emit-module -fmodule-name=foo %S/Inputs/codegen/foo.modulemap -o %t/foo.pcm -RUN: %clang_cc1 -triple x86_64-linux-gnu -emit-llvm -o - %t/foo.pcm | FileCheck --check-prefix=FOO --check-prefix=BOTH %s -RUN: %clang_cc1 -triple x86_64-linux-gnu -emit-llvm -o - -fmodules -fmodule-file=%t/foo.pcm %S/Inputs/codegen/use.cpp | FileCheck --check-prefix=BOTH --check-prefix=USE %s +RUN: %clang_cc1 -triple x86_64-linux-gnu -emit-llvm -debug-info-kind=limited -o - %t/foo.pcm | FileCheck --check-prefix=FOO --check-prefix=BOTH %s +RUN: %clang_cc1 -triple x86_64-linux-gnu -emit-llvm -debug-info-kind=limited -o - -fmodules -fmodule-file=%t/foo.pcm %S/Inputs/codegen/use.cpp | FileCheck --check-prefix=BOTH --check-prefix=USE %s FOO: $_Z2f1PKcz = comdat any FOO: $_ZN13implicit_dtorD1Ev = comdat any @@ -25,3 +25,11 @@ FOO: define weak_odr void @_ZN13implicit_dtorD2Ev USE: define linkonce_odr void @_ZN20uninst_implicit_dtorD1Ev USE: define linkonce_odr void @_Z4instIiEvv USE: define linkonce_odr void @_ZN20uninst_implicit_dtorD2Ev + +Modular debug info puts the definition of a class defined in a module in that +module's object. Users of the module only get a declaration. + +'distinct' is used for definition records (the flags field is empty/unspecified) +FOO: = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "implicit_dtor" +Declarations are non-distinct and include the 'DIFlagFwdDecl' flag. +USE: = !DICompositeType(tag: DW_TAG_structure_type, name: "implicit_dtor", {{.*}}, flags: DIFlagFwdDecl |