llvm-project/llvm/include/llvm
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 Reland 'Fixed -Wdeprecated-copy warnings. NFCI.' 2019-11-23 23:09:39 +01:00
Analysis Revert b19ec1eb3d 2019-11-27 11:17:10 -08:00
AsmParser
BinaryFormat [COFF] Widen PE32Header fields to fit 64 bit versions 2019-11-21 12:05:00 +02:00
Bitcode [IR] Redefine Freeze instruction 2019-11-12 10:49:00 +09:00
Bitstream Remarks - fix static analyzer warnings. NFCI. 2019-11-09 13:01:05 +00:00
CodeGen [Codegen][ARM] Add addressing modes from masked loads and stores 2019-11-26 16:21:01 +00:00
Config Moved everything SMT-related to LLVM and updated the cmake scripts. 2019-03-25 17:47:45 +00:00
DebugInfo [pdbutil] Fixed -Wdeprecated-copy in DbiModuleDescriptor 2019-11-23 23:33:22 +01:00
Demangle PODSmallVector - fix MSVC uninitialized variable warnings. NFCI. 2019-11-10 11:18:15 +00:00
ExecutionEngine [ORC][JITLink] Add support for weak references, and improve handling of static 2019-11-28 13:30:49 -08:00
FuzzMutate Fix misspelled filenames in file headers 2019-02-07 14:38:25 +00:00
IR [ARM][MVE][Intrinsics] Add MVE VAND/VORR/VORN/VEOR/VBIC intrinsics. Add unit tests. 2019-11-27 16:52:05 +00:00
IRReader [IRReader] Expose getLazyIRModule 2019-02-11 22:01:13 +00:00
LTO [LTO][Legacy] Add API for passing LLVM options separately 2019-11-19 16:30:37 -08:00
LineEditor
Linker
MC [AIX] Emit TOC entries for ASM printing 2019-11-27 17:20:55 -05:00
MCA [MCA][LSUnit] Track loads and stores until retirement. 2019-10-08 10:46:01 +00:00
Object Add operator<< for object::SectionedAddress 2019-11-19 10:34:30 +01:00
ObjectYAML [yaml2obj] - Teach tool to describe SHT_GNU_verdef section with a "Content" property. 2019-11-26 15:35:05 +03:00
Option Let unaliased Args track which Alias they were created from, and use that in Arg::getAsString() for diagnostics 2019-07-09 00:34:08 +00:00
Passes Revert "Revert "As a follow-up to my initial mail to llvm-dev here's a first pass at the O1 described there."" 2019-11-26 20:28:52 -08:00
ProfileData SampleProfWriter - fix uninitialized variable warnings. NFCI. 2019-11-07 14:18:44 +00:00
Remarks Remarks - fix static analyzer warnings. NFCI. 2019-11-09 13:01:05 +00:00
Support Remove a comment obsoleted by r227345. 2019-11-27 16:04:15 +00:00
TableGen Add Record::getValueAsOptionalDef(). 2019-10-25 16:39:21 -07:00
Target [Codegen][ARM] Add addressing modes from masked loads and stores 2019-11-26 16:21:01 +00:00
Testing/Support [Testing] Move clangd::Annotations to llvm testing support 2019-04-25 10:08:31 +00:00
TextAPI Reland "[TextAPI] Introduce TBDv4" 2019-10-10 04:24:44 +00:00
ToolDrivers Share /machine: handling code with llvm-cvtres too 2019-06-12 11:32:43 +00:00
Transforms [InstCombine] Optimize some memccpy calls to memcpy/null 2019-11-26 10:54:47 +01:00
WindowsManifest
WindowsResource
XRay FDRRecords - fix uninitialized variable warnings. NFCI. 2019-11-07 18:42:02 +00:00
CMakeLists.txt
InitializePasses.h [SVFS] Inject TLI Mappings in VFABI attribute. 2019-11-15 18:42:56 +00:00
LinkAllIR.h
LinkAllPasses.h [SVFS] Inject TLI Mappings in VFABI attribute. 2019-11-15 18:42:56 +00:00
Pass.h Sink all InitializePasses.h includes 2019-11-13 16:34:37 -08:00
PassAnalysisSupport.h
PassInfo.h
PassRegistry.h
PassSupport.h
module.extern.modulemap
module.install.modulemap
module.modulemap [Orc][Modules] Fix Modules build fallout from a34680a33e. 2019-11-20 17:34:34 -08:00
module.modulemap.build