Commit 787cddc9 authored by Benjamin Peterson's avatar Benjamin Peterson

Merged revisions 86545 via svnmerge from

svn+ssh://pythondev@svn.python.org/python/branches/py3k

........
  r86545 | benjamin.peterson | 2010-11-19 22:31:07 -0600 (Fri, 19 Nov 2010) | 1 line

  new plan: functions that want 'tmp' can declare it
........
parent fdd52bea
...@@ -365,10 +365,7 @@ class Obj2ModVisitor(PickleVisitor): ...@@ -365,10 +365,7 @@ class Obj2ModVisitor(PickleVisitor):
self.emit("int", 0) self.emit("int", 0)
self.emit("obj2ast_%s(PyObject* obj, %s* out, PyArena* arena)" % (name, ctype), 0) self.emit("obj2ast_%s(PyObject* obj, %s* out, PyArena* arena)" % (name, ctype), 0)
self.emit("{", 0) self.emit("{", 0)
self.emit("PyObject* tmp = NULL;", 1)
self.emit("int isinstance;", 1) self.emit("int isinstance;", 1)
# Prevent compiler warnings about unused variable.
self.emit("tmp = tmp;", 1)
self.emit("", 0) self.emit("", 0)
def sumTrailer(self, name, add_label=False): def sumTrailer(self, name, add_label=False):
...@@ -403,6 +400,7 @@ class Obj2ModVisitor(PickleVisitor): ...@@ -403,6 +400,7 @@ class Obj2ModVisitor(PickleVisitor):
def complexSum(self, sum, name): def complexSum(self, sum, name):
self.funcHeader(name) self.funcHeader(name)
self.emit("PyObject *tmp = NULL;", 1)
for a in sum.attributes: for a in sum.attributes:
self.visitAttributeDeclaration(a, name, sum=sum) self.visitAttributeDeclaration(a, name, sum=sum)
self.emit("", 0) self.emit("", 0)
......
...@@ -3378,10 +3378,9 @@ failed: ...@@ -3378,10 +3378,9 @@ failed:
int int
obj2ast_mod(PyObject* obj, mod_ty* out, PyArena* arena) obj2ast_mod(PyObject* obj, mod_ty* out, PyArena* arena)
{ {
PyObject* tmp = NULL;
int isinstance; int isinstance;
tmp = tmp;
PyObject *tmp = NULL;
if (obj == Py_None) { if (obj == Py_None) {
*out = NULL; *out = NULL;
...@@ -3527,10 +3526,9 @@ obj2ast_mod(PyObject* obj, mod_ty* out, PyArena* arena) ...@@ -3527,10 +3526,9 @@ obj2ast_mod(PyObject* obj, mod_ty* out, PyArena* arena)
int int
obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena) obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena)
{ {
PyObject* tmp = NULL;
int isinstance; int isinstance;
tmp = tmp;
PyObject *tmp = NULL;
int lineno; int lineno;
int col_offset; int col_offset;
...@@ -4724,10 +4722,9 @@ obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena) ...@@ -4724,10 +4722,9 @@ obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena)
int int
obj2ast_expr(PyObject* obj, expr_ty* out, PyArena* arena) obj2ast_expr(PyObject* obj, expr_ty* out, PyArena* arena)
{ {
PyObject* tmp = NULL;
int isinstance; int isinstance;
tmp = tmp;
PyObject *tmp = NULL;
int lineno; int lineno;
int col_offset; int col_offset;
...@@ -5840,9 +5837,7 @@ obj2ast_expr(PyObject* obj, expr_ty* out, PyArena* arena) ...@@ -5840,9 +5837,7 @@ obj2ast_expr(PyObject* obj, expr_ty* out, PyArena* arena)
int int
obj2ast_expr_context(PyObject* obj, expr_context_ty* out, PyArena* arena) obj2ast_expr_context(PyObject* obj, expr_context_ty* out, PyArena* arena)
{ {
PyObject* tmp = NULL;
int isinstance; int isinstance;
tmp = tmp;
isinstance = PyObject_IsInstance(obj, (PyObject *)Load_type); isinstance = PyObject_IsInstance(obj, (PyObject *)Load_type);
if (isinstance == -1) { if (isinstance == -1) {
...@@ -5900,10 +5895,9 @@ obj2ast_expr_context(PyObject* obj, expr_context_ty* out, PyArena* arena) ...@@ -5900,10 +5895,9 @@ obj2ast_expr_context(PyObject* obj, expr_context_ty* out, PyArena* arena)
int int
obj2ast_slice(PyObject* obj, slice_ty* out, PyArena* arena) obj2ast_slice(PyObject* obj, slice_ty* out, PyArena* arena)
{ {
PyObject* tmp = NULL;
int isinstance; int isinstance;
tmp = tmp;
PyObject *tmp = NULL;
if (obj == Py_None) { if (obj == Py_None) {
*out = NULL; *out = NULL;
...@@ -6023,9 +6017,7 @@ obj2ast_slice(PyObject* obj, slice_ty* out, PyArena* arena) ...@@ -6023,9 +6017,7 @@ obj2ast_slice(PyObject* obj, slice_ty* out, PyArena* arena)
int int
obj2ast_boolop(PyObject* obj, boolop_ty* out, PyArena* arena) obj2ast_boolop(PyObject* obj, boolop_ty* out, PyArena* arena)
{ {
PyObject* tmp = NULL;
int isinstance; int isinstance;
tmp = tmp;
isinstance = PyObject_IsInstance(obj, (PyObject *)And_type); isinstance = PyObject_IsInstance(obj, (PyObject *)And_type);
if (isinstance == -1) { if (isinstance == -1) {
...@@ -6051,9 +6043,7 @@ obj2ast_boolop(PyObject* obj, boolop_ty* out, PyArena* arena) ...@@ -6051,9 +6043,7 @@ obj2ast_boolop(PyObject* obj, boolop_ty* out, PyArena* arena)
int int
obj2ast_operator(PyObject* obj, operator_ty* out, PyArena* arena) obj2ast_operator(PyObject* obj, operator_ty* out, PyArena* arena)
{ {
PyObject* tmp = NULL;
int isinstance; int isinstance;
tmp = tmp;
isinstance = PyObject_IsInstance(obj, (PyObject *)Add_type); isinstance = PyObject_IsInstance(obj, (PyObject *)Add_type);
if (isinstance == -1) { if (isinstance == -1) {
...@@ -6159,9 +6149,7 @@ obj2ast_operator(PyObject* obj, operator_ty* out, PyArena* arena) ...@@ -6159,9 +6149,7 @@ obj2ast_operator(PyObject* obj, operator_ty* out, PyArena* arena)
int int
obj2ast_unaryop(PyObject* obj, unaryop_ty* out, PyArena* arena) obj2ast_unaryop(PyObject* obj, unaryop_ty* out, PyArena* arena)
{ {
PyObject* tmp = NULL;
int isinstance; int isinstance;
tmp = tmp;
isinstance = PyObject_IsInstance(obj, (PyObject *)Invert_type); isinstance = PyObject_IsInstance(obj, (PyObject *)Invert_type);
if (isinstance == -1) { if (isinstance == -1) {
...@@ -6203,9 +6191,7 @@ obj2ast_unaryop(PyObject* obj, unaryop_ty* out, PyArena* arena) ...@@ -6203,9 +6191,7 @@ obj2ast_unaryop(PyObject* obj, unaryop_ty* out, PyArena* arena)
int int
obj2ast_cmpop(PyObject* obj, cmpop_ty* out, PyArena* arena) obj2ast_cmpop(PyObject* obj, cmpop_ty* out, PyArena* arena)
{ {
PyObject* tmp = NULL;
int isinstance; int isinstance;
tmp = tmp;
isinstance = PyObject_IsInstance(obj, (PyObject *)Eq_type); isinstance = PyObject_IsInstance(obj, (PyObject *)Eq_type);
if (isinstance == -1) { if (isinstance == -1) {
...@@ -6359,10 +6345,9 @@ failed: ...@@ -6359,10 +6345,9 @@ failed:
int int
obj2ast_excepthandler(PyObject* obj, excepthandler_ty* out, PyArena* arena) obj2ast_excepthandler(PyObject* obj, excepthandler_ty* out, PyArena* arena)
{ {
PyObject* tmp = NULL;
int isinstance; int isinstance;
tmp = tmp;
PyObject *tmp = NULL;
int lineno; int lineno;
int col_offset; int col_offset;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment