================
@@ -101,6 +103,35 @@ void addRootSignatureMD(llvm::dxbc::RootSignatureVersion
RootSigVer,
RootSignatureValMD->addOperand(MDVals);
}
+MDNode *buildSemanticSignatureMD(
+ ArrayRef<llvm::hlsl::SemanticSignatureElement> Elements, LLVMContext &Ctx)
{
+ if (Elements.empty())
+ return nullptr;
+
+ SmallVector<Metadata *> ElementMD;
+ llvm::transform(Elements, std::back_inserter(ElementMD),
+ [&Ctx](const llvm::hlsl::SemanticSignatureElement &Element) {
+ return Element.toMetadata(Ctx);
+ });
----------------
bogner wrote:
I get the appeal of using `<algorithm>` when you can, but I feel like it's
simpler in this case to just write the loop out
```suggestion
for (const llvm::hlsl::SemanticSignatureElement &Element : Elements)
ElementMD.push_back(Element.toMetadata(Ctx);
```
https://github.com/llvm/llvm-project/pull/212892
_______________________________________________
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits