summaryrefslogtreecommitdiff
path: root/src/mem/slicc/ast/InPortDeclAST.py
diff options
context:
space:
mode:
authorBrad Beckmann <Brad.Beckmann@amd.com>2015-07-20 09:15:18 -0500
committerBrad Beckmann <Brad.Beckmann@amd.com>2015-07-20 09:15:18 -0500
commit8a54adc2a55c9858cb536fac3a9cd92bc47ce778 (patch)
treead482d891914407192f8aa568711baecfe92e83c /src/mem/slicc/ast/InPortDeclAST.py
parent0d00cbc97b47344e12e9eb943efb9ca29db66898 (diff)
downloadgem5-8a54adc2a55c9858cb536fac3a9cd92bc47ce778.tar.xz
slicc: enable overloading in functions not in classes
For many years the slicc symbol table has supported overloaded functions in external classes. This patch extends that support to functions that are not part of classes (a.k.a. no parent). For example, this support allows slicc to understand that mapAddressToRange is overloaded and the NodeID is an optional parameter.
Diffstat (limited to 'src/mem/slicc/ast/InPortDeclAST.py')
-rw-r--r--src/mem/slicc/ast/InPortDeclAST.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/mem/slicc/ast/InPortDeclAST.py b/src/mem/slicc/ast/InPortDeclAST.py
index c5a1435eb..da7357580 100644
--- a/src/mem/slicc/ast/InPortDeclAST.py
+++ b/src/mem/slicc/ast/InPortDeclAST.py
@@ -85,14 +85,17 @@ class InPortDeclAST(DeclAST):
# Add the trigger method - FIXME, this is a bit dirty
pairs = { "external" : "yes" }
- func = Func(self.symtab, "trigger", self.location, void_type,
- param_types, [], "", pairs)
+ trigger_func_name = "trigger"
+ for param in param_types:
+ trigger_func_name += "_" + param.ident
+ func = Func(self.symtab, trigger_func_name, "trigger", self.location,
+ void_type, param_types, [], "", pairs)
symtab.newSymbol(func)
# Add the stallPort method - this hacks reschedules the controller
# for stalled messages that don't trigger events
- func = Func(self.symtab, "stallPort", self.location, void_type, [],
- [], "", pairs)
+ func = Func(self.symtab, "stallPort", "stallPort", self.location,
+ void_type, [], [], "", pairs)
symtab.newSymbol(func)
param_types = []