[PATCH] D90241: [openmp][openacc] Check for duplicate clauses for directive

Kiran Chandramohan via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 27 14:58:36 PDT 2020


kiranchandramohan added a comment.

This is a good verification check. A few questions.



================
Comment at: llvm/include/llvm/TableGen/DirectiveEmitter.h:103
+  // Returns the record name.
+  const StringRef getRecordName() const { return Def->getName(); }
 };
----------------
Any issues with moving this to the base class?


================
Comment at: llvm/test/TableGen/directive3.td:11-12
+
+
+
+def TDLC_ClauseA : Clause<"clausea"> {
----------------
Nit: Extra line/lines?


================
Comment at: llvm/utils/TableGen/DirectiveEmitter.cpp:119
+    VersionedClause VerClause{C};
+    if (CrtClauses.find(VerClause.getClause().getName()) == CrtClauses.end()) {
+      CrtClauses.insert(VerClause.getClause().getName());
----------------
Wouldn't this lead to an O(N^2) loop. Can we do better?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D90241/new/

https://reviews.llvm.org/D90241



More information about the llvm-commits mailing list