Skip to content

Commit

Permalink
Rename package py2llvm to compiler.
Browse files Browse the repository at this point in the history
Since the package implements a typechecker along with a code generator,
and the typechecker will be run before or together with transformations,
this name is more descriptive.
whitequark committed Jun 29, 2015
1 parent f430bf3 commit 6bf9539
Showing 23 changed files with 19 additions and 19 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion artiq/py2llvm/typing.py → artiq/compiler/typing.py
Original file line number Diff line number Diff line change
@@ -639,7 +639,7 @@ def _coerce_binop(self, op, left, right):
if types.is_tuple(left.type) or types.is_tuple(right.type):
tuple_, other = self._order_by_pred(types.is_tuple, left, right)
diag = diagnostic.Diagnostic("error",
"py2llvm does not support passing tuples to '*'", {},
"passing tuples to '*' is not supported", {},
op.loc, [tuple_.loc])
self.engine.process(diag)
return
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# RUN: %python -m artiq.py2llvm.typing %s >%t
# RUN: %python -m artiq.compiler.typing %s >%t
# RUN: OutputCheck %s --file-to-check=%t

# CHECK-L: bool:<constructor bool>():bool
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# RUN: %python -m artiq.py2llvm.typing %s >%t
# RUN: %python -m artiq.compiler.typing %s >%t
# RUN: OutputCheck %s --file-to-check=%t

1 | 2
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# RUN: %python -m artiq.py2llvm.typing +diag %s >%t
# RUN: %python -m artiq.compiler.typing +diag %s >%t
# RUN: OutputCheck %s --file-to-check=%t

a = 1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# RUN: %python -m artiq.py2llvm.typing +diag %s >%t
# RUN: %python -m artiq.compiler.typing +diag %s >%t
# RUN: OutputCheck %s --file-to-check=%t

# CHECK-L: ${LINE:+1}: error: cannot call this expression of type int
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# RUN: %python -m artiq.py2llvm.typing +diag %s >%t
# RUN: %python -m artiq.compiler.typing +diag %s >%t
# RUN: OutputCheck %s --file-to-check=%t

# CHECK-L: ${LINE:+1}: error: expected '<<' operand to be of integer type, not float
@@ -17,7 +17,7 @@
# CHECK-L: ${LINE:+1}: note: int(width='b), which cannot be added to a tuple
(1,) + 2

# CHECK-L: ${LINE:+1}: error: py2llvm does not support passing tuples to '*'
# CHECK-L: ${LINE:+1}: error: passing tuples to '*' is not supported
(1,) * 2

# CHECK-L: ${LINE:+3}: error: expected '*' operands to be a list and an integer in this context
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# RUN: %python -m artiq.py2llvm.typing +diag %s >%t
# RUN: %python -m artiq.compiler.typing +diag %s >%t
# RUN: OutputCheck %s --file-to-check=%t

# CHECK-L: ${LINE:+1}: error: return statement outside of a function
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# RUN: %python -m artiq.py2llvm.typing +diag %s >%t
# RUN: %python -m artiq.compiler.typing +diag %s >%t
# RUN: OutputCheck %s --file-to-check=%t

try:
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# RUN: %python -m artiq.py2llvm.typing +diag %s >%t
# RUN: %python -m artiq.compiler.typing +diag %s >%t
# RUN: OutputCheck %s --file-to-check=%t

# CHECK-L: ${LINE:+1}: error: type int(width='a) is not iterable
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# RUN: %python -m artiq.py2llvm.typing +diag %s >%t
# RUN: %python -m artiq.compiler.typing +diag %s >%t
# RUN: OutputCheck %s --file-to-check=%t

# CHECK-L: ${LINE:+1}: fatal: name 'x' is not bound to anything
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# RUN: %python -m artiq.py2llvm.typing +diag %s >%t
# RUN: %python -m artiq.compiler.typing +diag %s >%t
# RUN: OutputCheck %s --file-to-check=%t

x = 1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# RUN: %python -m artiq.py2llvm.typing +diag %s >%t
# RUN: %python -m artiq.compiler.typing +diag %s >%t
# RUN: OutputCheck %s --file-to-check=%t

# CHECK-L: ${LINE:+2}: error: cannot unify int(width='a) with NoneType
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# RUN: %python -m artiq.py2llvm.typing +diag %s >%t
# RUN: %python -m artiq.compiler.typing +diag %s >%t
# RUN: OutputCheck %s --file-to-check=%t

a = 1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# RUN: %python -m artiq.py2llvm.typing %s >%t
# RUN: %python -m artiq.compiler.typing %s >%t
# RUN: OutputCheck %s --file-to-check=%t

# CHECK-L: Exception:<constructor Exception>
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# RUN: %python -m artiq.py2llvm.typing %s >%t
# RUN: %python -m artiq.compiler.typing %s >%t

def _gcd(a, b):
if a < 0:
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# RUN: %python -m artiq.py2llvm.typing %s >%t
# RUN: %python -m artiq.compiler.typing %s >%t
# RUN: OutputCheck %s --file-to-check=%t

# CHECK-L: x:<function len>
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# RUN: %python -m artiq.py2llvm.typing %s >%t
# RUN: %python -m artiq.compiler.typing %s >%t
# RUN: OutputCheck %s --file-to-check=%t

def f():
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# RUN: %python -m artiq.py2llvm.typing %s >%t
# RUN: %python -m artiq.compiler.typing %s >%t
# RUN: OutputCheck %s --file-to-check=%t

a = 1

5 comments on commit 6bf9539

@sbourdeauducq
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had the transforms/py2llvm split to make py2llvm a fairly generic Python to LLVM compiler, and have most of the ARTIQ-specific stuff in transforms. Can't it stay that way?

@whitequark
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It'll pretty much stay that way, I just think that the name py2llvm is a bad one, since the usage of LLVM is more of an implementation detail of the codegen. I can rename back if you want.

@sbourdeauducq
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So there will be "compiler" and "transforms"?

@whitequark
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think compiler and interleaver, or something like that.

@sbourdeauducq
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok.

Please sign in to comment.