llvm-project/llvm/test/Linker
Jeroen Dobbelaere 04790d9cfb Support intrinsic overloading on unnamed types
This patch adds support for intrinsic overloading on unnamed types.

This fixes PR38117 and PR48340 and will also be needed for the Full Restrict Patches (D68484).

The main problem is that the intrinsic overloading name mangling is using 's_s' for unnamed types.
This can result in identical intrinsic mangled names for different function prototypes.

This patch changes this by adding a '.XXXXX' to the intrinsic mangled name when at least one of the types is based on an unnamed type, ensuring that we get a unique name.

Implementation details:
- The mapping is created on demand and kept in Module.
- It also checks for existing clashes and recycles potentially existing prototypes and declarations.
- Because of extra data in Module, Intrinsic::getName needs an extra Module* argument and, for speed, an optional FunctionType* argument.
- I still kept the original two-argument 'Intrinsic::getName' around which keeps the original behavior (providing the base name).
-- Main reason is that I did not want to change the LLVMIntrinsicGetName version, as I don't know how acceptable such a change is
-- The current situation already has a limitation. So that should not get worse with this patch.
- Intrinsic::getDeclaration and the verifier are now using the new version.

Other notes:
- As far as I see, this should not suffer from stability issues. The count is only added for prototypes depending on at least one anonymous struct
- The initial count starts from 0 for each intrinsic mangled name.
- In case of name clashes, existing prototypes are remembered and reused when that makes sense.

Reviewed By: fhahn

