[prev in list] [next in list] [prev in thread] [next in thread]
List: llvm-dev
Subject: [llvm-dev] What is the difference between bitcode file and naive output file which is compiled with
From: zxl via llvm-dev <llvm-dev () lists ! llvm ! org>
Date: 2021-12-27 4:57:23
Message-ID: tencent_DB77408C4D36FAAC7E830CA83D2E7FCC520A () qq ! com
[Download RAW message or body]
[Attachment #2 (multipart/alternative)]
[Attachment #4 (text/plain)]
Hello everyone: I have known that when a file(for example: a.c) is \
compiled with -flto flag, llvm will output a bitcode file(a.o), command is (clang \
-flto -c a.c -o a.o). Then I compile same file to bitcode file a.bc, command is \
(clang -emit-llvm -o a.bc -c a.c). I want to know what difference between a.o and \
a.bc ? a.c content is like below:
```
#include "a.h"
static signed int i = 0;
void foo2(void) {
i = -1;
}
static int foo3() {
foo4();
return 10;
}
int foo1(void) {
int data = 0;
if (i < 0)
data = foo3();
data = data + 42;
return data;
}
```
Thanks
lzx
[Attachment #5 (text/html)]
Hello everyone:<div> I have known that when a file(for example: a.c) is \
compiled with -flto flag, llvm will output a bitcode file(a.o), command is (clang \
-flto -c a.c -o a.o). Then I compile same file to bitcode file a.bc, command is \
(clang -emit-llvm -o a.bc -c a.c). I want to know what difference between a.o and \
a.bc ?</div><div>a.c content is like below:<br>```</div><div><div>#include \
"a.h"</div><div><br></div><div>static signed int i = 0;</div><div><br></div><div>void \
foo2(void) {</div><div> i = -1;</div><div>}</div><div><br></div><div>static int \
foo3() {</div><div> foo4();</div><div> return \
10;</div><div>}</div><div><br></div><div>int foo1(void) {</div><div> int data = \
0;</div><div><br></div><div> if (i < 0)</div><div> data = \
foo3();</div><div><br></div><div> data = data + 42;</div><div> return \
data;</div><div>}</div></div><div>```</div><div>Thanks</div><div>lzx</div><div><div \
style="color: rgb(212, 212, 212); background-color: rgb(30, 30, 30); font-family: \
Menlo, Monaco, "Courier New", monospace; font-size: 12px; line-height: \
18px; white-space: pre;"><div></div></div></div>
[Attachment #6 (text/plain)]
_______________________________________________
LLVM Developers mailing list
llvm-dev@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic