[PATCH] Own/produce FrontendActionFactories by value, rather than new'd/unique_ptr ownership.

Manuel Klimek klimek at google.com
Thu Jun 26 10:09:20 PDT 2014


================
Comment at: include/clang/Tooling/Tooling.h:320
@@ +319,3 @@
+        return false;
+      if (Callbacks != NULL)
+        return Callbacks->handleBeginSource(CI, Filename);
----------------
I thought LLVM style was to not explicitly check against NULL? Also, nullptr?

================
Comment at: include/clang/Tooling/Tooling.h:340
@@ +339,3 @@
+template <typename T>
+internal::SimpleFrontendActionFactory<T> newFrontendActionFactory() {
+  return internal::SimpleFrontendActionFactory<T>();
----------------
I'd change the name of things that do not return a new pointer to "create...".

================
Comment at: tools/clang-check/ClangCheck.cpp:223
@@ -229,1 +222,3 @@
+    return Tool.run(newFrontendActionFactory<FixItAction>());
+  return Tool.run(newFrontendActionFactory(&CheckFactory));
 }
----------------
I actually dislike that change somewhat (it introduces more structural duplication).

http://reviews.llvm.org/D4313






More information about the cfe-commits mailing list