llvm newbie

Today was the first day when I heard and read about llvm, and I would say I am pretty excited to learn about it. The design looks simply amazing and the codebase seems to be easy to follow. Way to go guys!!!

I immediately downloaded and built the llvm-gcc front-end and the llvm tools and libs.
Also, I could successfully use the llvm-gcc, llvm-dis and llc tools to see things in action.

The only problem was given by the driver llvmc.
It gives me following error:

$ llvmc -O2 a.c -o a.o
: CommandLine Error: Argument ‘debug’ defined more than once!
llvmc: CommandLine Error: Argument ‘debug’ defined more than once!
…/install/etc/llvm/c:55: Error: Expecting output type value
…install/etc/llvm/c had 1 errors. Terminating.

Any ideas as why did I get this error?

Thanks,
Sanjiv

Sanjiv,

llvmc is pretty experimental and not being actively maintained.

http://lists.cs.uiuc.edu/pipermail/llvmdev/2007-May/009207.html
http://lists.cs.uiuc.edu/pipermail/llvmdev/2007-August/010468.html

You can use llvm-gcc and llvm-ld as compiler drivers instead, as well as the individual LLVM tools:

llvm-as assembler: .ll -> .bc
llvm-link linker: .bc [.bc ...] -> .bc
opt optimizer: .bc -> .bc
llvm-dis disassembler: .bc -> .ll
llc compiler: .bc -> .s

Hope that helps.

— Gordon