Skip to content
  1. Jun 08, 2007
  2. Jun 07, 2007
    • Bill Wendling's avatar
      Submitted by: Bill Wendling · c2b867ac
      Bill Wendling authored
      - Renamed file guard.
      
      llvm-svn: 39604
      c2b867ac
    • Bill Wendling's avatar
      Submitted by: Bill Wendling · 37b1ddec
      Bill Wendling authored
      Reviewed by: Chris Lattner
      
      - Separated out the diagnostic client from the clang driver. This is in
        preparation for creating a diagnostic client that will be used to check
        error and warning messages.
      
      llvm-svn: 39603
      37b1ddec
    • Steve Naroff's avatar
      Bug #: · 98d153c7
      Steve Naroff authored
      Submitted by:
      Reviewed by:
      
      Fixed a bug in the parser's handling of attributes on pointer declarators.
      
      For example, the following code was producing a syntax error...
      
      int *__attribute(()) foo;
      
      attrib.c:10:25: error: expected identifier or '('
      int *__attribute(()) foo;
                              ^
      Changed Parser::ParseTypeQualifierListOpt to not consume the token following
      an attribute declaration.
      
      Also added LexerToken::getName() convenience method...useful when tracking
      down errors like this.
      
      llvm-svn: 39602
      98d153c7
  3. Jun 06, 2007
    • Steve Naroff's avatar
      Bug #: · 98cf3e95
      Steve Naroff authored
      Submitted by:
      Reviewed by:
      
      The following code illustrates a bug in the semantic analysis for assignments:
      
      int func() {
        int *P;
        char *x;
        P = x; // type of this assignment expression should be "int *", NOT "char *".
      }
      
      While the type checking/diagnostics are correct, the type of the assignment
      expression is incorrect (which shows up during code gen).  With the fix,
      the llvm code looks correct...
      
      [dylan:~/llvm/tools/clang] admin% ../../Debug/bin/clang cast.c -emit-llvm
      cast.c:4:5: warning: incompatible pointer types assigning 'char *' to 'int *'
        P = x; // type of assignment expression is "int *", NOT "char *".
        ~ ^ ~
      ; ModuleID = 'foo'
      
      define i32 @func() {
      entry:
              %P = alloca i32*                ; <i32**> [#uses=1]
              %x = alloca i8*         ; <i8**> [#uses=1]
              %allocapt = bitcast i32 undef to i32            ; <i32> [#uses=0]
              %tmp = load i8** %x             ; <i8*> [#uses=1]
              %conv = bitcast i8* %tmp to i32*                ; <i32*> [#uses=1]
              store i32* %conv, i32** %P
              ret i32 undef
      }
      
      Even though the fix was simple, I decided to rename/refactor the surrounding code
      to make a clearer distinction between constraint checking and conversion.
      
      - Renamed AssignmentConversionResult -> AssignmentCheckResult.
      - Renamed UsualAssignmentConversions -> CheckAssignmentConstraints.
      - Changed the return type of CheckAssignmentConstraints and CheckPointerTypesForAssignment
      from QualType -> AssignmentCheckResult. These routines no longer take a reference to the result (obviously).
      - Changed CheckAssignmentOperands to return the correct type (with spec annotations).
      
      llvm-svn: 39601
      98cf3e95
    • Chris Lattner's avatar
      When parsing an expr in stmt context, make sure to consume the semicolon · 2e550fea
      Chris Lattner authored
      after the expr along with the expr.  If we don't do this, the semicolon
      gets parsed as a nullstmt, which makes the generated AST very strange.
      
      llvm-svn: 39600
      2e550fea
    • Chris Lattner's avatar
      On bogus code like this: · 3d01e4ea
      Chris Lattner authored
        int *P2;
        P2(1, 2, 3);
      
        register short X;
        X();
      
      emit:
      
      ds.c:10:3: error: called object is not a function or function pointer
        P2(1, 2, 3);
        ^~~~~~~~~~~
      ds.c:13:3: error: called object is not a function or function pointer
        X();
        ^~~
      
      instead of aborting.
      
      llvm-svn: 39599
      3d01e4ea
    • Chris Lattner's avatar
      Fix semantic analysis of calls on stuff like: · 3343f81a
      Chris Lattner authored
      int func() {
       int (*FP)();
       FP();
       (*****FP)();
      }
      
      llvm-svn: 39598
      3343f81a
    • Chris Lattner's avatar
      implement codegen of string literals. · 4347e369
      Chris Lattner authored
      llvm-svn: 39597
      4347e369
    • Chris Lattner's avatar
      implement the real int/fp conversions · 83b484b3
      Chris Lattner authored
      llvm-svn: 39596
      83b484b3
    • Chris Lattner's avatar
      implement support for casts to/from pointers. · cf106ab4
      Chris Lattner authored
      llvm-svn: 39595
      cf106ab4
  4. Jun 05, 2007
  5. Jun 03, 2007
    • Steve Naroff's avatar
      Bug #: · c27f89eb
      Steve Naroff authored
      Submitted by:
      Reviewed by:
      Apply UsualUnaryConversion() to statement conditions that expect scalars.
      UsualUnaryConversion() converts function/arrays to pointers.
      
      This fixes the following...
      
      int func() {
        int A[10];
        while (A) {
        }
        if (A) ;
        for (; A; ) ;
      }
      
      llvm-svn: 39580
      c27f89eb
    • Bill Wendling's avatar
      Add const/volatile badness · cbf4709c
      Bill Wendling authored
      llvm-svn: 39579
      cbf4709c
    • Chris Lattner's avatar
      fix a predicate I just broke · 64453e63
      Chris Lattner authored
      llvm-svn: 39578
      64453e63
Loading