llvm-project/llvm/unittests/IR
Itay Bookstein 08ed216000 [IR] Refactor GlobalIFunc to inherit from GlobalObject, Remove GlobalIndirectSymbol
As discussed in:
* https://reviews.llvm.org/D94166
* https://lists.llvm.org/pipermail/llvm-dev/2020-September/145031.html

The GlobalIndirectSymbol class lost most of its meaning in
https://reviews.llvm.org/D109792, which disambiguated getBaseObject
(now getAliaseeObject) between GlobalIFunc and everything else.
In addition, as long as GlobalIFunc is not a GlobalObject and
getAliaseeObject returns GlobalObjects, a GlobalAlias whose aliasee
is a GlobalIFunc cannot currently be modeled properly. Creating
aliases for GlobalIFuncs does happen in the wild (e.g. glibc). In addition,
calling getAliaseeObject on a GlobalIFunc will currently return nullptr,
which is undesirable because it should return the object itself for
non-aliases.

This patch refactors the GlobalIFunc class to inherit directly from
GlobalObject, and removes GlobalIndirectSymbol (while inlining the
relevant parts into GlobalAlias and GlobalIFunc). This allows for
calling getAliaseeObject() on a GlobalIFunc to return the GlobalIFunc
itself, making getAliaseeObject() more consistent and enabling
alias-to-ifunc to be properly modeled in the IR.

I exercised some judgement in the API clients of GlobalIndirectSymbol:
some were 'monomorphized' for GlobalAlias and GlobalIFunc, and
some remained shared (with the type adapted to become GlobalValue).

Reviewed By: MaskRay

Differential Revision: https://reviews.llvm.org/D108872
2021-10-20 10:29:47 -07:00
..
AbstractCallSiteTest.cpp
AsmWriterTest.cpp
AttributesTest.cpp [NFC] Cleanup AttributeList::getStackAlignment() 2021-08-19 14:21:40 -07:00
BasicBlockTest.cpp [RGT] Recode more unreachable assertions and tautologies 2021-03-19 09:17:22 -07:00
CFGBuilder.cpp Switch from llvm::is_trivially_copyable to std::is_trivially_copyable 2020-12-02 22:02:48 -08:00
CFGBuilder.h
CMakeLists.txt [NFC] Add missing dependency in the IR unittests 2020-11-18 10:10:44 +00:00
ConstantRangeTest.cpp [ConstantRange] Add fast signed multiply 2021-10-17 16:41:49 +02:00
ConstantsTest.cpp [IR] Refactor GlobalIFunc to inherit from GlobalObject, Remove GlobalIndirectSymbol 2021-10-20 10:29:47 -07:00
DataLayoutTest.cpp Add a default address space for globals to DataLayout 2020-11-20 15:46:52 +00:00
DebugInfoTest.cpp [DebugInfo][unittest] Fix heap-use-after-free after D76115 2021-03-29 23:31:14 -07:00
DebugTypeODRUniquingTest.cpp Reland [DebugInfo] generate btf_tag annotations for DIComposite types 2021-08-19 17:33:50 -07:00
DemandedBitsTest.cpp
DominatorTreeBatchUpdatesTest.cpp
DominatorTreeTest.cpp [DomTree] Accept Value as Def (NFC) 2020-10-22 18:32:03 +02:00
FunctionTest.cpp
IRBuilderTest.cpp [IR] Change the default value of InstertElement to poison (1/4) 2021-09-28 22:29:16 +09:00
InstructionsTest.cpp [llvm] Migrate from getNumArgOperands to arg_size (NFC) 2021-10-05 08:29:19 -07:00
IntrinsicsTest.cpp
LegacyPassManagerTest.cpp
MDBuilderTest.cpp
ManglerTest.cpp [SystemZ][z/OS] Add GOFF Support to the DataLayout 2021-09-24 14:09:01 -04:00
MetadataTest.cpp [IR]PATCH 2/2: Add MDNode::printTree and dumpTree 2021-10-02 21:19:52 -07:00
ModuleTest.cpp
PassBuilderCallbacksTest.cpp Clean up uses of gmock Invoke in an attempt to make it work with GCC 6.2. NFCI. 2021-05-17 13:48:45 +02:00
PassManagerTest.cpp [NewPM] Hide pass manager debug logging behind -debug-pass-manager-verbose 2021-05-07 21:51:47 -07:00
PatternMatch.cpp [PatternMatch] add matchers for commutative logical and/or 2021-10-07 10:37:34 -04:00
TimePassesTest.cpp
TypesTest.cpp [OpaquePtr] Forbid mixing typed and opaque pointers 2021-09-10 15:18:23 +02:00
UseTest.cpp
UserTest.cpp
VPIntrinsicTest.cpp [VP] Vector predicated vector splice intrinsic 2021-09-29 10:43:36 +02:00
ValueHandleTest.cpp Fixup Asserts+!AbiBreakingChecks fallout from db33f85c71 2021-01-07 14:18:19 -08:00
ValueMapTest.cpp Put back the trailing commas on TYPED_TEST_SUITE 2021-05-17 14:14:13 +02:00
ValueTest.cpp Reland [IR] Increase max alignment to 4GB 2021-10-06 13:29:23 -07:00
VectorTypesTest.cpp [SVE] Remove reliance on TypeSize comparison operators in unit tests 2020-10-21 08:05:55 +01:00
VerifierTest.cpp [NFC] Cleanup more AttributeList::addAttribute() 2021-08-17 21:05:41 -07:00