Skip to content
  1. Jan 29, 2009
  2. Jan 28, 2009
  3. Jan 27, 2009
  4. Jan 25, 2009
  5. Jan 20, 2009
    • 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
  6. Jan 19, 2009
  7. Jan 18, 2009
  8. Jan 16, 2009
  9. Jan 14, 2009
    • Douglas Gregor's avatar
      Refactor name lookup. · 34074326
      Douglas Gregor authored
      This change refactors and cleans up our handling of name lookup with
      LookupDecl. There are several aspects to this refactoring:
      
        - The criteria for name lookup is now encapsulated into the class
        LookupCriteria, which replaces the hideous set of boolean values
        that LookupDecl currently has.
      
        - The results of name lookup are returned in a new class
        LookupResult, which can lazily build OverloadedFunctionDecls for
        overloaded function sets (and, eventually, eliminate the need to
        allocate member for OverloadedFunctionDecls) and contains a
        placeholder for handling ambiguous name lookup (for C++).
      
        - The primary entry points for name lookup are now LookupName (for
          unqualified name lookup) and LookupQualifiedName (for qualified
          name lookup). There is also a convenience function
          LookupParsedName that handles qualified/unqualified name lookup
          when given a scope specifier. Together, these routines are meant
          to gradually replace the kludgy LookupDecl, but this won't happen
          until after we have base class lookup (which forces us to cope
          with ambiguities).
      
        - Documented the heck out of name lookup. Experimenting a little
          with using Doxygen's member groups to make some sense of the Sema
          class. Feedback welcome!
      
        - Fixes some lingering issues with name lookup for
        nested-name-specifiers, which now goes through
        LookupName/LookupQualifiedName. 
      
      llvm-svn: 62245
      34074326
    • Douglas Gregor's avatar
      Introduce support for C++0x explicit conversion operators (N2437) · 5fb53972
      Douglas Gregor authored
      Small cleanup in the handling of user-defined conversions. 
      
      Also, implement an optimization when constructing a call. We avoid
      recomputing implicit conversion sequences and instead use those
      conversion sequences that we computed as part of overload resolution.
      
      llvm-svn: 62231
      5fb53972
    • Ted Kremenek's avatar
      FunctionDecl::setParams() now uses the allocator associated with ASTContext to... · 4ba36fcc
      Ted Kremenek authored
      FunctionDecl::setParams() now uses the allocator associated with ASTContext to allocate the array of ParmVarDecl*'s.
      
      llvm-svn: 62203
      4ba36fcc
  10. Jan 13, 2009
  11. Jan 08, 2009
    • Steve Naroff's avatar
      This is a large/messy diff that unifies the ObjC AST's with DeclContext. · 35c62ae6
      Steve Naroff authored
      - ObjCContainerDecl's (ObjCInterfaceDecl/ObjCCategoryDecl/ObjCProtocolDecl), ObjCCategoryImpl, & ObjCImplementation are all DeclContexts.
      - ObjCMethodDecl is now a ScopedDecl (so it can play nicely with DeclContext).
      - ObjCContainerDecl now does iteration/lookup using DeclContext infrastructure (no more linear search:-)
      - Removed ASTContext argument to DeclContext::lookup(). It wasn't being used and complicated it's use from an ObjC AST perspective.
      - Added Sema::ProcessPropertyDecl() and removed Sema::diagnosePropertySetterGetterMismatch().
      - Simplified Sema::ActOnAtEnd() considerably. Still more work to do.
      - Fixed an incorrect casting assumption in Sema::getCurFunctionOrMethodDecl(), now that ObjCMethodDecl is a ScopedDecl.
      - Removed addPropertyMethods from ObjCInterfaceDecl/ObjCCategoryDecl/ObjCProtocolDecl.
      
      This passes all the tests on my machine. Since many of the changes are central to the way ObjC finds it's methods, I expect some fallout (and there are still a handful of FIXME's). Nevertheless, this should be a step in the right direction.
      
      llvm-svn: 61929
      35c62ae6
  12. Jan 05, 2009
    • Sebastian Redl's avatar
      PODness and Type Traits · baad4e76
      Sebastian Redl authored
      Make C++ classes track the POD property (C++ [class]p4)
      Track the existence of a copy assignment operator.
      Implicitly declare the copy assignment operator if none is provided.
      Implement most of the parsing job for the G++ type traits extension.
      Fully implement the low-hanging fruit of the type traits:
      __is_pod: Whether a type is a POD.
      __is_class: Whether a type is a (non-union) class.
      __is_union: Whether a type is a union.
      __is_enum: Whether a type is an enum.
      __is_polymorphic: Whether a type is polymorphic (C++ [class.virtual]p1).
      
      llvm-svn: 61746
      baad4e76
  13. Dec 23, 2008
    • Douglas Gregor's avatar
      Fix misguided type selection · 17eb26bc
      Douglas Gregor authored
      llvm-svn: 61393
      17eb26bc
    • Douglas Gregor's avatar
      Don't push OverloadedFunctionDecls onto the chain of declarations · 8b9ccca5
      Douglas Gregor authored
      attached to an identifier. Instead, all overloaded functions will be
      pushed into scope, and we'll synthesize an OverloadedFunctionDecl on
      the fly when we need it. 
      
      llvm-svn: 61386
      8b9ccca5
    • Douglas Gregor's avatar
      Don't explicitly represent OverloadedFunctionDecls within · 55297ac4
      Douglas Gregor authored
      DeclContext. Instead, just keep the list of currently-active
      declarations and only build the OverloadedFunctionDecl when we
      absolutely need it.
      
      This is a half-step toward eliminating the need to explicitly build
      OverloadedFunctionDecls that store sets of overloaded
      functions. This was suggested by Argiris a while back, and it's a good
      thing for several reasons: first, it eliminates the messy logic that
      currently tries to keep the OverloadedFunctionDecl in sync with the 
      declarations that are being added. Second, it will (eventually)
      eliminate the need to allocate memory for overload sets, which could
      help performance. Finally, it helps set us up for when name lookup can
      return multiple (possibly ambiguous) results, as can happen with
      lookup of class members in C++.
      
      Next steps: make the IdentifierResolver store overloads as separate
      entries in its list rather than replacing them with an
      OverloadedFunctionDecl now, then see how far we can go toward
      eliminating OverloadedFunctionDecl entirely.
      
      llvm-svn: 61357
      55297ac4
  14. Dec 19, 2008
  15. Dec 13, 2008
  16. Dec 11, 2008
    • Douglas Gregor's avatar
      Unifies the name-lookup mechanisms used in various parts of the AST · 91f84216
      Douglas Gregor authored
      and separates lexical name lookup from qualified name lookup. In
      particular:
        * Make DeclContext the central data structure for storing and
          looking up declarations within existing declarations, e.g., members
          of structs/unions/classes, enumerators in C++0x enums, members of
          C++ namespaces, and (later) members of Objective-C
          interfaces/implementations. DeclContext uses a lazily-constructed
          data structure optimized for fast lookup (array for small contexts,
          hash table for larger contexts). 
      
        * Implement C++ qualified name lookup in terms of lookup into
          DeclContext.
      
        * Implement C++ unqualified name lookup in terms of
          qualified+unqualified name lookup (since unqualified lookup is not
          purely lexical in C++!)
      
        * Limit the use of the chains of declarations stored in
          IdentifierInfo to those names declared lexically.
      
        * Eliminate CXXFieldDecl, collapsing its behavior into
          FieldDecl. (FieldDecl is now a ScopedDecl).
      
        * Make RecordDecl into a DeclContext and eliminates its
          Members/NumMembers fields (since one can just iterate through the
          DeclContext to get the fields).
      
      llvm-svn: 60878
      91f84216
    • Douglas Gregor's avatar
      Added a warning when referencing an if's condition variable in the · 85970ca8
      Douglas Gregor authored
      "else" clause, e.g.,
      
        if (int X = foo()) {
        } else {
          if (X) { // warning: X is always zero in this context
          }
        }
      
      Fixes rdar://6425550 and lets me think about something other than
      DeclContext.
      
      llvm-svn: 60858
      85970ca8
  17. Dec 06, 2008
    • Douglas Gregor's avatar
      Introduce basic support for dependent types, type-dependent · 4619e439
      Douglas Gregor authored
      expressions, and value-dependent expressions. This permits us to parse
      some template definitions.
      
      This is not a complete solution; we're missing type- and
      value-dependent computations for most of the expression types, and
      we're missing checks for dependent types and type-dependent
      expressions throughout Sema.
      
      llvm-svn: 60615
      4619e439
  18. Dec 04, 2008
  19. Dec 03, 2008
  20. Dec 02, 2008
  21. Nov 24, 2008
  22. Nov 21, 2008
  23. Nov 20, 2008
  24. Nov 19, 2008
  25. Nov 18, 2008
    • Douglas Gregor's avatar
      As threatened previously: consolidate name lookup and the creation of · 4ea8043d
      Douglas Gregor authored
      DeclRefExprs and BlockDeclRefExprs into a single function
      Sema::ActOnDeclarationNameExpr, eliminating a bunch of duplicate
      lookup-name-and-check-the-result code.
      
      Note that we still have the three parser entry points for identifiers,
      operator-function-ids, and conversion-function-ids, since the parser
      doesn't (and shouldn't) know about DeclarationNames. This is a Good
      Thing (TM), and there will be more entrypoints coming (e.g., for C++
      pseudo-destructor expressions).
      
      llvm-svn: 59527
      4ea8043d
    • Douglas Gregor's avatar
      Extend DeclarationName to support C++ overloaded operators, e.g., · 163c5850
      Douglas Gregor authored
      operator+, directly, using the same mechanism as all other special
      names.
      
      Removed the "special" identifiers for the overloaded operators from
      the identifier table and IdentifierInfo data structure. IdentifierInfo
      is back to representing only real identifiers.
      
      Added a new Action, ActOnOperatorFunctionIdExpr, that builds an
      expression from an parsed operator-function-id (e.g., "operator
      +"). ActOnIdentifierExpr used to do this job, but
      operator-function-ids are no longer represented by IdentifierInfo's.
      
      Extended Declarator to store overloaded operator names. 
      Sema::GetNameForDeclarator now knows how to turn the operator
      name into a DeclarationName for the overloaded operator. 
      
      Except for (perhaps) consolidating the functionality of
      ActOnIdentifier, ActOnOperatorFunctionIdExpr, and
      ActOnConversionFunctionExpr into a common routine that builds an
      appropriate DeclRefExpr by looking up a DeclarationName, all of the
      work on normalizing declaration names should be complete with this
      commit.
      
      llvm-svn: 59526
      163c5850
  26. Nov 17, 2008
    • Douglas Gregor's avatar
      Updated IdentifierResolver to deal with DeclarationNames. The names of · ae2fbad3
      Douglas Gregor authored
      C++ constructors, destructors, and conversion functions now have a
      FETokenInfo field that IdentifierResolver can access, so that these
      special names are handled just like ordinary identifiers. A few other
      Sema routines now use DeclarationNames instead of IdentifierInfo*'s.
      
      To validate this design, this code also implements parsing and
      semantic analysis for id-expressions that name conversion functions,
      e.g.,
      
        return operator bool();
      
      The new parser action ActOnConversionFunctionExpr takes the result of
      parsing "operator type-id" and turning it into an expression, using
      the IdentifierResolver with the DeclarationName of the conversion
      function. ActOnDeclarator pushes those conversion function names into
      scope so that the IdentifierResolver can find them, of course.
      
      llvm-svn: 59462
      ae2fbad3
  27. Nov 11, 2008
  28. Nov 10, 2008
Loading