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

Change EmitUsualArithmeticConversions to use EmitExprWithUsualUnaryConversions.

This allows us to compile:

  register short X;
  {
    int Y;
    return 1+X+Y;

into:

        %tmp = load i16* %X             ; <i16> [#uses=1]
        %promote = sext i16 %tmp to i32         ; <i32> [#uses=1]
        %tmp1 = add i32 1, %promote             ; <i32> [#uses=1]
        %tmp2 = load i32* %Y            ; <i32> [#uses=1]
        %tmp3 = add i32 %tmp1, %tmp2            ; <i32> [#uses=1]
        ret i32 %tmp3

Look at the amazing sign extension, so much happier than an assertion failure. :)

llvm-svn: 39565
parent 6db1fb84
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