Add signatures and ext_funcs tables to DataFlowGraph.
These two tables are used to keep track of type signatures of function calls as well as external function references used in direct function calls. Also add an ExtFuncData struct representing an external function that can be called directly.
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
//! This module declares the data types used to represent external functions and call signatures.
|
||||
|
||||
use std::fmt::{self, Display, Formatter};
|
||||
use ir::Type;
|
||||
use ir::{Type, FunctionName, SigRef};
|
||||
|
||||
/// Function signature.
|
||||
///
|
||||
@@ -104,6 +104,21 @@ pub enum ArgumentExtension {
|
||||
Sext,
|
||||
}
|
||||
|
||||
/// An external function.
|
||||
///
|
||||
/// Information about a function that can be called directly with a direct `call` instruction.
|
||||
#[derive(Clone, Debug)]
|
||||
pub struct ExtFuncData {
|
||||
pub name: FunctionName,
|
||||
pub signature: SigRef,
|
||||
}
|
||||
|
||||
impl Display for ExtFuncData {
|
||||
fn fmt(&self, f: &mut Formatter) -> fmt::Result {
|
||||
write!(f, "{} {}", self.signature, self.name)
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
|
||||
Reference in New Issue
Block a user