Add support to encode type info using llvm::Constant.