Hi,<br><br>Could anyone please comment on this ?<br><br><br>Regards,<br>Rajesh<br><br><br><div class="gmail_quote">On Wed, Dec 19, 2012 at 6:54 PM, rajesh viswabramana <span dir="ltr"><<a href="mailto:viswabramana.rajesh@gmail.com" target="_blank">viswabramana.rajesh@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>Hi,</div>
<div> </div>
<div>Clang crashes when tried to compile from .ast to .s for below sample code,</div>
<div> </div>
<div>inline-test.c</div>
<div><i></i> </div>
<div><i>extern inline int func1 (void) { return 0; }<br>inline int func1 (void) { return 1; }</i></div>
<div> </div>
<div>clang <b>works fine</b> for .c -> .s, </div>
<div><b>>clang inline-test.c -std=c99 -fgnu89-inline -S -o inline-test.s </b></div>
<div> </div>
<div>But <b>crashes</b> when tried to generate .s from .ast for same file, </div>
<div><b>>clang inline-test.c -std=c99 -fgnu89-inline -emit-ast -o inline-test.ast</b></div>
<div><b>>clang inline-test.ast -std=c99 -fgnu89-inline -S -o inline-test.s</b> </div>
<div> </div>
<div>clang-3.2: $HOME/llvm/tools/clang/lib/CodeGen/CodeGenFunction.cpp:342: void clang::CodeGen::CodeGenFunction::<b>StartFunction</b>(clang::GlobalDecl, clang::QualType, llvm::Function*, const clang::CodeGen::CGFunctionInfo&, const clang::CodeGen::FunctionArgList&, clang::SourceLocation): Assertion `<b>CurFn->isDeclaration() && "Function already has body?"</b>' failed.</div>
<div> </div>
<div>From crash message it seems Codegen is already emitted for inline function.</div>
<div> </div>
<div>Crash occurs only if tried to generate assembly out of ast file.</div>
<div> </div>
<div> </div>
<div>Regards,</div>
<div>Rajesh</div>
<div> </div>
<div> </div>
<div> </div>
</blockquote></div><br>