Open Quuxplusone opened 15 years ago
Bugzilla Link | PR4343 |
Status | NEW |
Importance | P normal |
Reported by | John Nowak (john@johnnowak.com) |
Reported on | 2009-06-07 03:31:39 -0700 |
Last modified on | 2010-03-06 13:59:17 -0800 |
Version | trunk |
Hardware | PC All |
CC | edwin+bugs@etorok.eu, llvm-bugs@lists.llvm.org, nicholas@mxc.ca |
Fixed by commit(s) | |
Attachments | |
Blocks | |
Blocked by | |
See also |
Do you mean:
a) when running clang on the command line?
b) when running llvm-gcc on the command line?
c) given a .ll (textual LLVM IR) file, on the command line?
d) from inside your LLVM-using C++ program?
The first three are well documented:
a) http://clang.llvm.org/get_started.html
b) http://llvm.org/cmds/llvmgcc.html
c) i. To bitcode: http://llvm.org/cmds/llvm-as.html (described on http://llvm.org/docs/CommandGuide/ as "assemble a human-readable .ll file into bytecode")
ii. To machine code: http://llvm.org/cmds/llc.html (described in the command guide as "generate native machine code for a bytecode file")
The last one however, is not.
d) i. JITing is in the tutorial: http://llvm.org/docs/tutorial/LangImpl4.html#jit
ii. To bitcode: Look at the source to llvm-as (it's only 149 lines). The important part is WriteBitcodeToFile() which is in the doxygen, but you'd have to know where to look: http://llvm.org/doxygen/namespacellvm.html#e74f76713a63766894166c9a8dd8e94a
iii. To machine code: Look at the source to llc (364 lines). Sadly there's more than one function call needed to emit machine code.
So clearly that should be documented. But where? Add it to the tutorial? I
can't think of an obvious place this should go.
(In reply to comment #1)
> So clearly that should be documented. But where? Add it to the tutorial? I
> can't think of an obvious place this should go.
>
http://llvm.org/docs/tutorial/
Simple JIT Tutorials
4. Reading and Writing Bitcode
^ that looks like the obvious place to me.
(In reply to comment #1)
> Do you mean:
> d) from inside your LLVM-using C++ program?
Yes, d. Török Edwin's suggestion seems appropriate.