Skip to content

Commit 130aa44

Browse files
higuoxingtmsri
authored andcommitted
[Doc] Improve documentation for JITLink. (llvm#109163)
This patch improves the documentation for JITLink by fixing some typos, correcting indentations and fixing out-dated code examples.
1 parent 01868ea commit 130aa44

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

llvm/docs/JITLink.rst

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Introduction
1111
This document aims to provide a high-level overview of the design and API
1212
of the JITLink library. It assumes some familiarity with linking and
1313
relocatable object files, but should not require deep expertise. If you know
14-
what a section, symbol, and relocation are you should find this document
14+
what a section, symbol, and relocation are then you should find this document
1515
accessible. If it is not, please submit a patch (:doc:`Contributing`) or file a
1616
bug (:doc:`HowToSubmitABug`).
1717

@@ -56,15 +56,15 @@ and optimizations that were not possible under MCJIT or RuntimeDyld.
5656
ObjectLinkingLayer Plugins
5757
--------------------------
5858

59-
The ``ObjectLinkingLayer::Plugin`` class provides the following methods:
59+
The ``ObjectLinkingLayer::Plugin`` class provides the following methods:
6060

6161
* ``modifyPassConfig`` is called each time a LinkGraph is about to be linked. It
6262
can be overridden to install JITLink *Passes* to run during the link process.
6363

6464
.. code-block:: c++
6565

6666
void modifyPassConfig(MaterializationResponsibility &MR,
67-
const Triple &TT,
67+
jitlink::LinkGraph &G,
6868
jitlink::PassConfiguration &Config)
6969

7070
* ``notifyLoaded`` is called before the link begins, and can be overridden to
@@ -97,15 +97,15 @@ The ``ObjectLinkingLayer::Plugin`` class provides the following methods:
9797

9898
.. code-block:: c++
9999

100-
Error notifyRemovingResources(ResourceKey K)
100+
Error notifyRemovingResources(JITDylib &JD, ResourceKey K)
101101

102102
* ``notifyTransferringResources`` is called if/when a request is made to
103103
transfer tracking of any resources associated with ``ResourceKey``
104104
*SrcKey* to *DstKey*.
105105

106106
.. code-block:: c++
107107

108-
void notifyTransferringResources(ResourceKey DstKey,
108+
void notifyTransferringResources(JITDylib &JD, ResourceKey DstKey,
109109
ResourceKey SrcKey)
110110

111111
Plugin authors are required to implement the ``notifyFailed``,
@@ -126,7 +126,7 @@ calling the ``addPlugin`` method [1]_. E.g.
126126

127127
// Add passes to print the set of defined symbols after dead-stripping.
128128
void modifyPassConfig(MaterializationResponsibility &MR,
129-
const Triple &TT,
129+
jitlink::LinkGraph &G,
130130
jitlink::PassConfiguration &Config) override {
131131
Config.PostPrunePasses.push_back([this](jitlink::LinkGraph &G) {
132132
return printAllSymbols(G);
@@ -137,10 +137,10 @@ calling the ``addPlugin`` method [1]_. E.g.
137137
Error notifyFailed(MaterializationResponsibility &MR) override {
138138
return Error::success();
139139
}
140-
Error notifyRemovingResources(ResourceKey K) override {
140+
Error notifyRemovingResources(JITDylib &JD, ResourceKey K) override {
141141
return Error::success();
142142
}
143-
void notifyTransferringResources(ResourceKey DstKey,
143+
void notifyTransferringResources(JITDylib &JD, ResourceKey DstKey,
144144
ResourceKey SrcKey) override {}
145145

146146
// JITLink pass to print all defined symbols in G.
@@ -407,7 +407,7 @@ and utilities relevant to the linking process:
407407
* ``getPointerSize`` returns the size of a pointer (in bytes) in the executor
408408
process.
409409

410-
* ``getEndinaness`` returns the endianness of the executor process.
410+
* ``getEndianness`` returns the endianness of the executor process.
411411

412412
* ``allocateString`` copies data from a given ``llvm::Twine`` into the
413413
link graph's internal allocator. This can be used to ensure that content
@@ -802,7 +802,7 @@ for them by an ``ObjectLinkingLayer`` instance, but they can be created manually
802802
``ObjectLinkingLayer`` usually creates ``LinkGraphs``.
803803

804804
#. ``createLinkGraph_<Object-Format>_<Architecture>`` can be used when
805-
both the object format and architecture are known ahead of time.
805+
both the object format and architecture are known ahead of time.
806806

807807
#. ``createLinkGraph_<Object-Format>`` can be used when the object format is
808808
known ahead of time, but the architecture is not. In this case the

0 commit comments

Comments
 (0)