[PATCH] D71888: [mlir] Added llvm.resume and personality functions in LLVM IR Dialect

Mehdi AMINI via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 17 18:03:28 PST 2020


mehdi_amini added inline comments.


================
Comment at: mlir/lib/Target/LLVMIR/ModuleTranslation.cpp:637
+  for (Value v : values) {
+    assert(valueMapping.find(v) != valueMapping.end() &&
+           "referencing undefined value");
----------------
shraiysh wrote:
> bondhugula wrote:
> > shraiysh wrote:
> > > rriddle wrote:
> > > > nit: llvm::is_contained
> > > I think `llvm::is_contained` is a wrapper for `std::find`. I am not sure if there is a neat way of looking for keys in a map using `std::find` (and hence `llvm::is_contained`). Please let me know if there is.
> > It might be a wrapper around it, but it's more readable to me with llvm::is_contained. 
> I meant `llvm::is_contained(valueMapping, v)` does not work - because `valueMapping` is a `DenseMap`. I am not aware of a variant of `is_contained` that supports maps - looking for a key in it. Currently I am using `std::map::find` while the documentation suggests `is_contained` is wrapper for `std::find`.
rather `valueMapping.count(v)` ?


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

https://reviews.llvm.org/D71888





More information about the llvm-commits mailing list