[Mlir-commits] [mlir] [mlir][llvmir] implement missing attrs `getChecked` (PR #121248)
Maksim Levental
llvmlistbot at llvm.org
Sat Dec 28 10:46:23 PST 2024
================
@@ -296,6 +305,20 @@ TargetFeaturesAttr TargetFeaturesAttr::get(MLIRContext *context,
return get(context, features);
}
+TargetFeaturesAttr TargetFeaturesAttr::getChecked(
+ llvm::function_ref<::mlir::InFlightDiagnostic()> emitError,
+ MLIRContext *context, StringRef targetFeatures) {
+ SmallVector<StringRef> features;
+ targetFeatures.split(features, ',', /*MaxSplit=*/-1,
+ /*KeepEmpty=*/false);
+ SmallVector<StringAttr> featuresAttrs;
+ featuresAttrs.reserve(features.size());
+ for (StringRef feature : features) {
+ featuresAttrs.push_back(StringAttr::get(context, feature));
+ }
+ return getChecked(emitError, context, featuresAttrs);
----------------
makslevental wrote:
I don't know if I was asleep or what when I did this.................
https://github.com/llvm/llvm-project/pull/121248
More information about the Mlir-commits
mailing list