Author: Armin Rigo <[email protected]>
Branch: reverse-debugger-updated
Changeset: r94561:4a2a458b4728
Date: 2018-05-14 11:24 +0200
http://bitbucket.org/pypy/pypy/changeset/4a2a458b4728/
Log: More diff reduction
diff --git a/pypy/module/micronumpy/compile.py
b/pypy/module/micronumpy/compile.py
--- a/pypy/module/micronumpy/compile.py
+++ b/pypy/module/micronumpy/compile.py
@@ -86,6 +86,8 @@
w_buffer = W_TypeObject("buffer")
w_type = W_TypeObject("type")
+ reverse_debugging = None
+
def __init__(self, config=None):
"""NOT_RPYTHON"""
self.fromcache = InternalSpaceCache(self).getorbuild
diff --git a/rpython/translator/c/funcgen.py b/rpython/translator/c/funcgen.py
--- a/rpython/translator/c/funcgen.py
+++ b/rpython/translator/c/funcgen.py
@@ -839,8 +839,11 @@
def OP_DEBUG_PRINT(self, op):
# XXX
from rpython.rtyper.lltypesystem.rstr import STR
- format = ['{%d} ']
- argv = ['(int)getpid()']
+ format = []
+ argv = []
+ if self.db.reverse_debugger:
+ format.append('{%d} ')
+ argv.append('(int)getpid()')
free_line = ""
for arg in op.args:
T = arg.concretetype
diff --git a/rpython/translator/c/node.py b/rpython/translator/c/node.py
--- a/rpython/translator/c/node.py
+++ b/rpython/translator/c/node.py
@@ -465,16 +465,12 @@
self.implementationtypename = db.gettype(
T, varlength=self.getvarlength())
parent, parentindex = parentlink(obj)
- ## mangled = False
if obj in exports.EXPORTS_obj2name:
self.name = exports.EXPORTS_obj2name[obj]
self.globalcontainer = 2 # meh
elif parent is None:
self.name = db.namespace.uniquename('g_' + self.basename())
self.globalcontainer = True
- ## if db.reverse_debugger and T._gckind != 'gc':
- ## from rpython.translator.revdb import gencsupp
- ## mangled = gencsupp.mangle_name_prebuilt_raw(db, self, T)
else:
self.globalcontainer = False
parentnode = db.getcontainernode(parent)
@@ -482,7 +478,6 @@
self.name = defnode.access_expr(parentnode.name, parentindex)
if self.typename != self.implementationtypename:
if db.gettypedefnode(T).extra_union_for_varlength:
- ## and not mangled:
self.name += '.b'
self._funccodegen_owner = None
@@ -503,17 +498,14 @@
return getattr(self.obj, self.eci_name, None)
def get_declaration(self):
- name = self.name
- ## if name.startswith('RPY_RDB_A(') and name.endswith(')'):
- ## name = name[len('RPY_RDB_A('):-1]
- if name[-2:] == '.b':
+ if self.name[-2:] == '.b':
# xxx fish fish
assert self.implementationtypename.startswith('struct ')
assert self.implementationtypename.endswith(' @')
uniontypename = 'union %su @' % self.implementationtypename[7:-2]
- return uniontypename, name[:-2], True
+ return uniontypename, self.name[:-2], True
else:
- return self.implementationtypename, name, False
+ return self.implementationtypename, self.name, False
def forward_declaration(self):
if llgroup.member_of_group(self.obj):
@@ -774,14 +766,6 @@
expr = db.get(value)
if typeOf(value) is Void:
comma = ''
- ## elif expr.startswith('(&RPY_RDB_A('):
- ## # can't use this in static initialization code if we
- ## # are inside a GC struct or a static_immutable struct.
- ## # (It is not needed inside other raw structs, but we
- ## # don't try to optimize that here.)
- ## assert db.reverse_debugger
- ## db.late_initializations.append(('%s' % access_expr, expr))
- ## expr = 'NULL /* patched later with %s */' % (expr,)
expr += comma
i = expr.find('\n')
if i < 0:
diff --git a/rpython/translator/platform/posix.py
b/rpython/translator/platform/posix.py
--- a/rpython/translator/platform/posix.py
+++ b/rpython/translator/platform/posix.py
@@ -208,9 +208,9 @@
rules = [
('all', '$(DEFAULT_TARGET)', []),
('$(TARGET)', '$(OBJECTS)', ['$(CC_LINK) $(LDFLAGSEXTRA) -o $@
$(OBJECTS) $(LIBDIRS) $(LIBS) $(LINKFILES) $(LDFLAGS)', '$(MAKE) postcompile
BIN=$(TARGET)']),
- ('%.o', '%.c', '$(CC) $(CFLAGS) $(CFLAGSEXTRA) $(CFLAGS1) -o $@ -c
$< $(INCLUDEDIRS)'),
- ('%.o', '%.s', '$(CC) $(CFLAGS) $(CFLAGSEXTRA) $(CFLAGS1) -o $@ -c
$< $(INCLUDEDIRS)'),
- ('%.o', '%.cxx', '$(CXX) $(CFLAGS) $(CFLAGSEXTRA) $(CFLAGS1) -o $@
-c $< $(INCLUDEDIRS)'),
+ ('%.o', '%.c', '$(CC) $(CFLAGS) $(CFLAGSEXTRA) -o $@ -c $<
$(INCLUDEDIRS)'),
+ ('%.o', '%.s', '$(CC) $(CFLAGS) $(CFLAGSEXTRA) -o $@ -c $<
$(INCLUDEDIRS)'),
+ ('%.o', '%.cxx', '$(CXX) $(CFLAGS) $(CFLAGSEXTRA) -o $@ -c $<
$(INCLUDEDIRS)'),
]
for rule in rules:
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit