[llvm-branch-commits] [llvm] [DXIL] Add support for root signature flag element in DXContainer (PR #123147)
Justin Bogner via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Mon Feb 3 23:03:28 PST 2025
================
@@ -0,0 +1,157 @@
+//===- DXILRootSignature.cpp - DXIL Root Signature helper objects ----===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+///
+/// \file This file contains helper objects and APIs for working with DXIL
+/// Root Signatures.
+///
+//===----------------------------------------------------------------------===//
+#include "DXILRootSignature.h"
+#include "DirectX.h"
+#include "llvm/ADT/StringSwitch.h"
+#include "llvm/ADT/Twine.h"
+#include "llvm/IR/Constants.h"
+#include "llvm/IR/Module.h"
+#include <cstdint>
+
+using namespace llvm;
+using namespace llvm::dxil;
+
+static bool reportError(Twine Message) {
+ report_fatal_error(Message, false);
----------------
bogner wrote:
I haven't had time to review this in detail yet, but one important note. We should not be using `report_fatal_error` for error handling here. This is essentially crashing the compiler and should be used *very* sparingly. If the errors can come from user input or from corrupt binary files, this type of error reporting will be a terrible user experience.
I suspect it would be more appropriate to use `LLVMContext::diagnose` and the DiagnosticInfo machinery so that we can report issues back to the frontend.
https://github.com/llvm/llvm-project/pull/123147
More information about the llvm-branch-commits
mailing list