[PATCH] D24183: A clang tool for changing surrouding namespaces of class/function definitions.

Kirill Bobyrev via cfe-commits cfe-commits at lists.llvm.org
Sun Sep 4 17:21:27 PDT 2016


omtcyfz added inline comments.

================
Comment at: change-namespace/ChangeNamespace.cpp:30
@@ +29,3 @@
+  std::string Result = Namespaces.front();
+  for (auto I = Namespaces.begin() + 1, E = Namespaces.end(); I != E; ++I) {
+    Result += ("::" + *I).str();
----------------
Braces around single-line statement inside control flow statement body is occasionally not welcome in LLVM Codebase.

There are actually both many braces around single-line statement inside cfs body here and many cfs's without braces around single-line body inside a single file, which isn't good in terms of consistency at least inside the project.

================
Comment at: change-namespace/ChangeNamespace.cpp:105
@@ +104,3 @@
+  llvm::StringRef File = SM.getBufferData(LocInfo.first, &InvalidTemp);
+  if (InvalidTemp)
+    return SourceLocation();
----------------
Shouldn't this throw an error instead?


https://reviews.llvm.org/D24183





More information about the cfe-commits mailing list