[PATCH] D39747: [globalisel][tablegen] Generate rule coverage and use it to identify untested rules

Vedant Kumar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 7 10:39:36 PST 2017


vsk added inline comments.


================
Comment at: include/llvm/Support/CodeGenCoverage.h:28
+
+  void covered(uint64_t RuleID);
+  bool isCovered(uint64_t RuleID);
----------------
Name this 'setCovered' to be more explicit?


================
Comment at: lib/Support/CodeGenCoverage.cpp:30
+#if LLVM_ENABLE_THREADS == 1
+static std::mutex OutputMutex;
+#endif
----------------
Could you use llvm::SmartMutex<true> and make this a member of CodeGenCoverage?


================
Comment at: lib/Support/CodeGenCoverage.cpp:84
+#if LLVM_ENABLE_THREADS == 1
+    std::lock_guard<std::mutex> Lock(OutputMutex);
+#endif
----------------
llvm::SmartScopedLock<true>


================
Comment at: lib/Support/CodeGenCoverage.cpp:97
+        "";
+#endif
+
----------------
This is starting to look like sys::fs::createUniqueFile(). It might be better to just use the existing utility.


================
Comment at: utils/llvm-gisel-cov.py:20
+def main():
+  parser = argparse.ArgumentParser(description=__doc__)
+  parser.add_argument('input', nargs='+')
----------------
Missing doc string?


https://reviews.llvm.org/D39747





More information about the llvm-commits mailing list