summaryrefslogtreecommitdiff
path: root/docs/CommandGuide/lli.html
blob: 70a42d645f684493d5cb91960629600fd59cc4c4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
<html>
<title>
LLVM: lli tool
</title>

<body bgcolor=white>

<center>
<h1>LLVM: <tt>lli</tt> tool</h1>
</center>
<HR>

<h3>
NAME
</h3>

<tt>lli</tt>

<h3>
SYNOPSIS
</h3>

<tt>lli [options] [filename] [args ...]</tt>
<h3>
DESCRIPTION
</h3>

<tt>lli</tt> directly executes programs in LLVM format. 
It takes a program in LLVM
bytecode format and executes it using a just-in-time
compiler, if one is available for the current architecture, or an interpreter.
<tt>lli</tt> takes all of the same code generator options as the
<tt><a href="llc.html">llc</a></tt> tool, but they are only applicable when
the just-in-time compiler is being used.
<p>

If filename is not specified, then <tt>lli</tt> reads the LLVM bytecode for
the program from standard input.
<p>
The optional "args" specified on the command line are passed to the
program as arguments.
<p>


<h3>
OPTIONS
</h3>

<ul>
	<li> <tt>-array-checks</tt>
	<br>
	Enable array bound checks. If an LLVM program attempts to access an
    element of an array which is not within the size of that array,
    <tt>lli</tt> will print an error message and call <tt>abort(3)</tt>.
    This is presently only applicable to the interpreter.
	<p>

	<li> <tt>-help</tt>
	<br>
	Print a summary of command line options.
	<p>

	<li> <tt>-stats</tt>
	<br>
	Print statistics from the code-generation passes. This is only meaningful
    for the just-in-time compiler, at present.
	<p>

	<li> <tt>-time-passes</tt>
	<br>
	Record the amount of time needed for each code-generation pass and print
    it to standard error.
	<p>

	<li> <tt>-march=&lt;arch&gt;</tt>
	<br>
    Use the specified non-default architecture when selecting a code generator
    for the just-in-time compiler. This may result in a crash if you pick an
    architecture which is not compatible with the hardware you are running
    <tt>lli</tt> on.
	<p>

    <li> <tt>-quiet, -q</tt>
    <br>
    Do not print any output about the return values of functions.
    This is presently only applicable to the interpreter.
    <p>

    <li> <tt>-force-interpreter={false,true}</tt>
    <br>
    If set to true, use the interpreter even if a just-in-time compiler is
    available for this architecture. Defaults to false.
    <p>

    <li> <tt>-trace</tt>
    <br>
    Print an LLVM-instruction-level dynamic execution trace. This is
    presently only applicable to the interpreter.
    <p>

    <li> <tt>-f=&lt;name&gt;</tt>
    <br>
    Call the function named <tt>&lt;name&gt;</tt> to start the program.
    Note: The function is assumed to have the C signature <tt>int
    <tt>&lt;name&gt;</tt> (int, char **, char **)</tt>. 
    If you try to use this option to call a function of incompatible type,
    undefined behavior may result. Defaults to "main".
    <p>

</ul>

<h3>
EXIT STATUS
</h3>

If <tt>lli</tt> fails to load the program, it will exit with an exit code of 1.
Otherwise, it will return the exit code of the program it executes.

<h3>
SEE ALSO
</h3>
<a href="llc.html"><tt>llc</tt></a>

<HR>
Maintained by the <a href="http://llvm.cs.uiuc.edu">LLVM Team</a>.
</body>
</html>