Skip to content
Commit 6db1fb84 authored by Chris Lattner's avatar Chris Lattner
Browse files

implement a first hack at codegen'ing the usual unary conversions.

This allows us to compile:

int func() {
  int A[10];
  if (!A) {

to:

define i32 @func() {
entry:
        %A = alloca [10 x i32]          ; <[10 x i32]*> [#uses=1]
        %arraydecay = getelementptr [10 x i32]* %A, i32 0, i32 0                ; <i32*> [#uses=1]
        %tobool = icmp ne i32* %arraydecay, null                ; <i1> [#uses=1]
        %lnot = xor i1 %tobool, true            ; <i1> [#uses=1]
        br i1 %lnot, label %ifthen, label %ifend

-Chris

llvm-svn: 39564
parent 226d419e
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment