Hi,
I have a naive question on how to generate LLVM IR for inline functions. I have compiled this C code:
inline void func1()
{
int x=3;
}
void func2()
{
func1();
int y = 4;
}
into LLVM IR, using
clang -emit-llvm -S -c
But the generated LLVM IR file does not have func1() expanded (see below for the relevant parts).
; Function Attrs: nounwind uwtable
define void @func2() #0 {
entry:
%y = alloca i32, align 4
call void (…)* @func1()
store i32 4, i32* %y, align 4
ret void
}
declare void @func1(…) #1
Question: Do I need to pass some special command line options so to make func1() expanded in the LLVM IR? Thanks.
Zhoulai