Skip to content
  1. May 30, 2007
    • Steve Naroff's avatar
      Bug #: · 9992bbab
      Steve Naroff authored
      Submitted by:
      Reviewed by:
      - ParseForStatement(): Put back a test/assignment. My removal of
      ParseExprStmt() was a bit over zealous:-(thanks to Chris for pointing it out)
      - Add assert to VisitDeclStmt().
      - Removed an out-of-date FIXME
      - Added some curlies for a couple multi-line calls to Diag().
      
      llvm-svn: 39528
      9992bbab
    • Bill Wendling's avatar
      Submitted by: Bill Wendling · 216423bb
      Bill Wendling authored
      Comment format changes.
      
      llvm-svn: 39527
      216423bb
    • Steve Naroff's avatar
      Bug #: · 56faab2d
      Steve Naroff authored
      Submitted by:
      Reviewed by:
      - Many tweaks to various diagnostics.
      - Fixed some location/range issues.
      - Bug fix to Sema::ParseDeclStmt() - error return code is "true", not 0.
      
      llvm-svn: 39526
      56faab2d
    • Bill Wendling's avatar
      Submitted by: Bill Wendling · 44470834
      Bill Wendling authored
      - Conjugate "diagnostic" correctly for 1 diagnostic.
      
      llvm-svn: 39525
      44470834
    • Chris Lattner's avatar
      Implement codegen support for labels and gotos. We now compile: · ac24820f
      Chris Lattner authored
      void test1() {
        foo:
          goto foo;
          goto foo;
          goto foo;
      }
      
      void test() {
        goto l;
      
      l:
        ;
      }
      into:
      
      define void @test1() {
      entry:
              br label %foo
      
      foo:            ; preds = %0, %foo, %entry
              br label %foo
                      ; No predecessors!
              br label %foo
                      ; No predecessors!
      }
      
      define void @test() {
      entry:
              br label %l
      
      l:              ; preds = %entry
      }
      
      llvm-svn: 39524
      ac24820f
    • Steve Naroff's avatar
      Bug #: · eb9da94d
      Steve Naroff authored
      Submitted by:
      Reviewed by:
      Unified the diagnostics for function calls. Since we have range support,
      there is no need for including the argument number. Instead, I've made
      the diags more expressive by including more type info.
      
      Also improved the indentation of many calls to Diag (which can be 2-3
      lines now).
      
      llvm-svn: 39523
      eb9da94d
    • Chris Lattner's avatar
      308f4310
    • Chris Lattner's avatar
      Don't print billions of spaces for a label with no indent. · d5322cd2
      Chris Lattner authored
      llvm-svn: 39521
      d5322cd2
    • Chris Lattner's avatar
      add accessors. · da8a4f46
      Chris Lattner authored
      llvm-svn: 39520
      da8a4f46
    • 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
Loading