LLVM IR and CFG

Hi,

I want to know few things:

1) is LLVM IR (obtained from -emit-llvm option) an in-memory CFG?

Say, I have hello.c and I generate bit-code using:
clang -O3 -emit-llvm hello.c -c -o hello.bc

Next, I redirect this bit code to opt:
opt -load ../../Release+Asserts/lib/Hello.so -hello < hello.bc > /dev/null

I have attached a example.tar.gz with one simple iterator.cpp and output from opt command and clang analyzer-checker.
Are these two - LLVM IR and CFG from clang analyzer-checker equivalent?

2) how to get/print original program back from this LLVM IR?

3) what about `clang -emit-llvm hello.c -c -o hello.bc'
- without using -O3 optimization flag, is this LLVM IR an in-memory CFG?

These queries may be trivial but I need this info to proceed further.

Thank you.

Rajendra

http://www.cse.iitb.ac.in/~rks

iterator.tar.gz (9.4 KB)