From 9630b53836c0717a7ac0ab86dda3a4efb5bf9fb9 Mon Sep 17 00:00:00 2001
From: David Li
Date: Tue, 28 Nov 2017 20:16:25 -0500
Subject: Translate function calls
---
src/semantic/frame.rs | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
(limited to 'src/semantic/frame.rs')
diff --git a/src/semantic/frame.rs b/src/semantic/frame.rs
index 95d18a1..5b7bfaa 100644
--- a/src/semantic/frame.rs
+++ b/src/semantic/frame.rs
@@ -14,11 +14,14 @@ pub enum Escape {
}
pub trait Frame {
- fn new(name: temp::TempLabel, formals: Vec) -> Self;
+ fn new>(name: temp::TempLabel, formals: I) -> Self;
fn name(&self) -> temp::TempLabel;
fn formals(&self) -> &[Location];
fn alloc_local(&mut self, temp: &mut temp::Temp, escapes: Escape) -> Location;
fn location_to_exp(&mut self, location: Location) -> ir::Expression;
+ fn to_exp(&self) -> ir::Expression {
+ ir::Expression::Name(self.name())
+ }
}
pub struct Amd64Frame {
@@ -27,7 +30,7 @@ pub struct Amd64Frame {
}
impl Frame for Amd64Frame {
- fn new(name: temp::TempLabel, formals: Vec) -> Self {
+ fn new>(name: temp::TempLabel, formals: I) -> Self {
Amd64Frame {
offset: 0,
name: name,
--
cgit v1.2.3