Skip to content
  1. Aug 17, 2010
  2. Aug 15, 2010
    • Douglas Gregor's avatar
      Extend the code-completion caching infrastructure to include global · 39982197
      Douglas Gregor authored
      declarations (in addition to macros). Each kind of declaration maps to
      a certain set of completion contexts, and the ASTUnit completion logic
      introduces the completion strings for those declarations if the actual
      code-completion occurs in one of the contexts where it matters. 
      
      There are a few new code-completion-context kinds. Without these,
      certain completions (e.g., after "using namespace") would need to
      suppress all global completions, which would be unfortunate.
      
      Note that we don't get the priorities right for global completions,
      because we don't have enough type information. We'll need a way to
      compare types in an ASTContext-agnostic way before this can be
      implemented.
      
      llvm-svn: 111093
      39982197
  3. Aug 14, 2010
    • Ted Kremenek's avatar
      Always recurse into sub-cursors when annotating tokens, as this information is... · aa01481d
      Ted Kremenek authored
      Always recurse into sub-cursors when annotating tokens, as this information is used for annotating macro arguments.  This finishes up <rdar://problem/8044584>.
      
      llvm-svn: 111066
      aa01481d
    • Ted Kremenek's avatar
      As a heuristic, annotate tokens (via clang_annotateTokens) that are the... · f4ade0ae
      Ted Kremenek authored
      As a heuristic, annotate tokens (via clang_annotateTokens) that are the arguments of a macro instantiation using the closest cursor with the same spelling location.  Because macro arguments can get token pasted in any arbitrary order, we use the annotation map to paper over the token -> cursor annotations during our post-processing stage.  This fixes most of <rdar://problem/8044584>, but still doesn't work for assert().
      
      llvm-svn: 111062
      f4ade0ae
    • Douglas Gregor's avatar
      Implement caching of code-completion results for macro definitions · b14904c4
      Douglas Gregor authored
      when the CXTranslationUnit_CacheCompletionResults option is given to
      clang_parseTranslationUnit(). Essentially, we compute code-completion
      results for macro definitions after we have parsed the file, then
      store an ASTContext-agnostic version of those results (completion
      string, cursor kind, priority, and active contexts) in the
      ASTUnit. When performing code completion in that ASTUnit, we splice 
      the macro definition results into the results provided by the actual
      code-completion (which has had macros turned off) before libclang gets
      those results. We use completion context information to only splice in
      those results that make sense for that context.
      
      With a completion involving all of the macros from Cocoa.h and a few other
      system libraries (totally ~8500 macro definitions) living in a
      precompiled header, we get about a 9% performance improvement from
      code completion, since we no longer have to deserialize all of the
      macro definitions from the precompiled header. 
      
      Note that macro definitions are merely the canary; the cache is
      designed to also support other top-level declarations, which should be
      a bigger performance win. That optimization will be next.
      
      Note also that there is no mechanism for determining when to throw
      away the cache and recompute its contents.
      
      llvm-svn: 111051
      b14904c4
  4. Aug 13, 2010
  5. Aug 12, 2010
  6. Aug 11, 2010
  7. Aug 10, 2010
  8. Aug 09, 2010
  9. Aug 06, 2010
  10. Aug 05, 2010
  11. Aug 04, 2010
    • Douglas Gregor's avatar
      When performing in-process code completion, don't free the remapped · d8a5dba9
      Douglas Gregor authored
      file buffers until the code completion results are destroyed;
      diagnostics may end up referring into the source.
      
      llvm-svn: 110216
      d8a5dba9
    • Douglas Gregor's avatar
      Add code-completion support directly to ASTUnit, which performs code · 8e984da8
      Douglas Gregor authored
      completion within the translation unit using the same command-line
      arguments for parsing the translation unit. Eventually, we'll reuse
      the precompiled preamble to improve code-completion performance, and
      this also gives us a place to cache results.
      
      Expose this function via the new libclang function
      clang_codeCompleteAt(), which performs the code completion within a
      CXTranslationUnit. The completion occurs in-process
      (clang_codeCompletion() runs code completion out-of-process).
      
      llvm-svn: 110210
      8e984da8
  12. Aug 03, 2010
    • Douglas Gregor's avatar
      When using a precompiled preamble, keep track of the top-level · e9db88f9
      Douglas Gregor authored
      declarations that we saw when creating the precompiled preamble, and
      provide those declarations in addition to the declarations parsed in
      the main source file when traversing top-level declarations. This
      makes the use of precompiled preambles a pure optimization, rather
      than changing the semantics of the parsed translation unit.
      
      llvm-svn: 110131
      e9db88f9
  13. Aug 02, 2010
  14. Jul 31, 2010
  15. Jul 30, 2010
  16. Jul 29, 2010
  17. Jul 28, 2010
  18. Jul 26, 2010
  19. Jul 25, 2010
Loading