aboutsummaryrefslogtreecommitdiff
path: root/src/AstGen.zig
diff options
context:
space:
mode:
authorDaniele Cocca <daniele.cocca@gmail.com>2022-03-20 20:57:56 +0000
committerVeikka Tuominen <git@vexu.eu>2022-03-30 11:57:16 +0300
commitebafdb958c1aa6b41c28fc7d45f44e38a69a3bd5 (patch)
treef61152ba5bbd2fe77fbfcdedc9e876a5d982550b /src/AstGen.zig
parent633fe41a2c2310d8cfab53ee9d87bb50ac4efc41 (diff)
downloadzig-ebafdb958c1aa6b41c28fc7d45f44e38a69a3bd5.tar.gz
zig-ebafdb958c1aa6b41c28fc7d45f44e38a69a3bd5.zip
AstGen: don't coerce inputs to usize in asmExpr
Instead, use ResultLoc.none to allow for the expression type to be inferred [^1]. This effectively moves the type coercion to Sema, in order to turn comptime values into usable values for the backends to consume. Right now the coercion is applies as comptime_int -> usize and comptime_float -> f64, as an arbitrary choice. [^1]: https://github.com/ziglang/zig/blob/9f25c8140cb859fcea7023362afcb29b1e4df41f/src/AstGen.zig#L207-L208
Diffstat (limited to 'src/AstGen.zig')
-rw-r--r--src/AstGen.zig2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/AstGen.zig b/src/AstGen.zig
index 296eb80e7c..b66f7b868b 100644
--- a/src/AstGen.zig
+++ b/src/AstGen.zig
@@ -6842,7 +6842,7 @@ fn asmExpr(
const name = try astgen.identAsString(symbolic_name);
const constraint_token = symbolic_name + 2;
const constraint = (try astgen.strLitAsString(constraint_token)).index;
- const operand = try expr(gz, scope, .{ .ty = .usize_type }, node_datas[input_node].lhs);
+ const operand = try expr(gz, scope, .none, node_datas[input_node].lhs);
inputs[i] = .{
.name = name,
.constraint = constraint,