Skip to content

Commit

Permalink
Portable Python script across Python version
Browse files Browse the repository at this point in the history
Python3 does not support type destructuring in function parameters.

Differential Revision: https://reviews.llvm.org/D55198

llvm-svn: 348129
  • Loading branch information
serge-sans-paille-qb committed Dec 3, 2018
1 parent 91728fc commit 75394aa
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion clang/utils/ABITest/Enumeration.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ def __pow__(self, b):
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

Expand Down
3 changes: 2 additions & 1 deletion clang/utils/ABITest/TypeGen.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,8 @@ def getField(t):
' '.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),)
Expand Down

0 comments on commit 75394aa

Please sign in to comment.