Skip to content
  1. May 30, 2007
    • Chris Lattner's avatar
      d1af2d29
    • Steve Naroff's avatar
      Bug #: · 2a8ad18e
      Steve Naroff authored
      Submitted by:
      Reviewed by:
      Implement some FIXME's that stand in the way of fully typechecking "for"
      statements. This involved:
      
      - Adding a DeclStmt AST node (with statement visitor). The DeclStmt
      printer is preliminary.
      - Added a ParseDeclStmt action, called from Parser::ParseForStatement()
      and Parser::ParseStatementOrDeclaration(). DID NOT add to
      Parser::ParseIdentifierStatement()...probably could have, however didn't
      really understand the context of this rule (will speak with Chris).
      - Removed ParseExprStmt (and it's clients)...it was vestigial.
      
      llvm-svn: 39518
      2a8ad18e
  2. May 29, 2007
    • Steve Naroff's avatar
      Bug #: · 6f49f5df
      Steve Naroff authored
      Submitted by:
      Reviewed by:
      - Finished Sema::ParseReturnStmt(). Still need to tweak ranges.
      - Tweaked location for function arguments (they now point at the expression directly, no parens or commas).
      - Added InvalidOperands helper...was sick of looking at the same 3 lines in ~9 Check functions.
      - Added a few diags and moved a group of statement diags to the proper comment/category.
      
      llvm-svn: 39517
      6f49f5df
    • Chris Lattner's avatar
      Fix two bugs that fell out from a testcase steve noticed. for this testcase: · e64a1b52
      Chris Lattner authored
      extern int pintFunc(int *, int *);
      
      int test() {
        pintFunc(0,
                 3);
      }
      
      We now print:
      
      t3.c:4:13: warning: passing argument 2 makes pointer from integer without a cast
        pintFunc(0,
        ~~~~~~~~  ^
      
      instead of:
      
      t3.c:4:13: warning: passing argument 2 makes pointer from integer without a cast
        pintFunc(0,
        ~~~~~~~~
      
      llvm-svn: 39516
      e64a1b52
    • Steve Naroff's avatar
      Bug #: · 86272ea1
      Steve Naroff authored
      Submitted by:
      Reviewed by:
      Implement type checking for ParseDoStmt, ParseWhileStmt, ParseIfStmt, and
      ParseForStmt. ParseForStmt still under construction (contains a FIXME).
      
      llvm-svn: 39515
      86272ea1
  3. May 28, 2007
    • Steve Naroff's avatar
      Bug #: · 3c87a57a
      Steve Naroff authored
      Submitted by:
      Reviewed by:
      Add range support to Sema::CheckConditionalOperands().
      
      llvm-svn: 39514
      3c87a57a
    • Steve Naroff's avatar
      Bug #: · 8563f650
      Steve Naroff authored
      Submitted by:
      Reviewed by:
      Refine Sema::ParseCallExpr() diags (range support, add types).
      
      Before:
      
      func-assign.c:27:11: warning: passing argument 1 from incompatible pointer type
        pintFunc(&FOO);
                ^
      func-assign.c:28:12: error: incompatible type for argument 1
        floatFunc(&FOO);
                 ^
      func-assign.c:29:12: error: too many arguments to function
        floatFunc(1,2,3);
                 ^
      After:
      
      func-assign.c:27:11: warning: passing incompatible pointer 'struct foo *' to function expecting 'int *'
        pintFunc(&FOO);
        ~~~~~~~~^~~~~
      func-assign.c:28:12: error: passing incompatible type 'struct foo *' to function expecting 'float'
        floatFunc(&FOO);
        ~~~~~~~~~^~~~~
      func-assign.c:29:12: error: too many arguments to function
        floatFunc(1,2,3);
        ~~~~~~~~~^  ~
      
      llvm-svn: 39513
      8563f650
    • Steve Naroff's avatar
      Bug #: · 758ada12
      Steve Naroff authored
      Submitted by:
      Reviewed by:
      - Implement FIXME in Sema::CheckIndirectionOperand().
      - Added "const" to FunctionDecl::getResultType().
      
      llvm-svn: 39512
      758ada12
    • Chris Lattner's avatar
      Add a note about an unimplemented gnu extension. · 010015a1
      Chris Lattner authored
      llvm-svn: 39511
      010015a1
    • Chris Lattner's avatar
      eefa10e7
    • Chris Lattner's avatar
      Change GotoStmt's to have a pointer to the LabelStmt instead of a pointer to · e2473068
      Chris Lattner authored
      the label identifier.  Handle fwd references etc.  This allows us to detect
      uses of undefined labels and label redefinitions, such as:
      
      t.c:2:12: error: redefinition of label 'abc'
        abc: ;   abc:
                 ^
      t.c:2:3: error: previous definition is here
        abc: ;   abc:
        ^
      t.c:12:12: error: use of undeclared label 'hijl'
            goto hijl;
                 ^
      
      llvm-svn: 39509
      e2473068
    • Chris Lattner's avatar
      Improve the parsers resilience to sematic errors. This allows us to turn: · ac4471c9
      Chris Lattner authored
      void foo() {
        if (0) break;
        abc:
        def:
        hij:
          break;
      
      into:
      
      void foo() {
        if ((0)')
          ;
      abc:
      def:
      hij:
        ;
      
      instead of dropping the if and labels (due to break not being in a loop).
      
      llvm-svn: 39508
      ac4471c9
    • Chris Lattner's avatar
      2f6ac263
    • Chris Lattner's avatar
      add action for null stmt, create ast node. · 0f203a7c
      Chris Lattner authored
      llvm-svn: 39506
      0f203a7c
    • Chris Lattner's avatar
      add a NullStmt ast node. · 012a6cf1
      Chris Lattner authored
      llvm-svn: 39505
      012a6cf1
    • Chris Lattner's avatar
      Reorganize codegen files. · bed31446
      Chris Lattner authored
      llvm-svn: 39504
      bed31446
    • Chris Lattner's avatar
      Stop generating code after the first error is emitted. · 7a50aa98
      Chris Lattner authored
      llvm-svn: 39503
      7a50aa98
    • Chris Lattner's avatar
      track whether an error has been emitted. · c49b9051
      Chris Lattner authored
      llvm-svn: 39502
      c49b9051
    • Steve Naroff's avatar
      Bug #: · 9358c715
      Steve Naroff authored
      Submitted by:
      Reviewed by:
      - Added type checking to Sema::ParseReturnStmt (still under construction).
      - Improved Expr::isLvalue() and Expr::isModifiableLvalue() to return more
      info. Used the info in Sema::CheckAssignmentOperands() to produce more
      descriptive diagnostics. Added FIXME to other clients of isLvalue()/etc.
      - Added a SourceLocation slot to MemberExpr...changed the implementation
      of getSourceRange().
      - Added getResultType() helper to FunctionDecl.
      - Changed many Diag calls to use the SourceRange support (now that it's
      a big hit...we better milk it:-).
      
      llvm-svn: 39501
      9358c715
    • Bill Wendling's avatar
      Bug #: · c5fc5f19
      Bill Wendling authored
      Submitted by: Bill Wendling
      Reviewed by:
      
      - Can do just a 'cast<>()' because we're checking that it's Tagged.
      
      llvm-svn: 39500
      c5fc5f19
    • Bill Wendling's avatar
      Bug #: · 229f243f
      Bill Wendling authored
      Submitted by: Bill Wendling
      Reviewed by: Steve Naroff
      
      - Steve suggested avoiding the dyn_cast by using the "Tagged" type class
        and having the "default" just return false.
      
      llvm-svn: 39499
      229f243f
    • Bill Wendling's avatar
      Bug #: · 21862c3f
      Bill Wendling authored
      Submitted by: Bill Wendling
      Reviewed by: Chris Lattner
      
      - Rework the isDerivedType method so that if a language doesn't support
        references, it won't have to pay the price for them. This inlines the
        checks for derived types and turns it into a switch statement instead.
      
      llvm-svn: 39498
      21862c3f
  4. May 27, 2007
    • Bill Wendling's avatar
      Bug #: · 6811c0b5
      Bill Wendling authored
      Submitted by: Bill Wendling
      Reviewed by:
      
      C++ references testcase.
      
      llvm-svn: 39497
      6811c0b5
    • Bill Wendling's avatar
      Bug #: · 3708c185
      Bill Wendling authored
      Submitted by: Bill Wendling
      Reviewed by: Chris Lattner
      
      - Initial support for C++ references. Adding to the AST and Parser.
        Skeletal support added in the semantic analysis portion. Full semantic
        analysis is to be done soon.
      
      llvm-svn: 39496
      3708c185
  5. May 24, 2007
  6. 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
  7. 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
Loading