mirror of
https://github.com/pezkuwichain/revive.git
synced 2026-06-12 18:41:02 +00:00
experimentally switch to rv64
Signed-off-by: xermicus <cyrill@parity.io>
This commit is contained in:
@@ -24,10 +24,10 @@ pub struct TargetMachine {
|
||||
|
||||
impl TargetMachine {
|
||||
/// The LLVM target name.
|
||||
pub const VM_TARGET_NAME: &'static str = "riscv32";
|
||||
pub const VM_TARGET_NAME: &'static str = "riscv64";
|
||||
|
||||
/// The LLVM target triple.
|
||||
pub const VM_TARGET_TRIPLE: &'static str = "riscv32-unknown-unknown-elf";
|
||||
pub const VM_TARGET_TRIPLE: &'static str = "riscv64-unknown-unknown-elf";
|
||||
|
||||
/// LLVM target features.
|
||||
#[cfg(feature = "riscv-zbb")]
|
||||
@@ -45,7 +45,7 @@ impl TargetMachine {
|
||||
.ok_or_else(|| anyhow::anyhow!("LLVM target machine `{}` not found", target.name()))?
|
||||
.create_target_machine(
|
||||
&inkwell::targets::TargetTriple::create(target.triple()),
|
||||
"generic-rv32",
|
||||
"generic-rv64",
|
||||
Self::VM_FEATURES,
|
||||
optimizer_settings.level_back_end,
|
||||
inkwell::targets::RelocMode::PIC,
|
||||
|
||||
@@ -19,7 +19,7 @@ impl Target {
|
||||
///
|
||||
pub fn name(&self) -> &str {
|
||||
match self {
|
||||
Self::PVM => "riscv32",
|
||||
Self::PVM => "riscv64",
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@ impl Target {
|
||||
///
|
||||
pub fn triple(&self) -> &str {
|
||||
match self {
|
||||
Self::PVM => "riscv32-unknown-unknown-elf",
|
||||
Self::PVM => "riscv64-unknown-unknown-elf",
|
||||
}
|
||||
}
|
||||
|
||||
@@ -47,7 +47,7 @@ impl FromStr for Target {
|
||||
|
||||
fn from_str(string: &str) -> Result<Self, Self::Err> {
|
||||
match string {
|
||||
"riscv32" => Ok(Self::PVM),
|
||||
"riscv64" => Ok(Self::PVM),
|
||||
_ => Err(anyhow::anyhow!(
|
||||
"Unknown target `{}`. Supported targets: {:?}",
|
||||
string,
|
||||
@@ -60,7 +60,7 @@ impl FromStr for Target {
|
||||
impl std::fmt::Display for Target {
|
||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||
match self {
|
||||
Target::PVM => write!(f, "riscv32"),
|
||||
Target::PVM => write!(f, "riscv64"),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user