search for: putchar_func

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

2012 Feb 09
1
[LLVMdev] Difficulty inserting putchar in IR
Hi, I have written a simple code to insert putchar() function into IR. It compiled well but when I tried to run the generated .bc file with lli, its not showing proper output. Function *putchar_func = cast<Function>(M-> getOrInsertFunction("putchar", IntegerType::getInt32Ty(Context), IntegerType::getInt32Ty(Context), NULL)); Value *One = ConstantInt::get(Type::getInt32Ty(Context), 1); CallInst *CallFibX1 = CallInst::Create(putchar_func, One,...
2011 May 13
3
[LLVMdev] IO intrinsics?
I found these lines in the BrainF example: //declare i32 @getchar() getchar_func = cast<Function>(module-> getOrInsertFunction("getchar", IntegerType::getInt32Ty(C), NULL)); //declare i32 @putchar(i32) putchar_func = cast<Function>(module-> getOrInsertFunction("putchar", IntegerType::getInt32Ty(C), IntegerType::getInt32Ty(C), NULL)); Since getchar and putchar are never defined, I'm assuming they are intrinsics, but they are not documented with the rest of...