llvm-6502/lib/CodeGen/AsmPrinter
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
..
AddressPool.cpp DWARF Type Units: Avoid emitting type units under fission if the type requires an address. 2014-04-26 17:27:38 +00:00
AddressPool.h Canonicalize header guards into a common format. 2014-08-13 16:26:38 +00:00
ARMException.cpp Allow the use of functions as typeinfo in landingpad clauses 2014-11-14 00:35:50 +00:00
AsmPrinter.cpp Prologue support 2014-12-03 02:08:38 +00:00
AsmPrinterDwarf.cpp Remove the TargetMachine forwards for TargetSubtargetInfo based 2014-08-04 21:25:23 +00:00
AsmPrinterHandler.h Canonicalize header guards into a common format. 2014-08-13 16:26:38 +00:00
AsmPrinterInlineAsm.cpp [asan-assembly-instrumentation] Added CFI directives to the generated instrumentation code. 2014-09-10 09:45:49 +00:00
ByteStreamer.h Canonicalize header guards into a common format. 2014-08-13 16:26:38 +00:00
CMakeLists.txt Move DwarfCompileUnit from DwarfUnit.h to its own header (DwarfCompileUnit.h) 2014-10-04 15:49:50 +00:00
DbgValueHistoryCalculator.cpp DbgValueHistoryCalculator: Store modified registers in a BitVector instead of std::set. 2014-10-06 15:31:04 +00:00
DbgValueHistoryCalculator.h Canonicalize header guards into a common format. 2014-08-13 16:26:38 +00:00
DebugLocEntry.h Move the complex address expression out of DIVariable and into an extra 2014-10-01 18:55:02 +00:00
DebugLocList.h Canonicalize header guards into a common format. 2014-08-13 16:26:38 +00:00
DIE.cpp Make AsmPrinter::EmitLabelOffsetDifference a static helper and simplify. 2014-10-21 00:25:49 +00:00
DIE.h Fix some cases where StringRef was being passed by const reference. Remove const from some other StringRefs since its implicitly const already. 2014-08-30 16:48:02 +00:00
DIEHash.cpp Fix typos in comments, NFC 2014-08-29 21:53:01 +00:00
DIEHash.h Canonicalize header guards into a common format. 2014-08-13 16:26:38 +00:00
DwarfAccelTable.cpp Fix emission of Dwarf accelerator table when there are multiple CUs. 2014-11-12 23:48:14 +00:00
DwarfAccelTable.h Fix emission of Dwarf accelerator table when there are multiple CUs. 2014-11-12 23:48:14 +00:00
DwarfCFIException.cpp Rename EH related stuff to be more precise 2014-11-14 23:31:07 +00:00
DwarfCompileUnit.cpp Debug Info: revert r222195, r222210 and r222239. 2014-11-21 19:55:23 +00:00
DwarfCompileUnit.h Provide gmlt-like inline scope information in the skeleton CU to facilitate symbolication without needing the .dwo files 2014-11-04 22:12:25 +00:00
DwarfDebug.cpp Update SetVector to rely on the underlying set's insert to return a pair<iterator, bool> 2014-11-19 07:49:26 +00:00
DwarfDebug.h Move cross-unit DIE caching to the DwarfFile level, so it doesn't interfere with fission-gmlt data and produce skeleton<>full unit cross referencing. 2014-11-04 22:12:18 +00:00
DwarfException.h CodeGen: split out the Win64Exception emitter 2014-09-01 23:48:34 +00:00
DwarfFile.cpp Sink dwarf unit length emission down into DwarfUnit::emitHeader 2014-11-01 23:59:23 +00:00
DwarfFile.h Move cross-unit DIE caching to the DwarfFile level, so it doesn't interfere with fission-gmlt data and produce skeleton<>full unit cross referencing. 2014-11-04 22:12:18 +00:00
DwarfStringPool.cpp Remove StringMap::GetOrCreateValue in favor of StringMap::insert 2014-11-19 05:49:42 +00:00
DwarfStringPool.h Remove the unused string section symbol parameter from DwarfFile::emitStrings 2014-09-11 21:12:48 +00:00
DwarfUnit.cpp Provide gmlt-like inline scope information in the skeleton CU to facilitate symbolication without needing the .dwo files 2014-11-04 22:12:25 +00:00
DwarfUnit.h Provide gmlt-like inline scope information in the skeleton CU to facilitate symbolication without needing the .dwo files 2014-11-04 22:12:25 +00:00
EHStreamer.cpp Rename EH related stuff to be more precise 2014-11-14 23:31:07 +00:00
EHStreamer.h Canonicalize header guards into a common format. 2014-08-13 16:26:38 +00:00
ErlangGCPrinter.cpp Remove the TargetMachine forwards for TargetSubtargetInfo based 2014-08-04 21:25:23 +00:00
LLVMBuild.txt Add proper dependencies to LLVMBuild.txt in llvm/lib. 2013-12-10 05:39:34 +00:00
Makefile
OcamlGCPrinter.cpp Remove the TargetMachine forwards for TargetSubtargetInfo based 2014-08-04 21:25:23 +00:00
Win64Exception.cpp CodeGen: split out the Win64Exception emitter 2014-09-01 23:48:34 +00:00
Win64Exception.h CodeGen: split out the Win64Exception emitter 2014-09-01 23:48:34 +00:00
WinCodeViewLineTables.cpp Temporary fix for PR21528 - use mangled C++ function names in COFF debug info to un-break ASan on Windows 2014-11-12 20:21:20 +00:00
WinCodeViewLineTables.h Canonicalize header guards into a common format. 2014-08-13 16:26:38 +00:00