<p dir="ltr">Re semantics, you may want to link to IWYU's docs at <a href="https://github.com/include-what-you-use/include-what-you-use/blob/master/docs/IWYUPragmas.md">https://github.com/include-what-you-use/include-what-you-use/blob/master/docs/IWYUPragmas.md</a>.</p>
<p dir="ltr">- Kim</p>
<div class="gmail_quote">Den 3 maj 2016 6:34 em skrev "Manuel Klimek via cfe-commits" <<a href="mailto:cfe-commits@lists.llvm.org">cfe-commits@lists.llvm.org</a>>:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">klimek added inline comments.<br>
<br>
================<br>
Comment at: include-fixer/find-all-symbols/FindAllSymbols.cpp:173-182<br>
@@ -165,1 +172,12 @@<br>
<br>
+void FindAllSymbols::addPragmaHeader(FileID ID, llvm::StringRef FilePath) {<br>
+ PragmaHeaderMap[ID] = FilePath;<br>
+}<br>
+<br>
+llvm::Optional<std::string> FindAllSymbols::getPragmaHeader(FileID ID) const {<br>
+ auto It = PragmaHeaderMap.find(ID);<br>
+ if (It == PragmaHeaderMap.end())<br>
+ return llvm::None;<br>
+ return It->second;<br>
+}<br>
+<br>
----------------<br>
It seems weird to add this and just forward the interface.<br>
<br>
================<br>
Comment at: include-fixer/find-all-symbols/FindAllSymbols.h:49<br>
@@ -45,1 +48,3 @@<br>
<br>
+ void addPragmaHeader(FileID ID, llvm::StringRef FilePath);<br>
+<br>
----------------<br>
I think the fact that those are generated via IWYU comments are an implementation detail, and this code doesn't care. Perhaps call it HeaderMapping or HeaderRemapping. Also, it's unclear what the semantics are, so I think this needs a comment.<br>
<br>
================<br>
Comment at: include-fixer/find-all-symbols/PragmaCommentHandler.h:23<br>
@@ +22,3 @@<br>
+public:<br>
+ PragmaCommentHandler(FindAllSymbols *Matcher) : Matcher(Matcher) {}<br>
+<br>
----------------<br>
I'd pull out an interface like HeaderMapCollector or ForwardingHeaderCollector, or even just pass in a std::function that collects the header. Or, just make this PragmaCommentHandler have a method to return a list of forwarding headers?<br>
Generally, I think this couples the two classes much more than necessary.<br>
<br>
<br>
Repository:<br>
rL LLVM<br>
<br>
<a href="http://reviews.llvm.org/D19816" rel="noreferrer" target="_blank">http://reviews.llvm.org/D19816</a><br>
<br>
<br>
<br>
_______________________________________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@lists.llvm.org">cfe-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits</a><br>
</blockquote></div>