llvm-project/clang/test/Modules/Inputs
Volodymyr Sapsai 93764ff6e2 [modules] Fix miscompilation when using two RecordDecl definitions with the same name.
When deserializing a RecordDecl we don't enforce that redeclaration
chain contains only a single definition. So if the canonical decl is not
a definition itself, `RecordType::getDecl` can return different objects
before and after an include. It means we can build CGRecordLayout for
one RecordDecl with its set of FieldDecl but try to use it with
FieldDecl belonging to a different RecordDecl. With assertions enabled
it results in

> Assertion failed: (FieldInfo.count(FD) && "Invalid field for record!"),
> function getLLVMFieldNo, file llvm-project/clang/lib/CodeGen/CGRecordLayout.h, line 199.

and with assertions disabled a bunch of fields are treated as their
memory is located at offset 0.

Fix by keeping the first encountered RecordDecl definition and marking
the subsequent ones as non-definitions. Also need to merge FieldDecl
properly, so that `getPrimaryMergedDecl` works correctly and during name
lookup we don't treat fields from same-name RecordDecl as ambiguous.

rdar://80184238

Differential Revision: https://reviews.llvm.org/D106994
2021-08-30 17:51:38 -07:00
..
ASTHash Add AST_SIGNATURE record to unhashed control block of PCM files 2020-06-11 14:09:07 +01:00
AddRemovePrivate.framework
AlsoDependsOnModule.framework/Headers
AutolinkTBD.framework
CmdLine.framework/Headers
Conflicts
DebugInfoNamespace
DependsOnModule.framework [Modules] Add more language features to be used with requires-declaration 2018-02-14 19:01:03 +00:00
F.framework
FooFramework.framework
GNUAsm/NeedsGNUInlineAsm.framework
HasSubModules.framework
Main.framework
MainA.framework
Modified
Module.framework
ModuleDiags
ModuleMapLocations
MutuallyRecursive1.framework/Headers
MutuallyRecursive2.framework/Headers
NameInDir.framework
NameInDir2.framework
NameInDirInferred.framework/Headers
NoUmbrella.framework
NotAModule.framework/Headers
PR20399
PR20786
PR21547
PR21687
PR24954
PR25501
PR26014
PR26179
PR27041
PR27186
PR27401
PR27513
PR27699
PR27739
PR27754
PR27890
PR28332
PR28438
PR28752
PR28794
PR28812
PR31469
Rmodule-import Modules: Add -Rmodule-import 2019-03-06 02:50:46 +00:00
SameHeader
StdDef
System/usr/include
UseAfterFree
anon-namespace
anon-redecl
asm-goto Remove stale assert. 2020-09-24 13:59:42 -07:00
at-import-in-framework-header [Modules][ObjC] Warn on the use of '@import' in framework headers 2018-06-27 20:29:36 +00:00
attr-unavailable
auto-import-unavailable
autoload-subdirectory Reapply r336660: [Modules] Autoload subdirectory modulemaps with specific LangOpts 2018-07-18 23:21:19 +00:00
available-is-better
bad-private-include/Bad.framework [Modules] Honor -fmodule-name when handling private framework modules 2018-03-20 22:36:39 +00:00
check-for-sanitizer-feature
class-extension [Modules][ObjC] ASTReader should add protocols for class extensions 2018-04-27 18:01:23 +00:00
codegen
codegen-flags make -fmodules-codegen and -fmodules-debuginfo work also with PCHs 2020-07-09 15:22:26 +02:00
codegen-nodep
codegen-opt
crash-recovery
crash-typo-correction-visibility
cxx-dtor
cxx-lookup
cxx17 Don't diagnose a redeclaration of a deduction guide if the prior 2020-06-12 10:29:01 -07:00
cxx20 Don't diagnose a redeclaration of a deduction guide if the prior 2020-06-12 10:29:01 -07:00
declare-use Make module use diagnostics refer to the top-level module 2018-02-24 06:54:09 +00:00
deferred-lookup
diagnose-missing-import
double-quotes Fix an assert in -Wquoted-include-in-framework-header 2018-09-20 19:00:03 +00:00
elsewhere
empty
error [ASTReader] Only mark module out of date if not already compiled 2021-04-16 17:57:03 -07:00
exclude-header
explicit-build
explicit-build-diags [clang] Remove misleading assertion in FullSourceLoc 2021-08-06 14:48:28 +02:00
explicit-build-inferred/frameworks [clang][modules] Build inferred modules 2021-05-17 10:40:51 +02:00
explicit-build-overlap
explicit-build-prefer-self
exportas-link Add some infuriatingly necessary comments to this test case. 2018-04-17 11:08:05 +00:00
filename
framework-public-includes-private Warning for framework include violation from Headers to PrivateHeaders 2018-06-25 22:24:17 +00:00
getSourceDescriptor-crash
gnumode-non-benign
header-attribs
header-in-multiple-maps
hidden-names
implicit-built-Werror-using-W
implicit-invalidate-chain Revert "[modules] Do not cache invalid state for modules that we attempted to load." 2020-03-10 10:59:26 -07:00
implicit-invalidate-common [Modules] Fix rebuilding an updated module for each of its consumers. 2019-08-28 23:31:32 +00:00
implicit-private-canonical/A.framework [Modules] Fix remapping from Foo.Private to Foo_Private to happen before typo correction 2018-02-12 23:43:21 +00:00
implicit-private-with-different-name/A.framework
implicit-private-with-submodule/A.framework [Modules] Improve .Private fix-its to handle 'explicit' and 'framework' 2018-06-15 20:13:28 +00:00
implicit-private-without-public [modules] Allow frameworks to have only a private module without a public one. 2020-02-28 15:40:24 -08:00
import-once [HeaderSearch] Fix processing #import-ed headers multiple times with modules enabled. 2020-08-20 17:41:28 -07:00
import-textual
include-relative
include_next
incomplete-framework-module/Foo.framework [Modules] Warning for module declarations lacking 'framework' qualifier 2018-06-01 01:26:18 +00:00
incomplete-umbrella/Foo.framework
inferred-attr
inherit-attribute Re-land 7a527f1777 with fixes. 2020-08-21 14:40:09 -04:00
initializer_list
interface-diagnose-missing-import/Foo.framework [Modules][Objective-C] Use complete decl from module when diagnosing missing import 2019-09-16 22:00:29 +00:00
internal-constants
invalid-module-id
invalidate-identifiers
libc-libcxx
libstdcxx-ambiguous-internal
lookup-assert
lookup-assert-protocol
lsv-debuginfo Debug Info (-gmodules): emit full types for non-anchored template specializations 2018-10-24 00:06:02 +00:00
lsv-private-macro Support #__private_macro and #__public_macro in local submodule 2021-03-23 16:54:28 -07:00
macro-ambiguity
macro-hiding
macro-masking
macro-reexport
macro-undef-through-pch
malformed
malformed-overload
merge-anon-in-template
merge-class-definition-visibility
merge-decl-context
merge-decl-order
merge-dependent-friends
merge-fn-prototype-tags
merge-friends
merge-function-defs
merge-implicit-special-members
merge-lifetime-extended-temporary [clang][modules] Add support for merging lifetime-extended temporaries 2019-12-02 19:55:13 +01:00
merge-name-for-linkage
merge-nested-templates
merge-record-definition [modules] Fix miscompilation when using two RecordDecl definitions with the same name. 2021-08-30 17:51:38 -07:00
merge-target-features
merge-template-friend
merge-template-members
merge-template-pattern-visibility
merge-template-specializations
merge-typedefs
merge-using-decls Support for merging UsingPackDecls across modules. 2021-07-01 18:43:49 -07:00
merge-var-template-def
merge-vtable-codegen
misplaced
missing-header-local-visibility When making modules transitively visible, don't take into account 2020-04-17 22:49:58 -07:00
modular_maps
module-impl-with-link
module-map-path-hash
modules-with-same-name
ms-enums Re-land "[MS] Fix assert handling enum forward decls in hasVisibleDefinition" 2020-04-23 16:22:01 -07:00
multiple-include
nested-template-default-arg-redecl Modules: Search for a visible definition of the decl context when computing visibility of a default template parameter 2019-04-19 23:02:30 +00:00
no-implicit-builds
no-linkage
no-module-map [modules] Frontend support for building a header module from a list of 2018-09-15 01:21:15 +00:00
no-undeclared-includes-builtins [clang] Always allow including builtin headers in [no_undeclared_headers] modules. 2020-06-04 08:33:39 +02:00
non-ambiguous-enum [Modules] Fix testcases from r331232 2018-04-30 22:57:02 +00:00
normal-module-map
objc-category
objc-category-2
objc-category-3
objc-desig-init
objc-hidden
objc-initializer
odr
odr_hash-Friend [ODRHash] Fix hashing for friend functions. 2018-02-22 05:50:29 +00:00
odr_hash-Unresolved [ODRHash] Fix early exit that skipped code. 2018-09-14 01:15:28 +00:00
odr_hash-elaborated-types [ODRHash] Do not rely on Type* when computing the hash. 2018-06-28 13:28:44 +00:00
oldname
outofdate-rebuild
overloadable-attrs
pch-with-module-name
pr19692
prebuilt-implicit-module Allow searching for prebuilt implicit modules. 2020-11-10 10:14:13 -08:00
prebuilt-module
preprocess
preprocess-decluse
private
private0
private1
private2
private3
protocol-redefinition Add protocol redefinition to the current scope/context 2018-06-30 00:49:27 +00:00
rec-types Add a test to cover structural match for recursive data types 2019-11-14 18:32:27 -08:00
redecl-found-building-chains
redecl-templates
redecls
relative-import-path Modules: Invalidate out-of-date PCMs as they're discovered 2019-03-09 17:44:01 +00:00
require-modular-includes
self-import-header
self-referencing-lambda [Modules] Fix creating fake definition data for lambdas. 2018-03-21 21:28:54 +00:00
separate_map_tree
set-pure-crash [modules] Fix crash in call to `FunctionDecl::setPure()` 2020-11-18 11:55:29 -08:00
shadow Reapply r321781: [Modules] Allow modules specified by -fmodule-map-file to shadow implicitly found ones 2018-01-05 02:33:18 +00:00
shadowed-submodule Reapply r321781: [Modules] Allow modules specified by -fmodule-map-file to shadow implicitly found ones 2018-01-05 02:33:18 +00:00
static_assert
stress1
string_names
subdir
subdirectory-module-maps-working-dir/subdir_module [HeaderSearch] loadSubdirectoryModuleMaps should respect -working-directory 2018-11-14 01:08:03 +00:00
submodule-in-private-mmap/A.framework [Modules] Allow @import to reach submodules in private module maps 2018-05-02 02:25:03 +00:00
submodule-visibility
submodules
submodules-merge-defs
suggest-include
system-out-of-date
template-default-args
template-specialization-visibility
thread-safety
unavailable-local-visibility When we leave a module header, make that header visible in its 2018-09-12 23:09:23 +00:00
undefined-type-fixit
unnecessary-module-map-parsing
unused-global-init
update-after-load
update-exception-spec
using-decl-redecl
va_list
warning-mismatch
wildcard-submodule-exports
working-dir-test/Test.framework
DebugCXX.h
DebugDwoId.h Reland "Correctly emit dwoIDs after ASTFileSignature refactoring (D81347)" 2020-08-24 14:52:53 +02:00
DebugNestedA.h
DebugNestedB.h
DebugObjC.h
DebugObjCImport.h
DebugSubmoduleA.h
DebugSubmoduleB.h
DiagOutOfDate.h
ExtensionTestA.h
ImportNameInDir.h
MacroFabs1.h
MethodPoolA.h
MethodPoolASub.h
MethodPoolASub2.h
MethodPoolB.h
MethodPoolBSub.h
MethodPoolBSub2.h
MethodPoolCombined1.h
MethodPoolCombined2.h
MethodPoolString1.h
MethodPoolString2.h
autolink-sub.h
autolink-sub2.h
autolink-sub3.h
autolink-sub3.pch
autolink.h
builtin.h
builtin_sub.h
c-header-bad.h
c-header.h
category_bottom.h
category_left.h
category_left_sub.h
category_other.h
category_right.h
category_right_sub.h
category_top.h
codegen-extern-template.modulemap fix recent -fmodules-codegen fix test 2020-01-14 23:51:07 +01:00
config.h
crash.h
cxx-decls-imported.h
cxx-decls-merged.h
cxx-decls-premerged.h
cxx-decls-unimported.h
cxx-header.h
cxx-inline-namespace-b.h
cxx-inline-namespace.h
cxx-irgen-left.h
cxx-irgen-right.h
cxx-irgen-top.h s/instantate/instantiate/ throughout. NFCI. 2020-12-01 22:13:40 -05:00
cxx-linkage-cache.h
cxx-many-overloads.h
cxx-templates-a.h
cxx-templates-b-impl.h
cxx-templates-b.h
cxx-templates-c.h
cxx-templates-common.h
cxx-templates-d.h
cxx-templates-textual.h
cxx-templates-unimported.h
decl.h
decl2.h
def-include.h
def.h
dependency-gen-base.modulemap
dependency-gen-base2.modulemap
dependency-gen-included.h
dependency-gen-included2.h
dependency-gen.h
diag_flags.h [modules] Fix incorrect diagnostic mapping computation when a module changes 2018-02-09 01:15:13 +00:00
diag_pragma.h
diagnostics-aux-2.modulemap
diagnostics-aux.modulemap
diamond.h
diamond_bottom.h
diamond_left.h
diamond_right.h
diamond_top.h
dummy.h
elaborated-type-structs.h
empty.h
export_as_test.modulemap
ignored_macros.h
import-decl.h
incomplete_mod.h
incomplete_mod_missing.h
innerstructredef.h
irgen.h
linkage-merge-bar.h
linkage-merge-foo.h
linkage-merge-sub.h
load_failure.h
lookup_left.h
lookup_left.hpp
lookup_right.h
lookup_right.hpp
macros-indirect.h
macros.h
macros_bottom.h
macros_left.h
macros_other.h
macros_right.h
macros_right_undef.h
macros_top.h
macros_top_b.h
macros_top_c.h
modular_maps-moduleb-cwd.map
module.map [ASTReader] Always rebuild a cached module that has errors 2021-02-03 22:06:46 -08:00
module_private_left.h
module_private_right.h
namespaces-left.h
namespaces-right.h
namespaces-top.h
non-module.h
objc-method-redecl.h
objcAtKeywordMissingEnd.h
objc_type_param.h Fix a reentrance bug with deserializing ObjC type parameters. 2020-02-12 18:44:19 -05:00
pch-import-module-out-of-date.pch
pch-import-module-with-macro.pch
pch-typedef.h [clang][modules][pch] Allow loading PCH with different modules cache path 2021-06-14 11:04:56 +02:00
pch-used.h
point.h
pragma_pack_set.h
preprocess-prefix.h
recursive1.h
recursive2.h
recursive_visibility_a1_inner.h
recursive_visibility_a2_more_inner.h
recursive_visibility_b.h
recursive_visibility_c.h
redecl-add-after-load-decls.h
redecl-add-after-load-top.h
redecl-add-after-load.h
redecl-merge-bottom-prefix.h
redecl-merge-bottom.h
redecl-merge-left-left.h
redecl-merge-left.h
redecl-merge-right.h
redecl-merge-top-explicit.h
redecl-merge-top.h
redecl_namespaces_left.h
redecl_namespaces_right.h
redeclarations_left.h
redeclarations_right.h
relative-dep-gen-1.h
relative-dep-gen-2.h
relative-dep-gen-cwd.modulemap
relative-dep-gen.modulemap
template-nontrivial0.h [ObjC] Allow declaring __weak pointer fields in C structs in ARC. 2018-03-19 17:38:40 +00:00
template-nontrivial1.h [ObjC] Allow declaring __weak pointer fields in C structs in ARC. 2018-03-19 17:38:40 +00:00
templates-left.h
templates-right.h
templates-top.h
typedef-tag-hidden.h
typedef-tag.h
typo.h
use-builtin.h
using-decl-a.h
using-decl-b.h
warn-unused-local-typedef.h
warning.h
weird_objc.h