[llvm-branch-commits] [clang] [llvm] [HLSL][RootSignature] Define and integrate rootsig clang attr and decl (PR #137690)
Justin Bogner via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Thu May 8 16:14:08 PDT 2025
================
@@ -149,6 +149,29 @@ void DescriptorTableClause::dump(raw_ostream &OS) const {
OS << ")";
}
+// Helper struct so that we can use the overloaded notation of std::visit
+template <class... Ts> struct OverloadMethods : Ts... {
+ using Ts::operator()...;
+};
+
+template <class... Ts> OverloadMethods(Ts...) -> OverloadMethods<Ts...>;
+
+void dumpRootElements(raw_ostream &OS, ArrayRef<RootElement> Elements) {
+ OS << "RootElements{";
+ bool First = true;
+ for (auto Element : Elements) {
----------------
bogner wrote:
`auto` is forcing a copy here, it should be `const auto &`. That said, I'd prefer `const RootElement &` anyways, as `auto` really isn't helping anyway.
https://github.com/llvm/llvm-project/pull/137690
More information about the llvm-branch-commits
mailing list