Suport passing arbitrary llvm arguments (#271)

- Support for passing LLVM command line options via the prcoess input or
providing one or more `--llvm-arg='..'` resolc CLI flag. This allows
more fine-grained control over the LLVM backend configuration.
- Make LLVM initialization idempotent.

---------

Signed-off-by: Cyrill Leutwiler <bigcyrill@hotmail.com>
This commit is contained in:
xermicus
2025-04-03 13:21:00 +02:00
committed by GitHub
parent 8a98346a9c
commit 87c1d7a8be
16 changed files with 142 additions and 26 deletions
+4
View File
@@ -20,6 +20,8 @@ pub struct Input {
pub optimizer_settings: revive_llvm_context::OptimizerSettings,
/// The debug output config.
pub debug_config: revive_llvm_context::DebugConfig,
/// The extra LLVM arguments give used for manual control.
pub llvm_arguments: Vec<String>,
}
impl Input {
@@ -30,6 +32,7 @@ impl Input {
include_metadata_hash: bool,
optimizer_settings: revive_llvm_context::OptimizerSettings,
debug_config: revive_llvm_context::DebugConfig,
llvm_arguments: Vec<String>,
) -> Self {
Self {
contract,
@@ -37,6 +40,7 @@ impl Input {
include_metadata_hash,
optimizer_settings,
debug_config,
llvm_arguments,
}
}
}