Skip to content
  1. Nov 14, 2009
  2. Oct 14, 2009
  3. Sep 22, 2009
    • Douglas Gregor's avatar
      Replace the -code-completion-dump option with · ea9b03e6
      Douglas Gregor authored
        -code-completion-at=filename:line:column
      
      which performs code completion at the specified location by truncating
      the file at that position and enabling code completion. This approach
      makes it possible to run multiple tests from a single test file, and
      gives a more natural command-line interface.
      
      llvm-svn: 82571
      ea9b03e6
  4. Sep 21, 2009
  5. Sep 17, 2009
    • Douglas Gregor's avatar
      Initial implementation of a code-completion interface in Clang. In · 2436e711
      Douglas Gregor authored
      essence, code completion is triggered by a magic "code completion"
      token produced by the lexer [*], which the parser recognizes at
      certain points in the grammar. The parser then calls into the Action
      object with the appropriate CodeCompletionXXX action.
      
      Sema implements the CodeCompletionXXX callbacks by performing minimal
      translation, then forwarding them to a CodeCompletionConsumer
      subclass, which uses the results of semantic analysis to provide
      code-completion results. At present, only a single, "printing" code
      completion consumer is available, for regression testing and
      debugging. However, the design is meant to permit other
      code-completion consumers.
      
      This initial commit contains two code-completion actions: one for
      member access, e.g., "x." or "p->", and one for
      nested-name-specifiers, e.g., "std::". More code-completion actions
      will follow, along with improved gathering of code-completion results
      for the various contexts.
      
      [*] In the current -code-completion-dump testing/debugging mode, the
      file is truncated at the completion point and EOF is translated into
      "code completion".
      
      llvm-svn: 82166
      2436e711
  6. Sep 09, 2009
  7. Jul 07, 2009
  8. Jul 02, 2009
    • Douglas Gregor's avatar
      Add support for retrieving the Doxygen comment associated with a given · c6d5edd2
      Douglas Gregor authored
      declaration in the AST. 
      
      The new ASTContext::getCommentForDecl function searches for a comment
      that is attached to the given declaration, and returns that comment, 
      which may be composed of several comment blocks.
      
      Comments are always available in an AST. However, to avoid harming
      performance, we don't actually parse the comments. Rather, we keep the
      source ranges of all of the comments within a large, sorted vector,
      then lazily extract comments via a binary search in that vector only
      when needed (which never occurs in a "normal" compile).
      
      Comments are written to a precompiled header/AST file as a blob of
      source ranges. That blob is only lazily loaded when one requests a
      comment for a declaration (this never occurs in a "normal" compile). 
      
      The indexer testbed now supports comment extraction. When the
      -point-at location points to a declaration with a Doxygen-style
      comment, the indexer testbed prints the associated comment
      block(s). See test/Index/comments.c for an example.
      
      Some notes:
        - We don't actually attempt to parse the comment blocks themselves,
        beyond identifying them as Doxygen comment blocks to associate them
        with a declaration.
        - We won't find comment blocks that aren't adjacent to the
        declaration, because we start our search based on the location of
        the declaration.
        - We don't go through the necessary hops to find, for example,
        whether some redeclaration of a declaration has comments when our
        current declaration does not. Similarly, we don't attempt to
        associate a \param Foo marker in a function body comment with the
        parameter named Foo (although that is certainly possible).
        - Verification of my "no performance impact" claims is still "to be
        done".
      
      llvm-svn: 74704
      c6d5edd2
  9. Jun 23, 2009
  10. May 13, 2009
  11. Apr 28, 2009
    • Eli Friedman's avatar
      Get rid of some useless uses of NoExtensions. The philosophy here is · 5d72d411
      Eli Friedman authored
      that if we're going to print an extension warning anyway, 
      there's no point to changing behavior based on NoExtensions: it will 
      only make error recovery worse.
      
      Note that this doesn't cause any behavior change because NoExtensions 
      isn't used by the current front-end.  I'm still considering what to do about
      the remaining use of NoExtensions in IdentifierTable.cpp.
      
      llvm-svn: 70273
      5d72d411
  12. Apr 24, 2009
  13. Apr 19, 2009
  14. Apr 18, 2009
  15. Apr 15, 2009
    • Chris Lattner's avatar
      Change Lexer::MeasureTokenLength to take a LangOptions reference. · 184e65d3
      Chris Lattner authored
      This allows it to accurately measure tokens, so that we get:
      
      t.cpp:8:13: error: unknown type name 'X'
      static foo::X  P;
             ~~~~~^
      
      instead of the woefully inferior:
      
      t.cpp:8:13: error: unknown type name 'X'
      static foo::X  P;
             ~~~~ ^
      
      Most of this is just plumbing to push the reference around.
      
      llvm-svn: 69099
      184e65d3
  16. Apr 05, 2009
  17. Apr 02, 2009
  18. Mar 18, 2009
  19. Mar 08, 2009
  20. Feb 19, 2009
    • Chris Lattner's avatar
      fix PR3609, emit: · 91668def
      Chris Lattner authored
      t.c:1:10: error: missing terminating '>' character
      #include <stdio.h
               ^
      
      instead of:
      
      t.c:1:10: error: missing terminating " character
      #include <stdio.h
               ^
      
      llvm-svn: 65052
      91668def
  21. Feb 15, 2009
    • Chris Lattner's avatar
      track "just a little more" location information for macro instantiations. · 9dc9c206
      Chris Lattner authored
      Now instead of just tracking the expansion history, also track the full
      range of the macro that got replaced.  For object-like macros, this doesn't
      change anything.  For _Pragma and function-like macros, this means we track
      the locations of the ')'.
      
      This is required for PR3579 because apparently GCC uses the line of the ')'
      of a function-like macro as the location to expand __LINE__ to.
      
      llvm-svn: 64601
      9dc9c206
  22. Jan 29, 2009
  23. Jan 27, 2009
  24. Jan 26, 2009
  25. Jan 23, 2009
    • Chris Lattner's avatar
      This is a follow-up to r62675: · 1f6c7fe6
      Chris Lattner authored
      Refactor how the preprocessor changes a token from being an tok::identifier to a 
      keyword (e.g. tok::kw_for).  Instead of doing this in HandleIdentifier, hoist this
      common case out into the caller, so that every keyword doesn't have to go through
      HandleIdentifier.  This drops time in HandleIdentifier from 1.25ms to .62ms, and
      speeds up clang -Eonly with PTH by about 1%.
      
      llvm-svn: 62855
      1f6c7fe6
  26. Jan 21, 2009
  27. Jan 19, 2009
  28. Jan 17, 2009
Loading