I am trying to generate a CFG from 3 C source files using LLVM tools. clang -emit-llvm -c a.c b.c c.c main.c Thereafter I use llvm-link to link the bytecode together. llvm-link -o out a.bc b.bc c.bc main.bc
However by doing this I get an unexpected CFG.
Here are my source files:
#include "m.h"
void a(){
b();
}
void b(){
c();
}
a.c
#include "m.h"
void c(){
e();
}
void d(){
f();
}
b.c
#include "m.h"
void e(){
f();
}
void f(){
d();
}
c.c
#include "m.h"
int main(){
a();
e();
return 0;
}
main.c
The m.h file has the function prototypes.
What could be the problem here?