summaryrefslogtreecommitdiffstats
path: root/llvm/examples/BrainF/BrainF.cpp
diff options
context:
space:
mode:
authorJames Y Knight <jyknight@google.com>2019-01-31 21:51:58 +0000
committerJames Y Knight <jyknight@google.com>2019-01-31 21:51:58 +0000
commitfadf25068e32b44b010e6e03c6ab93bec41eae82 (patch)
tree9b22878f495e0b75d9e86cd01bcf199308dc9234 /llvm/examples/BrainF/BrainF.cpp
parentc62214da3de04f702e29e4ba4772c9463e2829ca (diff)
downloadbcm5719-llvm-fadf25068e32b44b010e6e03c6ab93bec41eae82.tar.gz
bcm5719-llvm-fadf25068e32b44b010e6e03c6ab93bec41eae82.zip
Revert "[opaque pointer types] Add a FunctionCallee wrapper type, and use it."
This reverts commit f47d6b38c7a61d50db4566b02719de05492dcef1 (r352791). Seems to run into compilation failures with GCC (but not clang, where I tested it). Reverting while I investigate. llvm-svn: 352800
Diffstat (limited to 'llvm/examples/BrainF/BrainF.cpp')
-rw-r--r--llvm/examples/BrainF/BrainF.cpp18
1 files changed, 10 insertions, 8 deletions
diff --git a/llvm/examples/BrainF/BrainF.cpp b/llvm/examples/BrainF/BrainF.cpp
index b4cbc780a04..bcd75325e80 100644
--- a/llvm/examples/BrainF/BrainF.cpp
+++ b/llvm/examples/BrainF/BrainF.cpp
@@ -72,17 +72,19 @@ void BrainF::header(LLVMContext& C) {
Tys);
//declare i32 @getchar()
- getchar_func =
- module->getOrInsertFunction("getchar", IntegerType::getInt32Ty(C));
+ getchar_func = cast<Function>(module->
+ getOrInsertFunction("getchar", IntegerType::getInt32Ty(C)));
//declare i32 @putchar(i32)
- putchar_func = module->getOrInsertFunction(
- "putchar", IntegerType::getInt32Ty(C), IntegerType::getInt32Ty(C));
+ putchar_func = cast<Function>(module->
+ getOrInsertFunction("putchar", IntegerType::getInt32Ty(C),
+ IntegerType::getInt32Ty(C)));
//Function header
//define void @brainf()
- brainf_func = module->getOrInsertFunction("brainf", Type::getVoidTy(C));
+ brainf_func = cast<Function>(module->
+ getOrInsertFunction("brainf", Type::getVoidTy(C)));
builder = new IRBuilder<>(BasicBlock::Create(C, label, brainf_func));
@@ -151,9 +153,9 @@ void BrainF::header(LLVMContext& C) {
"aberrormsg");
//declare i32 @puts(i8 *)
- FunctionCallee puts_func = module->getOrInsertFunction(
- "puts", IntegerType::getInt32Ty(C),
- PointerType::getUnqual(IntegerType::getInt8Ty(C)));
+ Function *puts_func = cast<Function>(module->
+ getOrInsertFunction("puts", IntegerType::getInt32Ty(C),
+ PointerType::getUnqual(IntegerType::getInt8Ty(C))));
//brainf.aberror:
aberrorbb = BasicBlock::Create(C, label, brainf_func);
OpenPOWER on IntegriCloud