Differential Revision: https://reviews.llvm.org/D91250
2021-03-19 14:34:25 +01:00
..
Inputs [llvm] Change DSOLocalEquivalent type if the underlying global value type changes 2021-03-09 15:09:48 -08:00
2002-07-17-GlobalFail.ll
2002-07-17-LinkTest2.ll
2002-08-20-ConstantExpr.ll
2003-01-30-LinkerRename.ll
2003-01-30-LinkerTypeRename.ll
2003-04-23-LinkOnceLost.ll
2003-04-26-NullPtrLinkProblem.ll
2003-05-15-TypeProblem.ll
2003-05-31-LinkerRename.ll
2003-06-02-TypeResolveProblem.ll
2003-06-02-TypeResolveProblem2.ll
2003-08-20-OpaqueTypeResolve.ll
2003-08-23-GlobalVarLinking.ll
2003-08-23-RecursiveOpaqueTypeResolve.ll
2003-08-24-InheritPtrSize.ll
2003-08-28-TypeResolvesGlobal.ll
2003-08-28-TypeResolvesGlobal2.ll
2003-08-28-TypeResolvesGlobal3.ll
2003-10-27-LinkOncePromote.ll
2003-11-18-TypeResolution.ll
2004-02-17-WeakStrongLinkage.ll
2004-05-07-TypeResolution1.ll
2004-05-07-TypeResolution2.ll
2004-12-03-DisagreeingType.ll
2005-02-12-ConstantGlobals-2.ll
2005-02-12-ConstantGlobals.ll
2005-12-06-AppendingZeroLengthArrays.ll
2006-01-19-ConstantPacked.ll
2008-03-05-AliasReference.ll
2008-03-05-AliasReference2.ll
2008-03-07-DroppedSection_a.ll
2008-03-07-DroppedSection_b.ll
2008-06-13-LinkOnceRedefinition.ll
2008-06-26-AddressSpace.ll
2008-07-06-AliasFnDecl.ll
2008-07-06-AliasFnDecl2.ll
2008-07-06-AliasWeakDest.ll
2008-07-06-AliasWeakDest2.ll
2009-09-03-mdnode.ll
2009-09-03-mdnode2.ll
2011-08-04-DebugLoc.ll
2011-08-04-DebugLoc2.ll
2011-08-04-Metadata.ll
2011-08-04-Metadata2.ll
2011-08-18-unique-class-type.ll
2011-08-18-unique-class-type2.ll
2011-08-18-unique-debug-type.ll
2011-08-18-unique-debug-type2.ll
AppendingLinkage.ll
AppendingLinkage2.ll
ConstantGlobals.ll
DSOLocalEquivalent.ll [llvm] Change DSOLocalEquivalent type if the underlying global value type changes 2021-03-09 15:09:48 -08:00
DbgDeclare.ll
DbgDeclare2.ll
LinkOnce.ll
PR8300.ll
addrspace.ll [IRMover] Set Address Space for moved global values 2019-11-05 16:32:48 -08:00
alias-2.ll
alias-3.ll
alias-threadlocal.ll [IR] Add missing GlobalAlias copying of ThreadLocalMode attribute 2020-06-16 20:15:27 -07:00
alias.ll
alignment.ll
appending-global-crash.ll [llvm-link] Fix crash when materializing appending global 2021-01-25 18:08:07 -08:00
appending-global-err1.ll [llvm-link] Fix for an assertion when linking global with appending linkage 2021-01-23 00:10:42 -08:00
appending-global-err2.ll [llvm-link] Fix for an assertion when linking global with appending linkage 2021-01-23 00:10:42 -08:00
appending-global-err3.ll [llvm-link] Fix for an assertion when linking global with appending linkage 2021-01-23 00:10:42 -08:00
appending-global-err4.ll [llvm-link] Fix for an assertion when linking global with appending linkage 2021-01-23 00:10:42 -08:00
appending-global-err5.ll [llvm-link] Fix for an assertion when linking global with appending linkage 2021-01-23 00:10:42 -08:00
appending-global-proto.ll [llvm-link] Fix for an assertion when linking global with appending linkage 2021-01-23 00:10:42 -08:00
apple-version.ll
available_externally_a.ll
available_externally_b.ll
available_externally_over_decl.ll
basiclink.ll
broken.ll
byref-types.ll Linker: Fix linking of byref types 2020-11-17 11:02:04 -05:00
byval-types.ll Reapply: IR: add optional type to 'byval' function parameters 2019-05-30 18:48:23 +00:00
comdat-rm-dst.ll
comdat.ll
comdat2.ll
comdat4.ll
comdat5.ll
comdat6.ll
comdat7.ll
comdat8.ll IR: Teach GlobalIndirectSymbol::getBaseObject() to handle more kinds of expressions. 2019-07-24 22:23:05 +00:00
comdat9.ll
comdat10.ll
comdat11.ll
comdat12.ll
comdat13.ll
comdat14.ll
comdat15.ll
comdat16.ll IR: print value numbers for unnamed function arguments 2019-08-03 14:28:34 +00:00
comdat_group.ll
commandline.ll Implement -frecord-command-line (-frecord-gcc-switches) 2018-12-14 15:38:15 +00:00
constructor-comdat.ll
ctors.ll
ctors2.ll
ctors3.ll
ctors4.ll
datalayout.ll Remove some unnecessary REQUIRES: shell lines 2019-09-10 00:06:52 +00:00
debug-info-global-var.ll
debug-info-version-a.ll
debug-info-version-b.ll
dicompositetype-unique.ll
distinct-cycles.ll
distinct.ll
dllstorage-a.ll
dllstorage-b.ll
drop-debug.ll
empty-swift.ll Fix conflict value for metadata "Objective-C Garbage Collection" in the mix of swift and Objective-C bitcode 2020-03-11 13:26:06 -07:00
func-attrs-a.ll OpaquePtr: Bulk update tests to use typed sret 2020-11-20 17:58:26 -05:00
func-attrs-b.ll OpaquePtr: Bulk update tests to use typed sret 2020-11-20 17:58:26 -05:00
funcimport.ll
funcimport2.ll
funcimport_appending_global.ll
funcimport_comdat.ll
ident.ll
inlineasm.ll
internalize-lazy.ll
intrinsics-with-unnamed-types.ll Support intrinsic overloading on unnamed types 2021-03-19 14:34:25 +01:00
link-arm-and-thumb-module-inline-asm.ll Simplify append to module inline asm string in IRLinker::run() 2020-12-02 14:56:43 +01:00
link-arm-and-thumb.ll
link-flags.ll
link-global-to-func.ll
link-type-names.ll
linkage.ll
linkage2.ll
linkmdnode.ll
linkmdnode2.ll
linknamedmdnode.ll
linknamedmdnode2.ll
lto-attributes.ll
mdlocation.ll
metadata-a.ll
metadata-attach.ll
metadata-b.ll
metadata-function.ll
metadata-global.ll
metadata-mismatch.test
metadata-source.ll
metadata-with-global-value-operand.ll
module-flags-1-a.ll
module-flags-1-b.ll
module-flags-2-a.ll
module-flags-2-b.ll
module-flags-3-a.ll
module-flags-3-b.ll
module-flags-4-a.ll
module-flags-4-b.ll
module-flags-5-a.ll [IRMover] Improve diagnostic messages for conflicting metadata 2019-05-16 05:23:13 +00:00
module-flags-5-b.ll
module-flags-6-a.ll [IRMover] Improve diagnostic messages for conflicting metadata 2019-05-16 05:23:13 +00:00
module-flags-6-b.ll
module-flags-7-a.ll [IRMover] Improve diagnostic messages for conflicting metadata 2019-05-16 05:23:13 +00:00
module-flags-7-b.ll
module-flags-8-a.ll
module-flags-8-b.ll
module-flags-dont-change-others.ll
module-flags-pic-1-a.ll
module-flags-pic-2-a.ll
module-max-warn.ll Linker/module-max-warn.ll: Fix test to be compatible with Windows file separators 2020-02-07 17:14:05 -08:00
multiple-merged-structs.ll
null_mapping_constant.ll
objectivec-class-property-flag-mismatch.ll
odr-lambda-1.ll
odr.ll
only-needed-compiler-used.ll
only-needed-ctors1.ll [test] Fix unused check prefixes in test/Linker/ and test/Other/ 2020-10-29 21:54:56 -07:00
only-needed-ctors2.ll [test] Fix unused check prefixes in test/Linker/ and test/Other/ 2020-10-29 21:54:56 -07:00
only-needed-debug-metadata.ll
only-needed-dtors1.ll [test] Fix unused check prefixes in test/Linker/ and test/Other/ 2020-10-29 21:54:56 -07:00
only-needed-dtors2.ll [test] Fix unused check prefixes in test/Linker/ and test/Other/ 2020-10-29 21:54:56 -07:00
only-needed-named-metadata.ll
only-needed-recurse.ll
only-needed-used.ll
opaque.ll
override-different-linkage.ll
override-with-internal-linkage-2.ll
override-with-internal-linkage.ll
override.ll
partial-type-refinement-link.ll
partial-type-refinement.ll
pr21374.ll
pr21494.ll
pr22807.ll
pr26037.ll
pr27044.ll
prologuedata.ll
redefinition.ll
replaced-function-matches-first-subprogram.ll [DebugInfo] IR/Bitcode changes for DISubprogram flags. 2018-11-28 21:14:32 +00:00
scalable-vector-type-construction.ll [llvm-link] fix IRMover returning wrong modified vector type 2021-02-22 11:29:42 +00:00
sret-types.ll Reapply "OpaquePtr: Add type to sret attribute" 2020-10-16 11:05:02 -04:00
subprogram-linkonce-weak.ll [test] XFAIL two tests with inlining debug info issues on Sparc 2020-08-13 11:12:52 +02:00
syncscopes.ll
targettriple.ll
testlink.ll
thinlto_funcimport_debug.ll Migrate function attribute "no-frame-pointer-elim"="false" to "frame-pointer"="none" as cleanups after D56351 2019-12-24 16:27:51 -08:00
transitive-lazy-link.ll
type-unique-alias.ll
type-unique-dst-types.ll
type-unique-inheritance.ll
type-unique-name.ll
type-unique-odr-a.ll Remove lit feature object-emission 2020-02-10 15:57:56 -06:00
type-unique-odr-b.ll
type-unique-opaque.ll
type-unique-simple-a.ll Remove lit feature object-emission 2020-02-10 15:57:56 -06:00
type-unique-simple-b.ll Migrate function attribute "no-frame-pointer-elim" to "frame-pointer"="all" as cleanups after D56351 2019-12-24 15:57:33 -08:00
type-unique-simple2-a.ll Remove lit feature object-emission 2020-02-10 15:57:56 -06:00
type-unique-simple2-b.ll
type-unique-simple2.ll Remove lit feature object-emission 2020-02-10 15:57:56 -06:00
type-unique-src-type.ll
type-unique-type-array-a.ll Remove lit feature object-emission 2020-02-10 15:57:56 -06:00
type-unique-type-array-b.ll Migrate function attribute "no-frame-pointer-elim" to "frame-pointer"="all" as cleanups after D56351 2019-12-24 15:57:33 -08:00
type-unique-unrelated.ll
unique-fwd-decl-a.ll
unique-fwd-decl-order.ll
uniqued-distinct-cycles.ll
unnamed-addr-err-a.ll
unnamed-addr-err-b.ll
unnamed-addr1-a.ll
unnamed-addr1-b.ll
visibility.ll
weakextern.ll
wrong-addrspace-gv-declaration.ll