forked from OSchip/llvm-project
Portable Python script across Python version
Python3 does not support type destructuring in function parameters. Differential Revision: https://reviews.llvm.org/D55198 llvm-svn: 348129
This commit is contained in:
parent
91728fcd19
commit
75394aa5bb
|
@ -46,7 +46,8 @@ aleph0 = Aleph0()
|
|||
def base(line):
|
||||
return line*(line+1)//2
|
||||
|
||||
def pairToN((x,y)):
|
||||
def pairToN(pair):
|
||||
x,y = pair
|
||||
line,index = x+y,y
|
||||
return base(line)+index
|
||||
|
||||
|
|
|
@ -99,7 +99,8 @@ class RecordType(Type):
|
|||
' '.join(map(getField, self.fields)))
|
||||
|
||||
def getTypedefDef(self, name, printer):
|
||||
def getField((i, t)):
|
||||
def getField(it):
|
||||
i, t = it
|
||||
if t.isBitField():
|
||||
if t.isPaddingBitField():
|
||||
return '%s : 0;'%(printer.getTypeName(t),)
|
||||
|
|
Loading…
Reference in New Issue