Displaying 1 result from an estimated 1 matches for "putsfunc".
2015 Mar 10
4
[LLVMdev] noob IR builder question
...std::vector<llvm::Type *> putsArgs;
20 putsArgs.push_back(builder.getInt8Ty()->getPointerTo());
21 llvm::ArrayRef<llvm::Type*> argsRef(putsArgs);
22
23 llvm::FunctionType *putsType =
24 llvm::FunctionType::get(builder.getInt32Ty(), argsRef, false);
25 llvm::Constant *putsFunc = module->getOrInsertFunction("puts", putsType);
26
27 Value *a;
28 builder.CreateAlloca(builder.getDoubleTy(), a, "a");
29
30 Value *c1 = ConstantFP::get(context, APFloat(1.0));
31 Value *c2 = ConstantFP::get(context, APFloat(3.0));
32 builder.CreateFAdd(c1, c2...