llvm-project/clang/lib
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
..
APINotes [clang][APINotes] Fix -Wunused-function warning (NFC) 2021-04-01 09:52:43 +08:00
ARCMigrate [clang] Use llvm::is_contained (NFC) 2021-10-13 20:41:55 -07:00
AST [clang] Use llvm::erase_if (NFC) 2021-10-17 13:50:29 -07:00
ASTMatchers Add `TypeLoc`-related matchers. 2021-10-08 17:42:18 +00:00
Analysis [clang] Omit most AttributedStatements from the CFG 2021-10-12 09:15:45 -04:00
Basic [WebAssembly] Implementation of table.get/set for reftypes in LLVM IR 2021-10-20 10:31:31 +02:00
CodeGen [IR] Refactor GlobalIFunc to inherit from GlobalObject, Remove GlobalIndirectSymbol 2021-10-20 10:29:47 -07:00
CrossTU PR51018: Remove explicit conversions from SmallString to StringRef to future-proof against C++23 2021-07-08 13:37:57 -07:00
DirectoryWatcher Revert "Re-Revert "DirectoryWatcher: add an implementation for Windows"" 2021-06-19 09:19:52 -07:00
Driver [Driver][Gnu] Delete unneeded -Bstatic dispatch for arm/thumb 2021-10-19 15:24:07 -07:00
Edit [clang] Use llvm::is_contained (NFC) 2021-10-13 20:41:55 -07:00
Format [clang-format] [PR52015] clang-format should put __attribute__((foo)) on its own line before @interface / @implementation / @protocol 2021-10-20 09:09:31 +01:00
Frontend [clang] Add plugin ActionType to run command line plugin before main action 2021-10-20 08:58:20 -07:00
FrontendTool [clang] Add plugin ActionType to run command line plugin before main action 2021-10-20 08:58:20 -07:00
Headers [cuda] Add address space predicate funuctions. 2021-10-19 16:20:14 -04:00
Index [Clang] Add __ibm128 type to represent ppc_fp128 2021-09-06 18:00:58 +08:00
IndexSerialization [index-while-building] Fix build with -DBUILD_SHARED_LIBS=True 2020-08-20 15:12:56 +01:00
Interpreter Revert "Reland [clang] Pass -clear-ast-before-backend in Clang::ConstructJob()" 2021-10-19 12:39:34 -07:00
Lex [clang] Use llvm::erase_if (NFC) 2021-10-17 13:50:29 -07:00
Parse consteval if does not form a discarded statement 2021-10-20 07:24:55 -04:00
Rewrite [analyzer] Highlight arrows for currently selected event 2021-08-02 19:15:01 +03:00
Sema [Sema, StaticAnalyzer] Use StringRef::contains (NFC) 2021-10-20 08:02:36 -07:00
Serialization [clang] Use llvm::erase_if (NFC) 2021-10-17 13:50:29 -07:00
StaticAnalyzer InvalidPtrChecker - don't dereference a dyn_cast<> - use cast<> instead. 2021-10-20 18:06:00 +01:00
Testing
Tooling [libTooling] Add "switch"-like Stencil combinator 2021-10-14 16:45:37 +00:00
CMakeLists.txt [clang-repl] Recommit "Land initial infrastructure for incremental parsing" 2021-05-13 06:30:29 +00:00