May 2015
Intermediate to advanced
296 pages
5h 10m
English
In this section, you will link previously generated .bc files to get one single bitcode file containing all the needed references.
To link the .bc files, you need the llvm-link tool.
Do the following steps:
llvm-link, first write two codes in different files, where one makes a reference to the other:$ cat test1.c int func(int a) { a = a*2; return a; } $ cat test2.c #include<stdio.h> extern int func(int a); int main() { int num = 5; num = func(num); printf("number is %d\n", num); return num; }
.ll files, then from .ll files to .bc files:$ clang -emit-llvm -S test1.c -o test1.ll $ clang ...
Read now
Unlock full access