Skip to content
This repository has been archived by the owner on Jun 13, 2020. It is now read-only.

Arithmetic in constants spits out malformed LLVM IR #713

Open
felixangell opened this issue Feb 29, 2016 · 3 comments
Open

Arithmetic in constants spits out malformed LLVM IR #713

felixangell opened this issue Feb 29, 2016 · 3 comments
Labels

Comments

@felixangell
Copy link
Member

If you do the following:

foo := 2;
bar := foo * foo;

It will give you a in the LLVM IR.

@kiljacken
Copy link
Member

I am unable to reproduce this with the following snippet:

pub func main(argc: int, argv: ^^u8) -> int {
    foo := 2;
    bar := foo * foo;

    return 0;
}

@felixangell
Copy link
Member Author

Oh sorry forgot to mention, global constants.

@kiljacken
Copy link
Member

6e66c66 adds a warning for this. To actually generate most of these expressions we would need a constant folding pass or some such

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants