jdoerfert added inline comments.

================
Comment at: clang/lib/AST/OpenMPClause.cpp:2488
+    addTrait(Property);
+  }
 }
----------------
Nit: no braces.


================
Comment at: clang/lib/Parse/ParseOpenMP.cpp:2052
+        /* CurrentFunctionDecl */ nullptr,
+        /* ConstructTraits */ ArrayRef<llvm::omp::TraitProperty>());
 
----------------
`{}` might do it but this is fine too.


================
Comment at: clang/lib/Sema/SemaOpenMP.cpp:746
+        }
+      }
+  }
----------------
So, SmalVector has a pop_back_val which we could use to verify the properties 
are the ones we expect. However, we would need to first put them into a vector 
and if insert is false we would need to reverse the vector.
Maybe that's the way to go:
1) Where you call `handleConstructTrait` right now, just put the traits in a 
vector.
2) Make it `handleConstructTraits` and take a vector of construct traits.
3) For insert == true, just append them all.
4) For insert == falser reverse the vector and do pop_back_val with an 
assertion that they match the result of vector.pop_back_val();

Does that make sense?

(Apologies for making you rewrite this twice.)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D109635

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to