1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 11:13:28 +01:00
llvm-mirror/lib
Peter Collingbourne 837799f13b Prologue support
Patch by Ben Gamari!

This redefines the `prefix` attribute introduced previously and
introduces a `prologue` attribute.  There are a two primary usecases
that these attributes aim to serve,

  1. Function prologue sigils

  2. Function hot-patching: Enable the user to insert `nop` operations
     at the beginning of the function which can later be safely replaced
     with a call to some instrumentation facility

  3. Runtime metadata: Allow a compiler to insert data for use by the
     runtime during execution. GHC is one example of a compiler that
     needs this functionality for its tables-next-to-code functionality.

Previously `prefix` served cases (1) and (2) quite well by allowing the user
to introduce arbitrary data at the entrypoint but before the function
body. Case (3), however, was poorly handled by this approach as it
required that prefix data was valid executable code.

Here we redefine the notion of prefix data to instead be data which
occurs immediately before the function entrypoint (i.e. the symbol
address). Since prefix data now occurs before the function entrypoint,
there is no need for the data to be valid code.

The previous notion of prefix data now goes under the name "prologue
data" to emphasize its duality with the function epilogue.

The intention here is to handle cases (1) and (2) with prologue data and
case (3) with prefix data.

References
----------

This idea arose out of discussions[1] with Reid Kleckner in response to a
proposal to introduce the notion of symbol offsets to enable handling of
case (3).

[1] http://lists.cs.uiuc.edu/pipermail/llvmdev/2014-May/073235.html

Test Plan: testsuite

Differential Revision: http://reviews.llvm.org/D6454

llvm-svn: 223189
2014-12-03 02:08:38 +00:00
..
Analysis Simplify pointer comparisons involving memory allocation functions 2014-12-01 23:38:06 +00:00
AsmParser Prologue support 2014-12-03 02:08:38 +00:00
Bitcode Prologue support 2014-12-03 02:08:38 +00:00
CodeGen Prologue support 2014-12-03 02:08:38 +00:00
DebugInfo Make DWARFAcceleratorTable::dump() const. 2014-11-20 16:21:11 +00:00
ExecutionEngine [MCJIT] Unique-ptrify the RTDyldMemoryManager member of MCJIT. NFC. 2014-12-03 00:51:19 +00:00
IR Prologue support 2014-12-03 02:08:38 +00:00
IRReader Remove unused variable. NFC. 2014-11-06 23:16:57 +00:00
LineEditor
Linker Prologue support 2014-12-03 02:08:38 +00:00
LTO Remove StringMap::GetOrCreateValue in favor of StringMap::insert 2014-11-19 05:49:42 +00:00
MC [NVPTX] Do not emit .weak symbols for NVPTX 2014-12-01 21:16:17 +00:00
Object Add ARM relocations to ELFYAML 2014-12-02 09:49:09 +00:00
Option
ProfileData llvm-cov: Sink some reporting logic into CoverageMapping 2014-11-14 01:50:32 +00:00
Support Triple: Add AMDHSA operating system type 2014-12-02 16:45:47 +00:00
TableGen Revert r222957 "Replace std::map<K, V*> with std::map<K, V> to handle ownership and deletion of the values." 2014-11-30 01:20:17 +00:00
Target [X86][MC] Intel syntax: accept implicit memory operand sizes larger than 80. 2014-12-03 02:03:26 +00:00
Transforms Prologue support 2014-12-03 02:08:38 +00:00
CMakeLists.txt
LLVMBuild.txt
Makefile