Skip to content
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

Made CodeAssembler traits public #236

Merged
merged 3 commits into from
Dec 15, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,7 @@ static void WriteGenericParameterTypes(FileWriter writer, int count) {
}

void GenerateAsmTraits(TraitGroup[] traitGroups) {
var filename = genTypes.Dirs.GetRustFilename("code_asm", "fn_asm_traits.rs");
var filename = genTypes.Dirs.GetRustFilename("code_asm", "asm_traits.rs");
using (var writer = new FileWriter(TargetLanguage.Rust, FileUtils.OpenWrite(filename))) {
writer.WriteFileHeader();
writer.WriteLine(RustConstants.InnerAttributeAllowNonCamelCaseTypes);
Expand Down Expand Up @@ -565,7 +565,7 @@ void GenerateAsmPub(TraitGroup[] traitGroups) {
var filename = genTypes.Dirs.GetRustFilename("code_asm", "fn_asm_pub.rs");
using (var writer = new FileWriter(TargetLanguage.Rust, FileUtils.OpenWrite(filename))) {
writer.WriteFileHeader();
writer.WriteLine("use crate::code_asm::fn_asm_traits::*;");
writer.WriteLine("use crate::code_asm::asm_traits::*;");
writer.WriteLine($"use crate::code_asm::{CodeAssembler};");
writer.WriteLine($"use crate::{ErrorType};");
writer.WriteLine();
Expand Down Expand Up @@ -696,7 +696,7 @@ void GenerateAsmImpl(TraitGroup[] traitGroups) {
writer.WriteFileHeader();
writer.WriteLine("#![allow(clippy::if_same_then_else)]");
writer.WriteLine();
writer.WriteLine("use crate::code_asm::fn_asm_traits::*;");
writer.WriteLine("use crate::code_asm::asm_traits::*;");
writer.WriteLine("use crate::code_asm::mem::*;");
writer.WriteLine($"use crate::code_asm::op_state::{memoryOperandSizeType.Name(idConverter)};");
writer.WriteLine("use crate::code_asm::reg::*;");
Expand Down
4 changes: 3 additions & 1 deletion src/rust/iced-x86/src/code_asm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,12 @@
//!
//! [`CodeAssembler`]: struct.CodeAssembler.html

#[allow(missing_docs, clippy::missing_errors_doc)]
pub mod asm_traits;
mod code_asm_methods;
#[allow(clippy::missing_inline_in_public_items)]
mod fn_asm_impl;
mod fn_asm_pub;
mod fn_asm_traits;
mod mem;
mod op_state;
mod reg;
Expand Down
2 changes: 1 addition & 1 deletion src/rust/iced-x86/src/code_asm/fn_asm_impl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

#![allow(clippy::if_same_then_else)]

use crate::code_asm::fn_asm_traits::*;
use crate::code_asm::asm_traits::*;
use crate::code_asm::mem::*;
use crate::code_asm::op_state::MemoryOperandSize;
use crate::code_asm::reg::*;
Expand Down
2 changes: 1 addition & 1 deletion src/rust/iced-x86/src/code_asm/fn_asm_pub.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

// ⚠️This file was generated by GENERATOR!🦹‍♂️

use crate::code_asm::fn_asm_traits::*;
use crate::code_asm::asm_traits::*;
use crate::code_asm::CodeAssembler;
use crate::IcedError;

Expand Down