summaryrefslogtreecommitdiffstats
path: root/llvm/tools/lli
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/tools/lli
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/tools/lli')
-rw-r--r--llvm/tools/lli/lli.cpp30
1 files changed, 14 insertions, 16 deletions
diff --git a/llvm/tools/lli/lli.cpp b/llvm/tools/lli/lli.cpp
index 36d7d98265e..d7b9368a327 100644
--- a/llvm/tools/lli/lli.cpp
+++ b/llvm/tools/lli/lli.cpp
@@ -595,8 +595,8 @@ int main(int argc, char **argv, char * const *envp) {
if (!RemoteMCJIT) {
// If the program doesn't explicitly call exit, we will need the Exit
// function later on to make an explicit call, so get the function now.
- FunctionCallee Exit = Mod->getOrInsertFunction(
- "exit", Type::getVoidTy(Context), Type::getInt32Ty(Context));
+ Constant *Exit = Mod->getOrInsertFunction("exit", Type::getVoidTy(Context),
+ Type::getInt32Ty(Context));
// Run static constructors.
if (!ForceInterpreter) {
@@ -620,21 +620,19 @@ int main(int argc, char **argv, char * const *envp) {
// If the program didn't call exit explicitly, we should call it now.
// This ensures that any atexit handlers get called correctly.
- if (Function *ExitF =
- dyn_cast<Function>(Exit.getCallee()->stripPointerCasts())) {
- if (ExitF->getFunctionType() == Exit.getFunctionType()) {
- std::vector<GenericValue> Args;
- GenericValue ResultGV;
- ResultGV.IntVal = APInt(32, Result);
- Args.push_back(ResultGV);
- EE->runFunction(ExitF, Args);
- WithColor::error(errs(), argv[0])
- << "exit(" << Result << ") returned!\n";
- abort();
- }
+ if (Function *ExitF = dyn_cast<Function>(Exit)) {
+ std::vector<GenericValue> Args;
+ GenericValue ResultGV;
+ ResultGV.IntVal = APInt(32, Result);
+ Args.push_back(ResultGV);
+ EE->runFunction(ExitF, Args);
+ WithColor::error(errs(), argv[0]) << "exit(" << Result << ") returned!\n";
+ abort();
+ } else {
+ WithColor::error(errs(), argv[0])
+ << "exit defined with wrong prototype!\n";
+ abort();
}
- WithColor::error(errs(), argv[0]) << "exit defined with wrong prototype!\n";
- abort();
} else {
// else == "if (RemoteMCJIT)"
OpenPOWER on IntegriCloud