Skip to content
  1. Jan 05, 2009
    • Douglas Gregor's avatar
      Introduce support for "transparent" DeclContexts, which are · 07665a69
      Douglas Gregor authored
      DeclContexts whose members are visible from enclosing DeclContexts up
      to (and including) the innermost enclosing non-transparent
      DeclContexts. Transparent DeclContexts unify the mechanism to be used
      for various language features, including C enumerations, anonymous
      unions, C++0x inline namespaces, and C++ linkage
      specifications. Please refer to the documentation in the Clang
      internals manual for more information.
      
      Only enumerations and linkage specifications currently use transparent
      DeclContexts.
      
      Still to do: use transparent DeclContexts to implement anonymous
      unions and GCC's anonymous structs extension, and, later, the C++0x
      features. We also need to tighten up the DeclContext/ScopedDecl link
      to ensure that every ScopedDecl is in a single DeclContext, which
      will ensure that we can then enforce ownership and reduce the memory
      footprint of DeclContext.
      
      llvm-svn: 61735
      07665a69
  2. Dec 30, 2008
  3. Dec 26, 2008
  4. Dec 24, 2008
    • Douglas Gregor's avatar
      Correct the order in which we cope with end-of-class-definition · 58354036
      Douglas Gregor authored
      semantics and improve our handling of default arguments. Specifically,
      we follow this order:
      
        - As soon as the see the '}' in the class definition, the class is
        complete and we add any implicit declarations (default constructor,
        copy constructor, etc.) to the class.
        - If there are any default function arguments, parse them
        - If there were any inline member function definitions, parse them
      
      As part of this change, we now keep track of the the fact that we've
      seen unparsed default function arguments within the AST. See the new
      ParmVarDecl::hasUnparsedDefaultArg member. This allows us to properly
      cope with calls inside default function arguments to other functions
      where we're making use of the default arguments.
      
      Made some C++ error messages regarding failed initializations more
      specific. 
      
      llvm-svn: 61406
      58354036
  5. Dec 23, 2008
    • 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
  6. Dec 22, 2008
  7. Dec 19, 2008
  8. Dec 17, 2008
  9. Dec 16, 2008
  10. Dec 15, 2008
  11. Dec 13, 2008
  12. Dec 12, 2008
  13. Dec 11, 2008
    • Douglas Gregor's avatar
      7a4fad1b
    • 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
  14. Dec 06, 2008
  15. Nov 24, 2008
  16. Nov 23, 2008
    • Chris Lattner's avatar
      Convert IdentifierInfo's to be printed the same as DeclarationNames · e3d20d95
      Chris Lattner authored
      with implicit quotes around them.  This has a bunch of follow-on 
      effects and requires tweaking to a whole lot of code.  This causes
      a regression in two tests (xfailed) by causing it to emit things like:
      
        Line 10: duplicate interface declaration for category 'MyClass1' ('Category1')
      
      instead of:
      
        Line 10: duplicate interface declaration for category 'MyClass1(Category1)'
      
      I will fix this in a follow-up commit.
      
      As part of this, I had to start switching stuff to use ->getDeclName() instead
      of Decl::getName() for consistency.  This is good, but I was planning to do this
      as an independent patch.  There will be several follow-on patches
      to clean up some of the mess, but this patch is already too big.
      
      llvm-svn: 59917
      e3d20d95
  17. Nov 22, 2008
  18. Nov 21, 2008
    • Chris Lattner's avatar
      merge 3 more diagnostics into 1. · c5bab9f3
      Chris Lattner authored
      llvm-svn: 59805
      c5bab9f3
    • Chris Lattner's avatar
      Add the concept of "modifiers" to the clang diagnostic format · 2b78690a
      Chris Lattner authored
      strings.  This allows us to have considerable flexibility in how
      these things are displayed and provides extra information that
      allows us to merge away diagnostics that are very similar.
      
      Diagnostic modifiers are a string of characters with the regex
      [-a-z]+ that occur between the % and digit.  They may 
      optionally have an argument that can parameterize them.
      
      For now, I've added two example modifiers.  One is a very useful
      tool that allows you to factor commonality across diagnostics
      that need single words or phrases combined.  Basically you can
      use %select{a|b|c}4 with with an integer argument that selects
      either a/b/c based on an integer value in the range [0..3).
      
      The second modifier is also an integer modifier, aimed to help
      English diagnostics handle plurality.  "%s3" prints to 's' if 
      integer argument #3 is not 1, otherwise it prints to nothing.
      I'm fully aware that 's' is an English concept and doesn't
      apply to all situations (mouse vs mice).  However, this is very
      useful and we can add other crazy modifiers once we add support
      for polish! ;-)
      
      I converted a couple C++ diagnostics over to use this as an
      example, I'd appreciate it if others could merge the other
      likely candiates.  If you have other modifiers that you want,
      lets talk on cfe-dev.
      
      llvm-svn: 59803
      2b78690a
    • Douglas Gregor's avatar
      Don't print canonical types in overloading-related diagnostics · 4fc308bd
      Douglas Gregor authored
      llvm-svn: 59789
      4fc308bd
  19. Nov 20, 2008
  20. Nov 19, 2008
  21. Nov 18, 2008
  22. Nov 17, 2008
Loading