Skip to content
  1. Jun 22, 2007
  2. Jun 20, 2007
  3. Jun 16, 2007
  4. Jun 15, 2007
  5. Jun 13, 2007
    • Chris Lattner's avatar
      Implement implicit conversions in return stmts. · cf98efa7
      Chris Lattner authored
      llvm-svn: 39653
      cf98efa7
    • Chris Lattner's avatar
      Implement support for formal arguments. We can now compile this: · 53621a53
      Chris Lattner authored
      int test(int X, short Y, float Z) {
        return (int)(X*Y+Z);
      }
      
      to:
      
      define i32 @test(i32 %X, i16 %Y, float %Z) {
      entry:
              %promote = sext i16 %Y to i32           ; <i32> [#uses=1]
              %mul = mul i32 %promote, %X             ; <i32> [#uses=1]
              %promote3 = sitofp i32 %mul to float            ; <float> [#uses=1]
              %add = add float %promote3, %Z          ; <float> [#uses=1]
              %conv = fptosi float %add to i32                ; <i32> [#uses=1]
              ret i32 %conv
      }
      
      with:
      
      $ clang -emit-llvm t.c | llvm-as | opt -std-compile-opts | llvm-dis
      
      llvm-svn: 39652
      53621a53
  6. Jun 11, 2007
  7. Jun 09, 2007
  8. Jun 06, 2007
  9. Jun 05, 2007
  10. Jun 03, 2007
    • Chris Lattner's avatar
      Type::isSignedInteger() and isUnsignedInteger() did not properly account for · b16f455e
      Chris Lattner authored
      'char', which varies based on the target.
      
      Instead of spreading target knowledge throughout the compiler, bifurcate char
      into Char_S and Char_U, and have ASTContext create the right one based on the
      target, when it starts up.
      
      llvm-svn: 39577
      b16f455e
    • Chris Lattner's avatar
      Implement EmitUsualArithmeticConversions, so we can add shorts to floats and · cf250248
      Chris Lattner authored
      ints to long long etc.  For int to longlong, we now get:
      
              %tmp = load i64* %F             ; <i64> [#uses=1]
              %tmp1 = load i32* %D            ; <i32> [#uses=1]
              %promote = sext i32 %tmp1 to i64                ; <i64> [#uses=1]
              %tmp2 = add i64 %tmp, %promote          ; <i64> [#uses=0]
      
      llvm-svn: 39576
      cf250248
    • Chris Lattner's avatar
      Change EmitUsualArithmeticConversions to use EmitExprWithUsualUnaryConversions. · c18f9d1a
      Chris Lattner authored
      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
      c18f9d1a
    • Chris Lattner's avatar
      implement a first hack at codegen'ing the usual unary conversions. · 6db1fb84
      Chris Lattner authored
      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
      6db1fb84
  11. Jun 02, 2007
  12. Jun 01, 2007
  13. May 31, 2007
  14. May 30, 2007
Loading