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