llvm-project/llvm/unittests
Lang Hames 674df13b5f [ORC][JITLink] Add support for weak references, and improve handling of static
libraries.

This patch substantially updates ORCv2's lookup API in order to support weak
references, and to better support static archives. Key changes:

-- Each symbol being looked for is now associated with a SymbolLookupFlags
   value. If the associated value is SymbolLookupFlags::RequiredSymbol then
   the symbol must be defined in one of the JITDylibs being searched (or be
   able to be generated in one of these JITDylibs via an attached definition
   generator) or the lookup will fail with an error. If the associated value is
   SymbolLookupFlags::WeaklyReferencedSymbol then the symbol is permitted to be
   undefined, in which case it will simply not appear in the resulting
   SymbolMap if the rest of the lookup succeeds.

   Since lookup now requires these flags for each symbol, the lookup method now
   takes an instance of a new SymbolLookupSet type rather than a SymbolNameSet.
   SymbolLookupSet is a vector-backed set of (name, flags) pairs. Clients are
   responsible for ensuring that the set property (i.e. unique elements) holds,
   though this is usually simple and SymbolLookupSet provides convenience
   methods to support this.

-- Lookups now have an associated LookupKind value, which is either
   LookupKind::Static or LookupKind::DLSym. Definition generators can inspect
   the lookup kind when determining whether or not to generate new definitions.
   The StaticLibraryDefinitionGenerator is updated to only pull in new objects
   from the archive if the lookup kind is Static. This allows lookup to be
   re-used to emulate dlsym for JIT'd symbols without pulling in new objects
   from archives (which would not happen in a normal dlsym call).

-- JITLink is updated to allow externals to be assigned weak linkage, and
   weak externals now use the SymbolLookupFlags::WeaklyReferencedSymbol value
   for lookups. Unresolved weak references will be assigned the default value of
   zero.

Since this patch was modifying the lookup API anyway, it alo replaces all of the
"MatchNonExported" boolean arguments with a "JITDylibLookupFlags" enum for
readability. If a JITDylib's associated value is
JITDylibLookupFlags::MatchExportedSymbolsOnly then the lookup will only
match against exported (non-hidden) symbols in that JITDylib. If a JITDylib's
associated value is JITDylibLookupFlags::MatchAllSymbols then the lookup will
match against any symbol defined in the JITDylib.
2019-11-28 13:30:49 -08:00
..
ADT [ADT] Fixed -Wdeprecated-copy warning. NFCI 2019-11-28 00:49:42 +01:00
Analysis [unittests] Add InitializePasses.h includes 2019-11-13 19:42:58 -08:00
AsmParser Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
BinaryFormat [BinaryFormat] Teach identify_magic about Tapi files. 2019-08-21 21:00:16 +00:00
Bitcode Add AutoUpgrade function to add new address space datalayout string to existing datalayouts. 2019-09-18 22:15:58 +00:00
Bitstream [Bitcode] Move Bitstream to a separate library 2019-07-03 22:40:07 +00:00
CodeGen [PGO][PGSO] DAG.shouldOptForSize part. 2019-11-21 14:16:00 -08:00
DebugInfo Recommit "[DWARF] Add an api to get "interpreted" location lists" 2019-11-20 16:24:11 +01:00
Demangle Update more file headers across all of the LLVM projects in the monorepo 2019-01-19 10:56:40 +00:00
ExecutionEngine [ORC][JITLink] Add support for weak references, and improve handling of static 2019-11-28 13:30:49 -08:00
FuzzMutate [llvm] Migrate llvm::make_unique to std::make_unique 2019-08-15 15:54:37 +00:00
IR [DebugInfo] Disallow fragmenting DIExpressions with shift operators 2019-11-26 16:12:22 +00:00
LineEditor Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
Linker [llvm] Migrate llvm::make_unique to std::make_unique 2019-08-15 15:54:37 +00:00
MC [Mips] Use appropriate private label prefix based on Mips ABI 2019-10-23 12:24:35 +02:00
MI [unittests] Add InitializePasses.h includes 2019-11-13 19:42:58 -08:00
Object Add operator<< for object::SectionedAddress 2019-11-19 10:34:30 +01:00
ObjectYAML minidump: Add an "arm64" constant 2019-10-31 11:20:46 +01:00
Option Option spell checking: Penalize delimiter flags if input has no argument 2019-05-01 16:45:15 +00:00
Passes Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
ProfileData [SampleFDO] Add profile remapping support for profile on-demand loading used 2019-10-18 22:35:20 +00:00
Remarks [Remarks] Fix error message check in unit test 2019-10-31 15:51:36 -07:00
Support [unittest] Fix unittests/Support/Path.cpp after D49466 2019-11-26 15:34:48 -08:00
TableGen [UnitTests] Try and pacify gcc-5 2019-10-05 08:57:17 +00:00
Target [ARM][MVE][Intrinsics] Add MVE VMUL intrinsics. Remove annoying "t1" from VMUL* instructions. Add unit tests. 2019-11-27 16:52:05 +00:00
TextAPI Reland "[TextAPI] Introduce TBDv4" 2019-10-10 04:24:44 +00:00
Transforms [CodeMoverUtils] clang-format the test 2019-11-26 16:22:06 -08:00
XRay [llvm] Migrate llvm::make_unique to std::make_unique 2019-08-15 15:54:37 +00:00
tools Fix uninitialized variable warning. NFC. 2019-11-18 13:26:50 +00:00
CMakeLists.txt [gicombiner] Add a CodeExpander to handle C++ fragments with variable expansion 2019-10-03 19:13:39 +00:00
unittest.cfg.in Add support for unittest inputs. 2018-09-05 23:30:17 +00:00