[Synopsis-changes] Synopsis/Synopsis/Synopsis/Processors Linker.py,1.13,1.14 EmptyModuleRemover.py,1.6,1.7
Stefan Seefeld stefan at synopsis.fresco.orgThu Dec 4 01:08:39 UTC 2003
- Previous message: [Synopsis-changes] Synopsis/Synopsis/tests/Processors/Previous/expected previous.xml,NONE,1.1
- Next message: [Synopsis-changes] Synopsis/Synopsis/Synopsis/Parsers/Cxx Parser.py,1.6,1.7
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Update of /cvs/synopsis/Synopsis/Synopsis/Processors
In directory frida:/tmp/cvs-serv12741
Modified Files:
Linker.py EmptyModuleRemover.py
Log Message:
recover lost Builtins
Index: Linker.py
===================================================================
RCS file: /cvs/synopsis/Synopsis/Synopsis/Processors/Linker.py,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -p -d -r1.13 -r1.14
--- Linker.py 3 Dec 2003 00:37:47 -0000 1.13
+++ Linker.py 4 Dec 2003 01:08:36 -0000 1.14
@@ -54,9 +54,6 @@ class Linker(Composite, AST.Visitor, Typ
if self.__dicts[-1].has_key(name):
return self.__dicts[-1][name]
- #for decl in self.__scopes[-1].declarations():
- # if hasattr(decl, 'name') and decl.name() == name:
- # return decl
return None
def append(self, declaration):
@@ -234,11 +231,11 @@ class Linker(Composite, AST.Visitor, Typ
If there is already a Forward declaration, then this replaces it
unless this is also a Forward.
"""
-
+
name = decl.name()
dict = self.__dicts[-1]
decls = self.top().declarations()
- if dict.has_key(name) and name != ('dummy',):
+ if dict.has_key(name):
prev = dict[name]
if not isinstance(prev, AST.Forward):
return
@@ -249,6 +246,12 @@ class Linker(Composite, AST.Visitor, Typ
return
decls.append(decl)
dict[name] = decl
+
+ def visitBuiltin(self, builtin):
+ """preserve builtins unconditionally"""
+
+ decls = self.top().declarations()
+ decls.append(builtin)
def visitNamed(self, decl):
Index: EmptyModuleRemover.py
===================================================================
RCS file: /cvs/synopsis/Synopsis/Synopsis/Processors/EmptyModuleRemover.py,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -p -d -r1.6 -r1.7
--- EmptyModuleRemover.py 2 Dec 2003 14:35:53 -0000 1.6
+++ EmptyModuleRemover.py 4 Dec 2003 01:08:36 -0000 1.7
@@ -55,15 +55,9 @@ class EmptyModuleRemover (Processor, AST
self.add(decl)
- def visitGroup(self, group):
- """Overrides recursive behaviour to just add the group"""
-
- self.add(group)
-
- def visitEnum(self, enum):
- """Overrides recursive behaviour to just add the enum"""
-
- self.add(enum)
+ visitBuiltin = visitDeclaration
+ visitGroup = visitDeclaration
+ visitEnum = visitDeclaration
def visitModule(self, module):
"""Visits all children of the module, and if there are no declarations
- Previous message: [Synopsis-changes] Synopsis/Synopsis/tests/Processors/Previous/expected previous.xml,NONE,1.1
- Next message: [Synopsis-changes] Synopsis/Synopsis/Synopsis/Parsers/Cxx Parser.py,1.6,1.7
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Synopsis-changes mailing list