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

Valentin Clement via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 27 16:19:21 PDT 2020


clementval added inline comments.


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


================
Comment at: llvm/utils/TableGen/DirectiveEmitter.cpp:119
+    VersionedClause VerClause{C};
+    if (CrtClauses.find(VerClause.getClause().getName()) == CrtClauses.end()) {
+      CrtClauses.insert(VerClause.getClause().getName());
----------------
kiranchandramohan wrote:
> Wouldn't this lead to an O(N^2) loop. Can we do better?
`CrtClauses` is a `StringSet` implemented on the top of `StringMap`. The lookup should be constant (O(1)) so inside the loop we should be O(N). 


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