Source code to LLVM C++ API

The Online LLVM demo page had an option to generate LLVM C++ API code as backend from a source code. However, that demo page is now disabled. I was wondering how we can do it ourselves using the available LLVM tools.

I tried the following

clang++ -c -emit-llvm input.cpp -o input.ll
llc -march=cpp -o input.ll.cpp input.ll

which gives the following error

llc: error: invalid target ‘cpp’.

Hi

llc -march=cpp -o input.ll.cpp input.ll

which gives the following error

llc: error: invalid target 'cpp'.

probably you built LLVM without support for the cpp target, eg you
only built it for x86.

Ciao, Duncan.