Generation of IR for MyTarget

Hi Developers,

I have written C program and want to generate IR file for Specific Target I have tried with following command but got a error as follows,

COMMAND:

clang -S -emit-llvm -march=leg ~/llc-test-examples/ex9.c -o ~/llc-test-examples/ex9.ll
ERROR:
error: unknown target CPU ‘leg’

There are several different pieces here. Assuming that you have added your target triple to Triple.h/.cpp, and have the LLVM part working, you need to create TargetInfo, and the corresponding toolchain. Look in the clang repository in
   lib/Basic/Targets.cpp
   lib/Driver/Tools.cpp
   lib/Driver/ToolChains.cpp
To see how it's done for other targets.

-Krzysztof

please help me guys

Varun,
Have you tried suggestions made by Krzysztof?

I think he forgot to add you in “To”. Here is what he said.

There are several different pieces here. Assuming that you have added your target triple to Triple.h/.cpp, and have the LLVM part working, you need to create TargetInfo, and the corresponding toolchain. Look in the clang repository in
lib/Basic/Targets.cpp
lib/Driver/Tools.cpp
lib/Driver/ToolChains.cpp
To see how it’s done for other targets.

-Krzysztof