llvm-6502/tools
Peter Collingbourne bb660fc192 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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223189 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-03 02:08:38 +00:00
..
bugpoint Fix style. 2014-11-07 21:30:36 +00:00
bugpoint-passes
gold gold plugin: call llvm_shutdown so that -stats works. 2014-11-25 20:52:49 +00:00
llc
lli [MCJIT] Unique-ptrify the RTDyldMemoryManager member of MCJIT. NFC. 2014-12-03 00:51:19 +00:00
llvm-ar Remove unused variable. 2014-11-07 21:33:09 +00:00
llvm-as
llvm-bcanalyzer
llvm-c-test [CMake] llvm-c-test: Use libLLVM.so if it is available. 2014-11-10 15:04:26 +00:00
llvm-config
llvm-cov llvm-cov: Sink some reporting logic into CoverageMapping 2014-11-14 01:50:32 +00:00
llvm-diff
llvm-dis
llvm-dwarfdump Reapply "[dwarfdump] Add support for dumping accelerator tables." 2014-11-14 16:15:53 +00:00
llvm-extract Remove redundant calls to isMaterializable. 2014-11-01 16:46:18 +00:00
llvm-go Teach LLVM about llgo subproject. 2014-11-27 00:15:21 +00:00
llvm-jitlistener [MCJIT] Reapply r222828 and r222810-r222812 with fix for MSVC move-op issues. 2014-11-26 16:54:40 +00:00
llvm-link
llvm-lto
llvm-mc Remove the now unused StringRefMemoryObject.h. 2014-11-12 02:13:27 +00:00
llvm-mcmarkup
llvm-nm
llvm-objdump Object/COFF: Fix off-by-one error for object having lots of relocations 2014-11-26 22:17:25 +00:00
llvm-profdata Use ErrorOr for the ::create factory on instrumented and sample profilers. 2014-11-03 00:51:45 +00:00
llvm-readobj Correctly handle Tag_CPU_arch_profile. 2014-11-25 09:30:09 +00:00
llvm-rtdyld [MCJIT] Update CMakeLists.txt for llvm-rtdyld to add Object as a requirement. 2014-11-27 04:18:50 +00:00
llvm-shlib [CMake] llvm-shlib: Prune redundant components, AsmPrinter, MC, and SelectionDAG. 2014-11-11 07:57:25 +00:00
llvm-size
llvm-stress
llvm-symbolizer llvm-symbolizer: teach it about PowerPC64 ELF function descriptors 2014-11-07 09:08:39 +00:00
llvm-vtabledump llvm-vtabledump: Handle Itanium VTables 2014-11-03 07:23:25 +00:00
lto libLTO: Allow linker to choose context of modules and codegen 2014-11-11 23:19:23 +00:00
macho-dump
msbuild
obj2yaml obj2yaml, yaml2obj: Add support for COFF executables 2014-11-14 08:15:42 +00:00
opt DebugIR: Delete -debug-ir 2014-11-29 03:15:47 +00:00
verify-uselistorder Prologue support 2014-12-03 02:08:38 +00:00
yaml2obj Remove StringMap::GetOrCreateValue in favor of StringMap::insert 2014-11-19 05:49:42 +00:00
CMakeLists.txt Teach LLVM about llgo subproject. 2014-11-27 00:15:21 +00:00
LLVMBuild.txt
Makefile