[Mlir-commits] [mlir] [mlir] Add llvm.linker.options operation to the LLVM IR Dialect (PR #71720)
Oleksandr Alex Zinenko
llvmlistbot at llvm.org
Thu Nov 9 00:40:24 PST 2023
================
@@ -487,6 +487,27 @@ void ModuleImport::addDebugIntrinsic(llvm::CallInst *intrinsic) {
debugIntrinsics.insert(intrinsic);
}
+LogicalResult ModuleImport::convertLinkerOptionsMetadata() {
+ for (const llvm::NamedMDNode &named : llvmModule->named_metadata()) {
+ if (named.getName() != "llvm.linker.options")
+ continue;
+ // llvm.linker.options operands are lists of strings.
+ for (const llvm::MDNode *md : named.operands()) {
+ SmallVector<StringRef> options;
+ for (const llvm::MDOperand &option : md->operands()) {
+ if (auto str = dyn_cast_or_null<llvm::MDString>(option))
----------------
ftynse wrote:
Can it ever be null?
https://github.com/llvm/llvm-project/pull/71720
More information about the Mlir-commits
mailing list