[PATCH] misc-uninitialized-field

Chad Rosier mcrosier at codeaurora.org
Fri Jun 19 07:12:39 PDT 2015


Minor coding style nits.


REPOSITORY
  rL LLVM

================
Comment at: clang-tidy/misc/UninitializedFieldCheck.cpp:31
@@ +30,3 @@
+static bool fieldRequiresInit(const clang::FieldDecl *f) {
+  if (f->getType()->isPointerType()) {
+    return true;
----------------
No need for curly brackets.

================
Comment at: clang-tidy/misc/UninitializedFieldCheck.cpp:34
@@ +33,3 @@
+  }
+  if (f->getType()->isBuiltinType()) {
+    return true;
----------------
No need for curly brackets.

================
Comment at: clang-tidy/misc/UninitializedFieldCheck.cpp:62
@@ +61,3 @@
+
+    if (FieldsToInit.empty()) {
+      return;
----------------
No need for curly bracket.

================
Comment at: clang-tidy/misc/UninitializedFieldCheck.cpp:68
@@ +67,3 @@
+      const FieldDecl *MemberField = Init->getMember();
+      if (Init->isDelegatingInitializer()) {
+        return;
----------------
No need for curly bracket.

================
Comment at: clang-tidy/misc/UninitializedFieldCheck.cpp:72
@@ +71,3 @@
+      
+      if (!MemberField) {
+        continue;
----------------
No need for curly bracket.

================
Comment at: clang-tidy/misc/UninitializedFieldCheck.cpp:79
@@ +78,3 @@
+
+    if (FieldsToInit.empty()) {
+      return;
----------------
No need for curly bracket.

================
Comment at: clang-tidy/misc/UninitializedFieldCheck.cpp:93
@@ +92,3 @@
+
+    Replacement.back() = '{'; // remove training ',' TODO: Avoid replacing the constructor body's leading '{'
+
----------------
80-column?

================
Comment at: clang-tidy/misc/UninitializedFieldCheck.cpp:102
@@ +101,3 @@
+
+    if (it_WrittenInitializer == Ctor->inits().end()) {
+      Replacement = ":" + Replacement;
----------------
No need for curly brackets.

================
Comment at: clang-tidy/misc/UninitializedFieldCheck.h:8
@@ +7,3 @@
+//
+// TODO: Describe what check does
+//
----------------
Perhaps this TODO should be addressed prior to the commit.

http://reviews.llvm.org/D10553

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the llvm-commits mailing list