klimek added inline comments.

================
Comment at: lib/Format/Format.cpp:1450
@@ -1447,3 +1449,3 @@
 public:
-  Formatter(const FormatStyle &Style, SourceManager &SourceMgr, FileID ID,
-            ArrayRef<CharSourceRange> Ranges)
+  CodeProcessor(const FormatStyle &Style, SourceManager &SourceMgr, FileID ID,
+                ArrayRef<CharSourceRange> Ranges)
----------------
After pondering a bit more, it seems like CodeProcessor is too generic: this is 
more something that runs analyses based on annotated tokens, so I'd call it 
TokenAnalyzer or something. That would also make it obvious to push some of the 
duplicated functionality from Formatter and Cleaner down (namely everything up 
to where we have generated the annotated tokens).

I'm still not completely convinced either way regarding inheritance vs. 
composition, but if we have a TokenAnalyzer, we'd also have a nice is-a 
relationship. While I generally agree to prefer composition, I also think we 
need to look out for where inheritance actually makes things clearer.


http://reviews.llvm.org/D18551



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

Reply via email to