aboutsummaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorPeter Johnson <peter@tortall.net>2007-01-21 22:01:34 +0000
committerPeter Johnson <peter@tortall.net>2007-01-21 22:01:34 +0000
commita1f4c99e94d64aed70995c2cbe0b0ef5a5cc3313 (patch)
tree7d4be1be0c8e45c64c9942a8dd01b4da781fc276 /tools
parent9dd8df8fb683038deaaba9959872c9ba6ae66fb2 (diff)
downloadyasm-a1f4c99e94d64aed70995c2cbe0b0ef5a5cc3313.tar.gz
Remove yasm_immval, moving remaining unique information (sign flag) into
yasm_value. svn path=/trunk/yasm/; revision=1740
Diffstat (limited to 'tools')
-rw-r--r--tools/python-yasm/bytecode.pxi28
-rw-r--r--tools/python-yasm/tests/test_bytecode.py9
2 files changed, 1 insertions, 36 deletions
diff --git a/tools/python-yasm/bytecode.pxi b/tools/python-yasm/bytecode.pxi
index 50c72ae7..86f38d8f 100644
--- a/tools/python-yasm/bytecode.pxi
+++ b/tools/python-yasm/bytecode.pxi
@@ -39,15 +39,9 @@ cdef extern from "libyasm/bytecode.h":
unsigned int nosplit
unsigned int strong
- cdef struct yasm_immval:
- yasm_value val
- unsigned int len
- unsigned int sign
-
cdef struct yasm_dataval
cdef struct yasm_datavalhead
- cdef yasm_immval* yasm_imm_create_expr(yasm_expr *e, yasm_bytecode *precbc)
cdef yasm_expr* yasm_ea_get_disp(yasm_effaddr *ea)
cdef void yasm_ea_set_len(yasm_effaddr *ea, unsigned int len)
cdef void yasm_ea_set_nosplit(yasm_effaddr *ea, unsigned int nosplit)
@@ -153,28 +147,6 @@ cdef extern from "libyasm/bc-int.h":
cdef yasm_bytecode *yasm_bc__next(yasm_bytecode *bc)
-cdef object __make_immval(yasm_immval *imm):
- return ImmVal(__pass_voidp(imm, ImmVal))
-
-cdef class ImmVal:
- cdef yasm_immval *imm
-
- def __new__(self, value, precbc=None):
- if isinstance(value, Expression):
- if precbc is None:
- self.imm = yasm_imm_create_expr(
- yasm_expr_copy((<Expression>value).expr), NULL)
- elif isinstance(precbc, Bytecode):
- self.imm = yasm_imm_create_expr(
- yasm_expr_copy((<Expression>value).expr),
- (<Bytecode>precbc).bc)
- else:
- raise TypeError("Invalid precbc type '%s'" % type(precbc))
- elif PyCObject_Check(value):
- self.imm = <yasm_immval *>__get_voidp(value, ImmVal)
- else:
- raise TypeError("Invalid value type '%s'" % type(value))
-
cdef class Bytecode:
cdef yasm_bytecode *bc
diff --git a/tools/python-yasm/tests/test_bytecode.py b/tools/python-yasm/tests/test_bytecode.py
index ff7d7061..fb6c2a2b 100644
--- a/tools/python-yasm/tests/test_bytecode.py
+++ b/tools/python-yasm/tests/test_bytecode.py
@@ -1,11 +1,4 @@
# $Id$
from tests import TestCase, add
-from yasm import Bytecode, ImmVal, Expression
+from yasm import Bytecode, Expression
-class TImmVal(TestCase):
- def test_create(self):
- self.assertRaises(TypeError, ImmVal, "notimmval")
-
- imm = ImmVal(Expression('+', 2, 3))
-
-add(TImmVal)