mirror of
https://github.com/pezkuwichain/revive.git
synced 2026-06-21 17:21:07 +00:00
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:
@@ -66,6 +66,7 @@ impl Project {
|
||||
optimizer_settings: revive_llvm_context::OptimizerSettings,
|
||||
include_metadata_hash: bool,
|
||||
debug_config: revive_llvm_context::DebugConfig,
|
||||
llvm_arguments: &[String],
|
||||
) -> anyhow::Result<Build> {
|
||||
let project = self.clone();
|
||||
#[cfg(feature = "parallel")]
|
||||
@@ -81,6 +82,7 @@ impl Project {
|
||||
include_metadata_hash,
|
||||
optimizer_settings.clone(),
|
||||
debug_config.clone(),
|
||||
llvm_arguments.to_vec(),
|
||||
);
|
||||
let process_output = {
|
||||
#[cfg(target_os = "emscripten")]
|
||||
@@ -316,6 +318,7 @@ impl revive_llvm_context::PolkaVMDependency for Project {
|
||||
optimizer_settings: revive_llvm_context::OptimizerSettings,
|
||||
include_metadata_hash: bool,
|
||||
debug_config: revive_llvm_context::DebugConfig,
|
||||
llvm_arguments: &[String],
|
||||
) -> anyhow::Result<String> {
|
||||
let contract_path = project.resolve_path(identifier)?;
|
||||
let contract = project
|
||||
@@ -335,6 +338,7 @@ impl revive_llvm_context::PolkaVMDependency for Project {
|
||||
optimizer_settings,
|
||||
include_metadata_hash,
|
||||
debug_config,
|
||||
llvm_arguments,
|
||||
)
|
||||
.map_err(|error| {
|
||||
anyhow::anyhow!(
|
||||
|
||||
Reference in New Issue
Block a user