[PATCH] D35329: [clang-reorder-fields] Enable reordering for plain C structs

Haojian Wu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jul 18 11:17:41 PDT 2017


hokein added inline comments.


================
Comment at: clang-reorder-fields/ReorderFieldsAction.cpp:236
+
+    // CXXRD will be nullptr if C code (not C++) is being processed 
+    const CXXRecordDecl *CXXRD = dyn_cast<CXXRecordDecl>(RD);
----------------
Nit:  missing a trailing `.`.

I think we could use `Context.getLangOpts()` to determine whether the file being processed is C or C++. Use early return If the code is C.


Repository:
  rL LLVM

https://reviews.llvm.org/D35329





More information about the cfe-commits mailing list