update for LLVM 3.3

Some functions are removed in LLVM 3.3. I reimplement them based on LLVM 3.2's code.