Add IntValue type alias for backend integer values
Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
This commit is contained in:
@@ -56,7 +56,7 @@ impl Compile {
|
||||
}
|
||||
|
||||
/// Gets or inserts a static int reference.
|
||||
pub fn const_int(&mut self, int: i64) -> (ConstHandle, IntRef) {
|
||||
pub fn const_int(&mut self, int: IntValue) -> (ConstHandle, IntRef) {
|
||||
self.const_data_mut().const_int(int)
|
||||
}
|
||||
|
||||
@@ -115,14 +115,14 @@ impl Compile {
|
||||
/// This distinguishes between the different types while building a const pool to avoid duplicates.
|
||||
#[derive(Debug, Default)]
|
||||
pub struct ConstData {
|
||||
ints: HashMap<i64, (ConstHandle, IntRef)>,
|
||||
ints: HashMap<IntValue, (ConstHandle, IntRef)>,
|
||||
strs: HashMap<String, (ConstHandle, StrRef)>,
|
||||
const_pool: ConstPool,
|
||||
}
|
||||
|
||||
impl ConstData {
|
||||
/// Gets or inserts a static int reference.
|
||||
pub fn const_int(&mut self, int: i64) -> (ConstHandle, IntRef) {
|
||||
pub fn const_int(&mut self, int: IntValue) -> (ConstHandle, IntRef) {
|
||||
if let Some(pair) = self.ints.get(&int) {
|
||||
pair.clone()
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user