Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/bitcode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ export class Builder {
return new types.Void();
}

public static i(width: number): types.Int {
return new types.Int(width);
public static i(width: number, signed: boolean = false): types.Int {
return new types.Int(width, signed);
}

public static signature(returnType: Type, params: Type[]): types.Signature {
Expand Down
4 changes: 2 additions & 2 deletions src/types/int.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import * as values from '../values';
import { Type } from './base';

export class Int extends Type {
constructor(public readonly width: number) {
constructor(public readonly width: number, public readonly signed: boolean = false) {
super('i' + width);
}

Expand All @@ -16,7 +16,7 @@ export class Int extends Type {
}

const toInt = to as Int;
return toInt.width === this.width;
return toInt.width === this.width && toInt.signed === this.signed;
}

public val(num: number): values.constants.Int {
Expand Down