[LLVMdev] A question about 'llc -march=c'

Óscar Fuentes ofv at wanadoo.es
Tue Dec 8 07:32:54 PST 2009


lpeng <pengliang at ict.ac.cn> writes:

> Hello friends working on LLVM,
> I am a beginner to LLVM. I tried to get C code from LLVM bitcode using
> 'llc -march=c'. But it seems to me that it doesn't work if the source
> program is a C++ program. Am I right?

If you use functions from some library on your C++ code (the C++
Standard Library, for example) calls to those functions are still
present on the generated C code. This means that you must provide the
referenced library on your compile command.

On your case, either compile with

gcc testcc.cbe.c -lstdc++

or with

g++ testcc.cbe.c

(g++ automatically adds the C++ standard library)

[snip]

-- 
Óscar




More information about the llvm-dev mailing list