Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JIT Needs To Support Arbitrary Function Call #791

Closed
llvmbot opened this issue Aug 15, 2004 · 2 comments
Closed

JIT Needs To Support Arbitrary Function Call #791

llvmbot opened this issue Aug 15, 2004 · 2 comments
Assignees
Labels
bugzilla Issues migrated from bugzilla enhancement Improving things as opposed to bug fixing, e.g. new or missing feature mcjit

Comments

@llvmbot
Copy link
Collaborator

llvmbot commented Aug 15, 2004

Bugzilla Link 419
Resolution FIXED
Resolved on Feb 22, 2010 12:45
Version 1.0
OS All
Reporter LLVM Bugzilla Contributor

Extended Description

Currently, the JIT class supports calling of only two function prototypes:
void func(int)
int func(int, char**)

This is a known limitation of the current implementation but a more generic
solution could be developed so that any function could be invoked. There is a
FIXME in llvm::JIT::runFunction that reads:

// FIXME: This code should handle a couple of common cases efficiently, but
// it should also implement the general case by code-gening a new anonymous
// nullary function to call.

There are several different ways to fix the problem, as hinted at by the
comment. In the short term, adding something like this:

} else if (ArgValues.empty()) {
void (PF)() = (void()())getPointerToFunction(F);
assert(PF && "Pointer to fn's code was null after getPointerToFunction");
PF();

before the "else" case, should fix the issue. That code is basically only smart
enough to run 'main', but could be enhanced by someone interested in it to
handle the general case.

@llvmbot
Copy link
Collaborator Author

llvmbot commented Aug 15, 2004

assigned to @lattner

@lattner
Copy link
Collaborator

lattner commented Aug 16, 2004

@llvmbot llvmbot transferred this issue from llvm/llvm-bugzilla-archive Dec 3, 2021
@Endilll Endilll added enhancement Improving things as opposed to bug fixing, e.g. new or missing feature and removed missing-feature labels Aug 15, 2023
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugzilla Issues migrated from bugzilla enhancement Improving things as opposed to bug fixing, e.g. new or missing feature mcjit
Projects
None yet
Development

No branches or pull requests

3 participants