-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Options in loadable modules are not available #1690
Comments
assigned to @lattner |
Or 4. Preprocess all loads, removing them after processing them, then parsing This bug is extremely serious for all external modules, as you cannot run a pass |
or even easier, refresh the option list after a load. This patch solves the diff -r1.85 CommandLine.cpp
Any objections? |
I'll take a look at this. There is nothing special here about the load command, I'll solve this a more general Working on it. |
Fixed, patch here: sorry for the breakage! -Chris |
As of now, HEAD does not fix this: Test case for this is now in test/Feature/load_module.ll Please make sure you update lib/Transforms/Makefile and build LLVMHello.so upon |
testing a fix. |
Fixed better, patch here: Testcase here: test/Feature/load_module.ll -Chris |
Thanks Chris! |
mentioned in issue llvm/llvm-bugzilla-archive#4849 |
mentioned in issue llvm/llvm-bugzilla-archive#6669 |
[lldb/interpreter] Add REPL-specific init file
Extended Description
This is related to bug 1317.
When a loadable module is loaded its command line options are not available
until the loaded module has been processed. This is a bit of a chicken-and-egg
problem:
the module hasn't been loaded yet.
Consequently, you get errors about the names of optimization passes. I'm not
sure how this ever worked or if its a result of the recent changes to CommandLine.
There are several things we could do to rectify this:
Make a formal API for "foreign passes". That is, when we dlopen the shared
object we look for a function of a particular name, add its address to a
table of foreign passes, invoke that function to initialize, etc. This
API could do many other things (like build a PassManager full of passes).
Incorporate the --load option into CommandLine. It would become a new type
of option that contains a list of function addresses. The functions are
obtained by dlopen/dlsym on the shared object. The function (in the
shared object) is invoked to properly register any command line options.
This implies that static option objects are not permitted in such objects.
We might want to add something to Support library that could be used (but
not linked into) the loadable module. This would be an interface to make
"LLVM compatible loadable modules" that takes care of many of the details.
I.e. it provides a cleaner client side interface for the module writer.
This lib would be linked into all tools that support --load.
The text was updated successfully, but these errors were encountered: