Skip to content
  1. May 24, 2007
  2. May 23, 2007
    • Steve Naroff's avatar
      Bug #: · f84d11f9
      Steve Naroff authored
      Submitted by:
      Reviewed by:
      Added "global" statistics gathering for Decls/Stmts/Exprs.
      Very useful for working with a single file. When we start compiling
      multiple files, will need to enhance this to collect stats on a per-module
      basis.
      
      llvm-svn: 39485
      f84d11f9
    • Bill Wendling's avatar
      Bug #: · 5a85f910
      Bill Wendling authored
      Submitted by: Bill Wendling
      Reviewed by: Chris Lattner
      
      - Removed unneeded <iostream> header.
      
      llvm-svn: 39484
      5a85f910
    • Bill Wendling's avatar
      Bug #: · 48fbdd03
      Bill Wendling authored
      Submitted by: Bill Wendling
      Reviewed by: Chris Lattner
      
      - Changed "std::cerr" to "OS" stream to be consistent with the other
        outputs in the method.
      
      llvm-svn: 39483
      48fbdd03
    • Bill Wendling's avatar
      Bug #: · f0648703
      Bill Wendling authored
      Submitted by: Bill Wendling
      Reviewed by: Chris Lattner
      
      - Comment fix.
      
      llvm-svn: 39482
      f0648703
  3. May 22, 2007
    • Steve Naroff's avatar
      Bug #: · 7fd68933
      Steve Naroff authored
      Submitted by:
      Reviewed by:
      One bug compiling "Carbon.h" on Leopard, one diagnostic tweak.
      - CheckIndirectionOperand wasn't operating on the canonical type (so it
      was complaining about typedef names).
      - The diagnostic was less than great. Here's what is was:
      
      [dylan:~/llvm/tools/clang] admin% ../../Debug/bin/clang t.c
      t.c:4:3: error: invalid argument type to unary expression 'int'
       *p;
       ^~
      
      And here's what I changed it to...
      
      snaroff:clang naroff$ ../../Debug/bin/clang bug.c
      bug.c:5:3: error: indirection requires a pointer ('int' operand invalid)
        *p;
        ^~
      
      llvm-svn: 39481
      7fd68933
    • Steve Naroff's avatar
      Bug #: · 21d5e87a
      Steve Naroff authored
      Submitted by:
      Reviewed by:
      Add Makefile
      
      llvm-svn: 39480
      21d5e87a
  4. May 21, 2007
  5. May 20, 2007
    • Steve Naroff's avatar
      Bug #: · 30d1fbc8
      Steve Naroff authored
      Submitted by:
      Reviewed by:
      Bozo bug in last checkin. Needed to move the check for null pointers
      up (and out of the pointer/pointer clause).
      
      llvm-svn: 39466
      30d1fbc8
    • Chris Lattner's avatar
      Steve pointed out that testcases like this (with a macro expansion): · 5ab15f15
      Chris Lattner authored
      #define friendlystruct fs
      
        struct A { int X; };
      
        void test2(struct A friendlystruct, int C) {
          return friendlystruct + (C     *40);
        }
      
      were getting diagnosed like this:
      
      t.c:7:27: error: invalid operands to binary expression ('struct A' and 'int')
          return friendlystruct + (C     *40);
                 ~~             ^ ~~~~~~~~~~~
      
      The problem is that getCharacterData returns a pointer to the macro expansion,
      not to the macro instantiation.  Instead, use getLogicalLoc to get a pointer
      to the instatiation location, so we relex the macro id.  We now get:
      
      t.c:7:27: error: invalid operands to binary expression ('struct A' and 'int')
          return friendlystruct + (C     *40);
                 ~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~
      
      oooh ahh. :)
      
      llvm-svn: 39465
      5ab15f15
    • Steve Naroff's avatar
      Bug #: · ada7d429
      Steve Naroff authored
      Submitted by:
      Reviewed by:
      Fix two bugs...
      
      - Sema::CheckConditionalOperands(). Needed to move the check for
      null pointer constants up to the clause dealing with two pointers types.
      The previous code would never get executed.
      - Expr::isNullPointerConstant(). This predicate was much too naive...it
      should have had a FIXME (my bad). It now deals with "void *" cast expressions.
      It still has one major bug...it needs to evaluate the expression to correctly
      determine if it is a null pointer constant (e.g. 7-7 should pass).
      
      llvm-svn: 39464
      ada7d429
    • Chris Lattner's avatar
      implement octal escape sequences. · 812eda82
      Chris Lattner authored
      llvm-svn: 39463
      812eda82
    • Chris Lattner's avatar
    • Chris Lattner's avatar
      db5ac601
  6. May 19, 2007
    • Chris Lattner's avatar
      improve const correctness · beeb9bc5
      Chris Lattner authored
      llvm-svn: 39460
      beeb9bc5
    • Chris Lattner's avatar
      Use the new source ranges tracking feature to highlight the important pieces · ebd1b334
      Chris Lattner authored
      of a subexpression when emitting a diagnostic.  Consider this example:
      
      struct A { int X; };
      
      void test1(void *P, int C) {
        return ((C*40) + *P) / 42+P;
      }
      
      void test2(struct A friendlystruct, int C) {
        return (C     *40) + friendlystruct;
      }
      
      void test3(struct A friendlystruct, int C) {
        return friendlystruct + test2(friendlystruct
                                     , C);
      }
      
      
      clang now produces this output:
      
      t.c:4:18: error: invalid operands to binary expression ('int' and 'void')
        return ((C*40) + *P) / 42+P;
                ~~~~~~ ^ ~~
      
      This shows the important pieces of a nested (and potentially very complex)
      expression.
      
      
      t.c:8:18: error: invalid operands to binary expression ('int' and 'struct A')
        return (C     *40) + friendlystruct;
               ~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~
      
      This shows that tabs in source files (after the 'C') and multichar tokens
      (friendlystruct) are handled correctly.
      
      
      
      t.c:12:25: error: invalid operands to binary expression ('struct A' and 'void')
        return friendlystruct + test2(friendlystruct
               ~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~
      
      This shows how multiline ranges are printed.  Any part of the range that is
      not on the same line as the carat is just ignored.  This also shows that
      trailing spaces on the line aren't highlighted.
      
      llvm-svn: 39459
      ebd1b334
    • Chris Lattner's avatar
      Change the structure of the code that emits the ^ marker in a diagnostic, · f8d31978
      Chris Lattner authored
      but there is no functionality change yet.
      
      llvm-svn: 39458
      f8d31978
    • Chris Lattner's avatar
      fix some indentation funkiness · 84e160a7
      Chris Lattner authored
      llvm-svn: 39457
      84e160a7
    • Steve Naroff's avatar
      Bug #: · 71ce2e06
      Steve Naroff authored
      Submitted by:
      Reviewed by:
      An important, but truly mind numbing change.
      
      Added 6 flavors of Sema::Diag() that take 1 or two SourceRanges. Considered
      adding 3 flavors (using default args), however this wasn't as clear.
      
      Removed 2 flavors of Sema::Diag() that took LexerToken's (they weren't used).
      
      Changed all the typechecking routines to pass the appropriate range(s).
      
      Hacked the diagnostic machinery and driver to acccommodate the new data.
      
      What's left? A FIXME in clang.c to use the ranges. Chris offered to do the
      honors:-) Which includes taking us to the end of an identifier:-)
      
      llvm-svn: 39456
      71ce2e06
Loading