Skip to content
  1. Apr 13, 2009
  2. Apr 12, 2009
  3. Mar 29, 2009
    • Chris Lattner's avatar
      Push DeclGroup much farther throughout the compiler. Now the various · 5bbb3c8a
      Chris Lattner authored
      productions (except the already broken ObjC cases like @class X,Y;) in 
      the parser that can produce more than one Decl return a DeclGroup instead
      of a Decl, etc.
      
      This allows elimination of the Decl::NextDeclarator field, and exposes
      various clients that should look at all decls in a group, but which were
      only looking at one (such as the dumper, printer, etc).  These have been
      fixed.
      
      Still TODO:
      
      1) there are some FIXME's in the code about potentially using
      DeclGroup for better location info.
      2) ParseObjCAtDirectives should return a DeclGroup due to @class etc.
      3) I'm not sure what is going on with StmtIterator.cpp, or if it can
         be radically simplified now.
      4) I put a truly horrible hack in ParseTemplate.cpp.
      
      I plan to bring up #3/4 on the mailing list, but don't plan to tackle
      #1/2 in the short term.
      
      llvm-svn: 68002
      5bbb3c8a
  4. Mar 28, 2009
    • Chris Lattner's avatar
      Introduce a new OpaquePtr<N> struct type, which is a simple POD wrapper for a · 83f095cc
      Chris Lattner authored
      pointer.  Its purpose in life is to be a glorified void*, but which does not
      implicitly convert to void* or other OpaquePtr's with a different UID.
      
      Introduce Action::DeclPtrTy which is a typedef for OpaquePtr<0>.  Change the 
      entire parser/sema interface to use DeclPtrTy instead of DeclTy*.  This
      makes the C++ compiler enforce that these aren't convertible to other opaque
      types.
      
      We should also convert ExprTy, StmtTy, TypeTy, AttrTy, BaseTy, etc,
      but I don't plan to do that in the short term.
      
      The one outstanding known problem with this patch is that we lose the 
      bitmangling optimization where ActionResult<DeclPtrTy> doesn't know how to
      bitmangle the success bit into the low bit of DeclPtrTy.  I will rectify
      this with a subsequent patch.
      
      llvm-svn: 67952
      83f095cc
    • Chris Lattner's avatar
      rename some methods. · 529efc74
      Chris Lattner authored
      llvm-svn: 67923
      529efc74
  5. Mar 26, 2009
  6. Mar 13, 2009
  7. Mar 11, 2009
  8. Mar 04, 2009
    • Chris Lattner's avatar
      Change Parser::ParseCaseStatement to use an iterative approach to parsing · 34a22091
      Chris Lattner authored
      multiple sequential case statements instead of doing it with recursion.  This
      fixes a problem where we run out of stack space parsing 100K directly nested
      cases.
      
      There are a couple other problems that prevent this from being useful in 
      practice (right now the example only parses correctly with -disable-free and
      doesn't work with -emit-llvm), but this is a start.
      
      I'm not including a testcase because it is large and uninteresting for 
      regtesting.
      
      Sebastian, I would appreciate it if you could scrutinize the smart pointer 
      gymnastics I do.
      
      llvm-svn: 66011
      34a22091
    • Steve Naroff's avatar
      Change a warning to an error... · 013813dd
      Steve Naroff authored
      llvm-svn: 65978
      013813dd
  9. Mar 03, 2009
  10. Mar 01, 2009
  11. Feb 28, 2009
    • Steve Naroff's avatar
      Fix <rdar://problem/6451399> problems with labels and blocks. · d123bd05
      Steve Naroff authored
      - Move the 'LabelMap' from Sema to Scope. To avoid layering problems, the second element is now a 'StmtTy *', which makes the LabelMap a bit more verbose to deal with.
      - Add 'ActiveScope' to Sema. Managed by ActOnStartOfFunctionDef(), ObjCActOnStartOfMethodDef(), ActOnBlockStmtExpr().
      - Changed ActOnLabelStmt(), ActOnGotoStmt(), ActOnAddrLabel(), and ActOnFinishFunctionBody() to use the new ActiveScope.
      - Added FIXME to workaround in ActOnFinishFunctionBody() (for dealing with C++ nested functions).  
      
      llvm-svn: 65694
      d123bd05
  12. Feb 22, 2009
  13. Feb 14, 2009
    • Chris Lattner's avatar
      Several related changes: · 237f2757
      Chris Lattner authored
      1) implement parser and sema support for reading and verifying attribute(warnunusedresult).
      2) rename hasLocalSideEffect to isUnusedResultAWarning, inverting the sense
         of its result.
      3) extend isUnusedResultAWarning to directly return the loc and range 
         info that should be reported to the user.  Make it substantially more
         precise in some cases than what was previously reported.
      4) teach isUnusedResultAWarning about CallExpr to decls that are 
         pure/const/warnunusedresult, fixing a fixme.
      5) change warn_attribute_wrong_decl_type to not pass in english strings, instead,
         pass in integers and use %select.
      
      llvm-svn: 64543
      237f2757
  14. Feb 13, 2009
    • Douglas Gregor's avatar
      Remove DeclGroupOwningRef, since we intend for declarations to be owned · 4feb36de
      Douglas Gregor authored
      by DeclContexts (always) rather than by statements. 
      
      DeclContext currently goes out of its way to avoid destroying any
      Decls that might be owned by a DeclGroupOwningRef. However, in an
      error-recovery situation, a failure in a declaration statement can
      cause all of the decls in a DeclGroupOwningRef to be destroyed after
      they've already be added into the DeclContext. Hence, DeclContext is
      left with already-destroyed declarations, and bad things happen. This
      problem was causing failures that showed up as assertions on x86 Linux
      in test/Parser/objc-forcollection-neg-2.m.
      
      llvm-svn: 64474
      4feb36de
  15. Feb 12, 2009
  16. Feb 11, 2009
  17. Feb 07, 2009
    • Ted Kremenek's avatar
      Overhaul of Stmt allocation: · 5a201951
      Ted Kremenek authored
      - Made allocation of Stmt objects using vanilla new/delete a *compiler
        error* by making this new/delete "protected" within class Stmt.
      - Now the only way to allocate Stmt objects is by using the new
        operator that takes ASTContext& as an argument.  This ensures that
        all Stmt nodes are allocated from the same (pool) allocator.
      - Naturally, these two changes required that *all* creation sites for
        AST nodes use new (ASTContext&).  This is a large patch, but the
        majority of the changes are just this mechanical adjustment.
      - The above changes also mean that AST nodes can no longer be
        deallocated using 'delete'.  Instead, one most do
        StmtObject->Destroy(ASTContext&) or do
        ASTContextObject.Deallocate(StmtObject) (the latter not running the
        'Destroy' method).
      
      Along the way I also...
      - Made CompoundStmt allocate its array of Stmt* using the allocator in
        ASTContext (previously it used std::vector).  There are a whole
        bunch of other Stmt classes that need to be similarly changed to
        ensure that all memory allocated for ASTs comes from the allocator
        in ASTContext.
      - Added a new smart pointer ExprOwningPtr to Sema.h.  This replaces
        the uses of llvm::OwningPtr within Sema, as llvm::OwningPtr used
        'delete' to free memory instead of a Stmt's 'Destroy' method.
      
      Big thanks to Doug Gregor for helping with the acrobatics of making
      'new/delete' private and the new smart pointer ExprOwningPtr!
      
      llvm-svn: 63997
      5a201951
  18. Feb 04, 2009
  19. Jan 29, 2009
  20. Jan 27, 2009
  21. Jan 21, 2009
  22. Jan 20, 2009
    • Anders Carlsson's avatar
      224fca89
    • Douglas Gregor's avatar
      Remove ScopedDecl, collapsing all of its functionality into Decl, so · 6e6ad602
      Douglas Gregor authored
      that every declaration lives inside a DeclContext.
      
      Moved several things that don't have names but were ScopedDecls (and,
      therefore, NamedDecls) to inherit from Decl rather than NamedDecl,
      including ObjCImplementationDecl and LinkageSpecDecl. Now, we don't
      store empty DeclarationNames for these things, nor do we try to insert
      them into DeclContext's lookup structure.
      
      The serialization tests are temporarily disabled. We'll re-enable them
      once we've sorted out the remaining ownership/serialiazation issues
      between DeclContexts and TranslationUnion, DeclGroups, etc.
      
      llvm-svn: 62562
      6e6ad602
  23. Jan 18, 2009
Loading