search for: printf_type

Displaying 2 results from an estimated 2 matches for "printf_type".

2003 Nov 21
2
[LLVMdev] GetElementPtrInst Again!
...ht. I've declared printf as a function taking a pointer to SByteTy with var args and returning SIntTy: > // Create a function for output (int printf(format,...)) > std::vector<Type*> params; > params.push_back( PointerType::get( Type::SByteTy ) ); > FunctionType* printf_type = FunctionType::get( Type::IntTy, params, true ); > ThePrintf = new Function( printf_type, GlobalValue::ExternalLinkage, > "printf", TheModule); >...
2013 Dec 16
3
[LLVMdev] Add call printf instructions problems
...t() : FunctionPass(ID){} //define a extern function "printf" static llvm::Function* printf_prototype(llvm::LLVMContext& ctx, llvm::Module *mod) { std::vector<llvm::Type*> printf_arg_types; printf_arg_types.push_back(llvm::Type::getInt32Ty(ctx)); llvm::FunctionType* printf_type = llvm::FunctionType::get(llvm::Type::getInt32Ty(ctx), printf_arg_types, true); llvm::Function *func = llvm::Function::Create(printf_type, llvm::Function::ExternalLinkage, llvm::Twine("printf"),mod); func->setCallingConv(llvm::CallingConv::C); retur...