Skip to content
  1. Aug 15, 2009
  2. Aug 14, 2009
  3. Aug 08, 2009
  4. Aug 05, 2009
  5. Aug 04, 2009
  6. Jul 29, 2009
  7. Jul 27, 2009
  8. Jul 24, 2009
  9. Jul 21, 2009
  10. Jul 18, 2009
  11. Jul 17, 2009
  12. Jul 14, 2009
    • Steve Naroff's avatar
      Add a "TypeSpecStartLoc" to FieldDecl. Patch contributed by Enea Zaffanella. · 5ec6ff76
      Steve Naroff authored
      Note: One day, it might be useful to consider adding this info to DeclGroup (as the comments in FunctionDecl/VarDecl suggest). For now, I think this works fine. I considered moving this to ValueDecl (a common ancestor of FunctionDecl/VarDecl/FieldDecl), however this would add overhead to EnumConstantDecl (which would burn memory and isn't necessary).
      llvm-svn: 75635
      5ec6ff76
  13. Jul 02, 2009
    • Douglas Gregor's avatar
      Keep track of more information within the template instantiation stack, e.g., · ff6cbdf8
      Douglas Gregor authored
      by distinguishing between substitution that occurs for template
      argument deduction vs. explicitly-specifiad template arguments. This
      is used both to improve diagnostics and to make sure we only provide
      SFINAE in those cases where SFINAE should apply.
      
      In addition, deal with the sticky issue where SFINAE only considers
      substitution of template arguments into the *type* of a function
      template; we need to issue hard errors beyond this point, as
      test/SemaTemplate/operator-template.cpp illustrates.
      
      llvm-svn: 74651
      ff6cbdf8
  14. Jun 30, 2009
    • Douglas Gregor's avatar
      When recursively instantiating function templates, keep track of the · dda7ced3
      Douglas Gregor authored
      instantiation stack so that we provide a full instantiation
      backtrace. Previously, we performed all of the instantiations implied
      by the recursion, but each looked like a "top-level" instantiation.
      
      The included test case tests the previous fix for the instantiation of
      DeclRefExprs. Note that the "instantiated from" diagnostics still
      don't tell us which template arguments we're instantiating with.
      
      llvm-svn: 74540
      dda7ced3
    • Douglas Gregor's avatar
      Refactor ActOnDeclarationNameExpr into a "parsing action" part and a · 3256d04d
      Douglas Gregor authored
      "semantic analysis" part. Use the "semantic analysis" part when
      performing template instantiation on a DeclRefExpr, rather than an ad
      hoc list of rules to construct DeclRefExprs from the instantiation.
      
      A test case for this change will come in with a large commit, which
      illustrates what I was actually trying to work on.
      
      llvm-svn: 74528
      3256d04d
    • Argyrios Kyrtzidis's avatar
      De-ASTContext-ify DeclContext. · cfbfe78e
      Argyrios Kyrtzidis authored
      Remove ASTContext parameter from DeclContext's methods. This change cascaded down to other Decl's methods and changes to call sites started "escalating".
      Timings using pre-tokenized "cocoa.h" showed only a ~1% increase in time run between and after this commit.
      
      llvm-svn: 74506
      cfbfe78e
    • Argyrios Kyrtzidis's avatar
      Remove the ASTContext parameter from the getBody() methods of Decl and subclasses. · ddcd132a
      Argyrios Kyrtzidis authored
      Timings showed no significant difference before and after the commit.
      
      llvm-svn: 74504
      ddcd132a
  15. Jun 29, 2009
  16. Jun 26, 2009
    • Douglas Gregor's avatar
      Implicit instantiation for function template specializations. · 4adbc6d9
      Douglas Gregor authored
      For a FunctionDecl that has been instantiated due to template argument
      deduction, we now store the primary template from which it was
      instantiated and the deduced template arguments. From this
      information, we can instantiate the body of the function template.
      
      llvm-svn: 74232
      4adbc6d9
    • Douglas Gregor's avatar
      Improved semantic analysis and AST respresentation for function · ad3f2fcf
      Douglas Gregor authored
      templates.
      
      For example, this now type-checks (but does not instantiate the body
      of deref<int>):
      
        template<typename T> T& deref(T* t) { return *t; }
      
        void test(int *ip) {
          int &ir = deref(ip);
        }
      
      Specific changes/additions:
        * Template argument deduction from a call to a function template.
        * Instantiation of a function template specializations (just the
        declarations) from the template arguments deduced from a call.
        * FunctionTemplateDecls are stored directly in declaration contexts
        and found via name lookup (all forms), rather than finding the
        FunctionDecl and then realizing it is a template. This is
        responsible for most of the churn, since some of the core
        declaration matching and lookup code assumes that all functions are
        FunctionDecls.
      
      llvm-svn: 74213
      ad3f2fcf
  17. Jun 23, 2009
  18. Jun 22, 2009
    • Douglas Gregor's avatar
      Rework the way we track which declarations are "used" during · 0b6a6242
      Douglas Gregor authored
      compilation, and (hopefully) introduce RAII objects for changing the
      "potentially evaluated" state at all of the necessary places within
      Sema and Parser. Other changes:
      
        - Set the unevaluated/potentially-evaluated context appropriately
          during template instantiation.
        - We now recognize three different states while parsing or
          instantiating expressions: unevaluated, potentially evaluated, and
          potentially potentially evaluated (for C++'s typeid).
        - When we're in a potentially potentially-evaluated context, queue
          up MarkDeclarationReferenced calls in a stack. For C++ typeid
          expressions that are potentially evaluated, we will play back
          these MarkDeclarationReferenced calls when we exit the
          corresponding potentially potentially-evaluated context.
        - Non-type template arguments are now parsed as constant
          expressions, so they are not potentially-evaluated.
      
      llvm-svn: 73899
      0b6a6242
  19. May 29, 2009
  20. May 28, 2009
    • Douglas Gregor's avatar
      Introduced DeclContext::isDependentContext, which determines whether a · 9e927abc
      Douglas Gregor authored
      given DeclContext is dependent on type parameters. Use this to
      properly determine whether a TagDecl is dependent; previously, we were
      missing the case where the TagDecl is a local class of a member
      function of a class template (phew!).
      
      Also, make sure that, when we instantiate declarations within a member
      function of a class template (or a function template, eventually),
      that we add those declarations to the "instantiated locals" map so
      that they can be found when instantiating declaration references.
      
      Unfortunately, I was not able to write a useful test for this change,
      although the assert() that fires when uncommenting the FIXME'd line in
      test/SemaTemplate/instantiate-declref.cpp tells the "experienced user"
      that we're now doing the right thing.
      
      llvm-svn: 72526
      9e927abc
  21. May 27, 2009
    • Douglas Gregor's avatar
      Simplify, and improve the performance of, template instantiation for · cd3a0979
      Douglas Gregor authored
      declaration references. The key realization is that dependent Decls,
      which actually require instantiation, can only refer to the current
      instantiation or members thereof. And, since the current context
      during instantiation contains all of those members of the current
      instantiation, we can simply find the real instantiate that matches up
      with the "current instantiation" template.
      
      llvm-svn: 72486
      cd3a0979
    • Douglas Gregor's avatar
      Enumeration declarations that were instantiated from an enumeration · 7a74938f
      Douglas Gregor authored
      within a template now have a link back to the enumeration from which
      they were instantiated. This means that we can now find the
      instantiation of an anonymous enumeration.
      
      llvm-svn: 72482
      7a74938f
    • Douglas Gregor's avatar
      Improve name lookup for and template instantiation of declaration · f98d9b60
      Douglas Gregor authored
      references. There are several smallish fixes here:
      
        - Make sure we look through template parameter scope when
          determining whether we're parsing a nested class (or nested class
          *template*). This makes sure that we delay parsing the bodies of
          inline member functions until after we're out of the outermost
          class (template) scope.
        - Since the bodies of member functions are always parsed
          "out-of-line", even when they were declared in-line, teach
          unqualified name lookup to look into the (semantic) parents.
        - Use the new InstantiateDeclRef to handle the instantiation of a
          reference to a declaration (in DeclRefExpr), which drastically
          simplifies template instantiation for DeclRefExprs.
        - When we're instantiating a ParmVarDecl, it must be in the current
          instantiation scope, so only look there.
      
      Also, remove the #if 0's and FIXME's from the dynarray example, which
      now compiles and executes thanks to Anders and Eli.
      
      llvm-svn: 72481
      f98d9b60
    • Douglas Gregor's avatar
      Initial stab at a generalized operation for determining the · 51783313
      Douglas Gregor authored
      instantiation of a declaration from the template version (or version
      that lives in a template) and a given set of template arguments. This
      needs much, much more testing, but it suffices for simple examples
      like
      
        typedef T* iterator;
        iterator begin();
      
      llvm-svn: 72461
      51783313
  22. May 26, 2009
  23. May 21, 2009
  24. May 18, 2009
  25. May 16, 2009
  26. May 15, 2009
Loading