changeset b26f60c254c1 in /z/repo/m5
details: http://repo.m5sim.org/m5?cmd=changeset;node=b26f60c254c1
description:
        ruby: Added message type check to OutPortDeclAST.py

        Though OutPort's message type is not used to generate code, this fix 
checks
        that the programmer's intent is correct.  Eventually, we may want to
        remove the message type from the OutPort declaration statement.

diffstat:

1 file changed, 5 insertions(+)
src/mem/slicc/ast/OutPortDeclAST.py |    5 +++++

diffs (22 lines):

diff -r 3b36be1927b8 -r b26f60c254c1 src/mem/slicc/ast/OutPortDeclAST.py
--- a/src/mem/slicc/ast/OutPortDeclAST.py       Mon Jan 25 11:53:06 2010 -0600
+++ b/src/mem/slicc/ast/OutPortDeclAST.py       Fri Jan 29 20:29:13 2010 -0800
@@ -30,6 +30,7 @@
 from slicc.ast.DeclAST import DeclAST
 from slicc.ast.TypeAST import TypeAST
 from slicc.symbols import Var
+from slicc.symbols import Type
 
 class OutPortDeclAST(DeclAST):
     def __init__(self, slicc, ident, msg_type, var_expr, pairs):
@@ -52,6 +53,10 @@
                        "attribute.  Type '%s' does not have this attribute.",
                        (queue_type))
 
+        if not self.symtab.find(self.msg_type.ident, Type):
+            self.error("The message type '%s' does not exist.",
+                       self.msg_type.ident)
+
         var = Var(self.symtab, self.ident, self.location, self.queue_type.type,
                   str(code), self.pairs)
         self.symtab.newSymbol(var)
_______________________________________________
m5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/m5-dev

Reply via email to