|
1 | 1 | #!/usr/bin/env python
|
2 |
| -""" |
3 |
| -This is the assembler phase. |
4 |
| -
|
5 |
| -This variant is only invoked during |
6 |
| -the second compilation where we are building bitcode. The compiler |
7 |
| -has already been instructed to generate LLVM IR; the compiler then |
8 |
| -tries to assemble it into an object file. The standard assembler |
9 |
| -doesn't understand LLVM bitcode, so we interpose and use the llvm-as |
10 |
| -command to build a bitcode file. We leave the bitcode in place, but |
11 |
| -record its full absolute path in the corresponding object file |
12 |
| -(which was created in the first compilation phase by the real |
13 |
| -compiler). We'll link this together at a later stage. |
| 2 | +"""This is the assembler phase. |
| 3 | +
|
| 4 | +This variant is only invoked during the second compilation where we |
| 5 | +are building bitcode. The compiler has already been instructed to |
| 6 | +generate LLVM IR; the compiler then tries to assemble it into an |
| 7 | +object file. The standard assembler doesn't understand LLVM bitcode, |
| 8 | +so we interpose and use the llvm-as command to build a bitcode file. |
| 9 | +We leave the bitcode in place, but record its full absolute path in |
| 10 | +the corresponding object file (which was created in the first |
| 11 | +compilation phase by the real compiler). We'll link this together at |
| 12 | +a later stage. |
| 13 | +
|
| 14 | +In the pip version the main below is a console script called wllvm-as. |
| 15 | +Since we cannot tell gcc what our assember is called, only which directory |
| 16 | +it should look for as in, we have to make a "hidden" directory that we |
| 17 | +can use to pass gcc. It needs to be hidden since we do not want our |
| 18 | +assembler to override the users assembler. |
| 19 | +
|
| 20 | +This should explain: |
| 21 | +
|
| 22 | +../dragonegg_as/as |
| 23 | +
|
| 24 | +in the pip egg, and in the repository. |
| 25 | +
|
| 26 | +
|
14 | 27 | """
|
15 | 28 |
|
16 | 29 | from __future__ import absolute_import
|
|
0 commit comments