Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pretty print i1 values using boolean names #13

Open
TomMD opened this issue Apr 20, 2017 · 0 comments
Open

Pretty print i1 values using boolean names #13

TomMD opened this issue Apr 20, 2017 · 0 comments

Comments

@TomMD
Copy link
Contributor

TomMD commented Apr 20, 2017

In at least llvm 3.8 the values of type i1 appear as true or false instead of 18446744073709551615 (which seems odd for a "1 bit" value). We should make the printing of these literals take into account the type.

For example

$ cat t.c
int f(int x)
{
    return (x == 0 || x == 42);
}
$ clang -emit-llvm -c t.c -o t.bc
$ llvm-dis t.bc ; cat t.ll | grep phi
  %8 = phi i1 [ true, %0 ], [ %6, %4 ]
$ llvm-disasm t.bc | grep phi
  %8 = phi i1 [ 18446744073709551615, %0 ], [ %6, %4 ]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant