-
-
Notifications
You must be signed in to change notification settings - Fork 270
Use LLVM headers for shared codegen command-line options #2148
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
Conversation
b2eb329 to
bc058b5
Compare
|
The plan is to later copy the LLD wrappers into this .cpp module and hoping that the linker will use these ones for LLD instead of dragging in the LLD object (with conflicting command-line options). This approach should be scalable for other LLVM components including these shared headers. Edit: If this works, it'll require LLD 5.0 due to the details here. :/ |
driver/cl_options.cpp
Outdated
| "use-ctors", "use-init-array", "emulated-tls", "unique-section-names", | ||
| "jump-table-type", "meabi", "debugger-tune", "asm-instrumentation", | ||
| "mc-relax-all", "incremental-linker-compatible", "asm-show-inst", "fcfi", | ||
| "cfi-type", "cfi-enforcing", "cfi-func-name", "pie-copy-relocations", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's the most interesting part, the new hidden options, incl. some fine-grained FP math options.
Edit: They are also version specific, e.g., the 4 -*cfi* options are exclusively exposed by LLVM 3.6.
6b3afd1 to
7a538aa
Compare
And allow CMake variable LDC_WITH_LLD to be specified on the command line. LLD 5.0+ needs ldc-developers#2148 to avoid conflicting command-line options.
And allow CMake variable LDC_WITH_LLD to be specified on the command line. LLD 5.0+ needs ldc-developers#2148 to avoid conflicting command-line options.
|
Good to go now? |
|
Dammit, |
I.e., llvm/CodeGen/CommandFlags.h which in turn includes llvm/MC/MCTargetOptionsCommandFlags.h. This gets rid of a few duplicates on our side and includes about 35 (depending on LLVM version) new command-line options. LLVM provides a helper function to set up the TargetOptions according to (most of) these options. Newer LLVM versions may add new options and we'll automatically inherit them, including setting up the TargetOptions accordingly. I did my best (TM) to remove a few unused/undesirable options and hide all remaining new ones except for `-fp-contract`. The lists will need to be tweaked from time to time.
|
It's a big change, and I did not do a very detailed review. It looks good to me. |
I.e., llvm/CodeGen/CommandFlags.h which in turn includes llvm/MC/MCTargetOptionsCommandFlags.h.
This gets rid of a few duplicates on our side and includes about 35 (depending on LLVM version) new command-line options. LLVM provides a helper function to set up the TargetOptions according to (most of) these options.
Newer LLVM versions may add new options and we'll automatically inherit them, including setting up the TargetOptions accordingly.
I did my best (TM) to remove a few unused/undesirable options and hide all remaining new ones except for
-fp-contract. The lists will need to be tweaked from time to time.