mirror of
https://github.com/pezkuwichain/revive.git
synced 2026-06-15 10:21:06 +00:00
revive llvm builder utility (#154)
Pre-eliminary support for LLVM releases and resolc binary releases by streamlining the build process for all supported hosts platforms. - Introduce the revive-llvm-builder crate with the revive-llvm builder utilty. - Do not rely on the LLVM dependency in $PATH to decouple the system LLVM installation from the LLVM host dependency. - Fix the emscripten build by decoupling the host and native LLVM dependencies. Thus allowing a single LLVM emscripten release that can be used on any host platform. - An example Dockerfile building an alpine container with a fully statically linked resolc ELF binary. - Remove the Debian builder utilities and workflow.
This commit is contained in:
@@ -0,0 +1,50 @@
|
||||
//! LLVM sanitizers.
|
||||
|
||||
/// LLVM sanitizers.
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
|
||||
pub enum Sanitizer {
|
||||
/// The address sanitizer.
|
||||
Address,
|
||||
/// The memory sanitizer.
|
||||
Memory,
|
||||
/// The memory with origins sanitizer.
|
||||
MemoryWithOrigins,
|
||||
/// The undefined behavior sanitizer
|
||||
Undefined,
|
||||
/// The thread sanitizer.
|
||||
Thread,
|
||||
/// The data flow sanitizer.
|
||||
DataFlow,
|
||||
/// Combine address and undefined behavior sanitizer.
|
||||
AddressUndefined,
|
||||
}
|
||||
|
||||
impl std::str::FromStr for Sanitizer {
|
||||
type Err = String;
|
||||
fn from_str(value: &str) -> Result<Self, Self::Err> {
|
||||
match value.to_lowercase().as_str() {
|
||||
"address" => Ok(Self::Address),
|
||||
"memory" => Ok(Self::Memory),
|
||||
"memorywithorigins" => Ok(Self::MemoryWithOrigins),
|
||||
"undefined" => Ok(Self::Undefined),
|
||||
"thread" => Ok(Self::Thread),
|
||||
"dataflow" => Ok(Self::DataFlow),
|
||||
"address;undefined" => Ok(Self::AddressUndefined),
|
||||
value => Err(format!("Unsupported sanitizer: `{}`", value)),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl std::fmt::Display for Sanitizer {
|
||||
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
|
||||
match self {
|
||||
Self::Address => write!(f, "Address"),
|
||||
Self::Memory => write!(f, "Memory"),
|
||||
Self::MemoryWithOrigins => write!(f, "MemoryWithOrigins"),
|
||||
Self::Undefined => write!(f, "Undefined"),
|
||||
Self::Thread => write!(f, "Thread"),
|
||||
Self::DataFlow => write!(f, "DataFlow"),
|
||||
Self::AddressUndefined => write!(f, "Address;Undefined"),
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user