Skip to content
  1. 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
    • Sebastian Redl's avatar
    • Sebastian Redl's avatar
      Implement dereferencing of pointers-to-member. · 112a9766
      Sebastian Redl authored
      llvm-svn: 63983
      112a9766
  2. Feb 06, 2009
  3. Feb 05, 2009
  4. Feb 04, 2009
  5. Feb 03, 2009
  6. Feb 02, 2009
  7. Jan 31, 2009
  8. Jan 30, 2009
    • Douglas Gregor's avatar
      Upgrade the "excess elements in array initializer" warning to an · d42a0fb4
      Douglas Gregor authored
      error, since both C99 and C++ consider it an error. For reference, GCC
      makes this a warning while G++ makes it an error.
      
      llvm-svn: 63435
      d42a0fb4
    • Douglas Gregor's avatar
      Implement and test aggregate initialization in C++. Major changes: · d14247a9
      Douglas Gregor authored
        - Support initialization of reference members; complain if any
        reference members are left uninitialized.
        - Use C++ copy-initialization for initializing each element (falls
        back to constraint checking in C)
        - Make sure we diagnose when one tries to provide an initializer
        list for a non-aggregate.
        - Don't complain about empty initializers in C++ (they are permitted)
        - Unrelated but necessary: don't bother trying to convert the
        decl-specifier-seq to a type when we're dealing with a C++
        constructor, destructor, or conversion operator; it results in
        spurious warnings.
      
      llvm-svn: 63431
      d14247a9
    • Douglas Gregor's avatar
      Switch Type::isAggregateType to use the C++ definition of "aggregate · ddb2485e
      Douglas Gregor authored
      type" rather than the C definition. We do this because both C99 and
      Clang always use "aggregate type" as "aggregate or union type", and
      the C++ definition includes union types.
      
      llvm-svn: 63395
      ddb2485e
    • Douglas Gregor's avatar
      Eliminated LookupCriteria, whose creation was causing a bottleneck for · ed8f2887
      Douglas Gregor authored
      LookupName et al. Instead, use an enum and a bool to describe its
      contents.
      
      Optimized the C/Objective-C path through LookupName, eliminating any
      unnecessarily C++isms. Simplify IdentifierResolver::iterator, removing
      some code and arguments that are no longer used.
      
      Eliminated LookupDeclInScope/LookupDeclInContext, moving all callers
      over to LookupName, LookupQualifiedName, or LookupParsedName, as
      appropriate.
      
      All together, I'm seeing a 0.2% speedup on Cocoa.h with PTH and
      -disable-free. Plus, we're down to three name-lookup routines.
      
      llvm-svn: 63354
      ed8f2887
Loading