Skip to content
  1. Jun 20, 2007
    • Chris Lattner's avatar
      Hook up global function and variable handling. We can now compile: · b6984c48
      Chris Lattner authored
      int X, bar(int,int,int);
      short Y;
      
      double foo() {
        return bar(X, Y, 3);
      }
      
      into:
      
      @X = external global i32                ; <i32*> [#uses=1]
      @Y = external global i16                ; <i16*> [#uses=1]
      
      define double @foo() {
      entry:
              %tmp = load i32* @X             ; <i32> [#uses=1]
              %tmp1 = load i16* @Y            ; <i16> [#uses=1]
              %promote = sext i16 %tmp1 to i32                ; <i32> [#uses=1]
              %call = tail call i32 @bar( i32 %tmp, i32 %promote, i32 3 )             ; <i32> [#uses=1]
              %conv = sitofp i32 %call to double              ; <double> [#uses=1]
              ret double %conv
      }
      
      declare i32 @bar(i32, i32, i32)
      
      llvm-svn: 39663
      b6984c48
  2. Jun 16, 2007
  3. Jun 15, 2007
  4. Jun 13, 2007
    • Steve Naroff's avatar
      Bug #: · 75c1723b
      Steve Naroff authored
      Submitted by:
      Reviewed by:
      Fix CheckRelationalOperands/CheckEqualityOperands to deal with null pointer
      constants. The new logic also deals (more) correctly for non-pointer/integer
      operands.
      
      llvm-svn: 39654
      75c1723b
    • 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
    • Chris Lattner's avatar
      Update the xcode project for bill · 23cff887
      Chris Lattner authored
      llvm-svn: 39651
      23cff887
    • Bill Wendling's avatar
      Submitted by: Bill Wendling · 478b8863
      Bill Wendling authored
      Reviewed by: Chris Lattner
      
      - Created a base class (TextDiagnostics) for all text diagnostic classes.
        Moved the "IgnoreDiagnostic" method up there, and created a method that
        will format the diagnostic string, replacing %# with the appropriate
        string. This is in preparation for adding a text diagnostic checker.
      
      llvm-svn: 39650
      478b8863
    • Steve Naroff's avatar
      Bug #: · d6fbee81
      Steve Naroff authored
      Submitted by:
      Reviewed by:
      Fixed typechecking bugs wrt UsualUnaryConversions. Includes two distinct fixes:
      
      #1: Call UsualUnaryConversions in CheckRelationalOperands/CheckEqualityOperands.
      #2: UsualArithmeticConversions arguments are now output parameters. This insures
      the implicit conversion is seen by clients (and fixes bugs in CheckAdditionOperands
      and CheckSubtractionOperands when doing pointer arithmetic).
      ~
      
      llvm-svn: 39649
      d6fbee81
  5. Jun 12, 2007
    • Chris Lattner's avatar
      Pretty print if/else/elseif chains nicer, like this: · c0a38dd3
      Chris Lattner authored
      void printutf8(unsigned int X) {
        if (X <= 127)
          printf("%c", (char)X);
        else if (X <= 2047)
          printf("%d %d ", 128 + 64 + (X >> 6), 128 + (X & ((1 << 6) - 1)));
        else if (X <= 65535)
          printf("%c%c%c", 128 + 64 + 32 + (X >> 12), 128 + ((X >> 6) & 63), 128 + (X & 63));
        else
          printf("UNKNOWN %d\n", X);
      
      instead of:
      
        if (X <= 127)
          printf("%c", (char)X);
        else
          if (X <= 2047)
            printf("%d %d ", 128 + 64 + (X >> 6), 128 + (X & ((1 << 6) - 1)));
          else
            if (X <= 65535)
              printf("%c%c%c", 128 + 64 + 32 + (X >> 12), 128 + ((X >> 6) & 63), 128 + (X & 63));
            else
              printf("UNKNOWN %d\n", X);
      
      llvm-svn: 39648
      c0a38dd3
  6. Jun 11, 2007
  7. Jun 10, 2007
    • Bill Wendling's avatar
      Submitted by: Bill Wendling · 314ae547
      Bill Wendling authored
      Reviewed by: Chris Lattner
      
      - Added a method "IgnoreDiagnostic" so that the diagnostic client can
        tell the diagnostic object that it doesn't want to handle a particular
        diagnostic message. In which case, it won't be counted as either a
        diagnostic or error.
      
      llvm-svn: 39641
      314ae547
    • Steve Naroff's avatar
      Bug #: · 0f05a7ae
      Steve Naroff authored
      Submitted by:
      Reviewed by:
      Changed the name of DeclSpec.AddAttribute and Declarator.AddAttribute to
      AddAttributes(). Also added some (much needed) comments. While documenting,
      realized I could simplify & tighten up Declarator.AddAttributes...
      
      llvm-svn: 39640
      0f05a7ae
  8. Jun 09, 2007
Loading