Skip to content
Snippets Groups Projects
  1. Feb 11, 2016
  2. Feb 09, 2016
  3. Jun 23, 2015
  4. Jun 22, 2015
  5. May 17, 2015
    • Nico Weber's avatar
      Don't leak TemplateIds when a plugin parses late-parsed templates at TU end. · acb8cdf0
      Nico Weber authored
      In -fdelayed-template-parsing mode, templates that aren't used are not parsed
      at all.  For some diagnostic plugins, this is a problem since they want to
      analyse the contents of the template function body.  What has been suggested
      on cfe-dev [1] is to explicitly parse interesting templates in
      HandleTranslationUnit(); IWYU does this for example [2].
      
      This is workable, but since the delayed parsing doesn't run below a call to
      ParseTopLevelDecl(), no DestroyTemplateIdAnnotationsRAIIObj object is on the
      stack to clean up TemplateIds that are created during parsing.  To fix this,
      let ~Parser() clean them up in delayed template parsing mode instead of
      leaking (or asserting in +Assert builds).
      
      (r219810, relanded in r220400, fixed the same problem in incremental processing
      mode; the review thread of r219810 has a good discussion of the problem.)
      
      To test this, give the PrintFunctionNames plugin a flag to force parsing
      of a template and add a test that uses it in -fdelayed-template-parsing mode.
      Without the Parser.cpp change, that test asserts.
      
      1: http://lists.cs.uiuc.edu/pipermail/cfe-dev/2014-August/038415.html
      2: https://code.google.com/p/include-what-you-use/source/detail?r=566 
      
      
      git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@237531 91177308-0d34-0410-b5e6-96231b3b80d8
      acb8cdf0
  6. Apr 11, 2015
  7. Jan 23, 2015
  8. Aug 10, 2014
  9. Jul 18, 2014
  10. Jul 17, 2014
  11. Dec 21, 2013
  12. Dec 04, 2012
  13. Apr 26, 2012
  14. Nov 19, 2011
  15. Sep 27, 2011
  16. Aug 02, 2010
  17. Jul 26, 2010
  18. Jun 16, 2010
  19. Dec 12, 2009
  20. Nov 15, 2009
Loading