hokein added a comment.

In http://reviews.llvm.org/D21603#475011, @bkramer wrote:

> In the future I'd prefer to have patches like this split up in a part that 
> refactors and a part that contains the actual change. Having that in one 
> patch makes it really hard to review.


Acknowledged. I'm sorry for it. I didn't foresee that I would change so much 
code before I implementing this.

So let me summarize the changes of this patch:

1. Instead of returning raw string headers, make `SymbolIndexManager::search` 
return `Symbolnfos`.
2. Move `rankByPopularity`  unique SymbolInfo code from 
`SymbolIndexManager.cpp` to `IncludeFixerContext.cpp`.
3. Extend `IncludeFixerContext` to track more `SymbolInfo` information (e.g. 
`SymbolRange`, `SymbolScopedQualifiers`).
4. Some move stuff in `Action::query` API.
5. Create `adding namespace qualifiers` replacement for the unidentified symbol.


================
Comment at: include-fixer/IncludeFixer.cpp:73
@@ -72,2 +72,3 @@
     clang::ASTContext &context = getCompilerInstance().getASTContext();
-    query(T.getUnqualifiedType().getAsString(context.getPrintingPolicy()), 
Loc);
+    llvm::StringRef QueryString =
+        T.getUnqualifiedType().getAsString(context.getPrintingPolicy());
----------------
bkramer wrote:
> std::string, otherwise this will be a user after free.
Good catch. Done.


http://reviews.llvm.org/D21603



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to