[PATCH] D19913: Added static creators that create complete instances of SymbolInfo.

Manuel Klimek via cfe-commits cfe-commits at lists.llvm.org
Wed May 4 05:56:39 PDT 2016


klimek added inline comments.

================
Comment at: include-fixer/find-all-symbols/SymbolInfo.h:90-93
@@ +89,6 @@
+
+  static SymbolInfo
+  CreateFunctionSymbolInfo(const std::string &Name, const std::string &FilePath,
+                           const std::vector<Context> &Contexts, int LineNumber,
+                           const FunctionInfo &FuncInfo);
+
----------------
ioeric wrote:
> klimek wrote:
> > To some degree this looks like we actually want a class hierarchy. But currently only ClassSymbolInfo is used?
> At this point yes, since Symbolnfo is only created in InMemoryXrefsDB and FindAllSymbols now, and it is not trivial to change FindAllSymbols to use these creators. 
> 
> But one immediate use case I can foresee is converting proto buffer SymbolInfo to clang SymbolInfo when integrating with Google3 XrefsDB. 
I think at this point YAGNI applies and we shouldn't create stuff that we don't use yet - code generally starts to rot when it's not used ;)


http://reviews.llvm.org/D19913





More information about the cfe-commits mailing list