[llvm-branch-commits] [llvm] [DirectX] Add DXIL validation of `llvm.loop` metadata (PR #164292)

Joshua Batista via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Mon Oct 27 16:15:59 PDT 2025


================
@@ -47,16 +48,28 @@ class DiagnosticInfoTranslateMD : public DiagnosticInfo {
   /// \p M is the module for which the diagnostic is being emitted. \p Msg is
   /// the message to show. Note that this class does not copy this message, so
   /// this reference must be valid for the whole life time of the diagnostic.
-  DiagnosticInfoTranslateMD(const Module &M,
-                            const Twine &Msg LLVM_LIFETIME_BOUND,
-                            DiagnosticSeverity Severity = DS_Error)
+  DiagnosticInfoValidateMD(const Module &M,
+                           const Twine &Msg LLVM_LIFETIME_BOUND,
+                           DiagnosticSeverity Severity = DS_Error)
       : DiagnosticInfo(DK_Unsupported, Severity), Msg(Msg), Mod(M) {}
 
   void print(DiagnosticPrinter &DP) const override {
     DP << Mod.getName() << ": " << Msg << '\n';
   }
 };
 
+static bool reportError(Module &M, Twine Message,
+                        DiagnosticSeverity Severity = DS_Error) {
+  M.getContext().diagnose(DiagnosticInfoValidateMD(M, Message, Severity));
+  return true;
----------------
bob80905 wrote:

You don't seem to use this return value, should this and below functions return void?

https://github.com/llvm/llvm-project/pull/164292


More information about the llvm-branch-commits mailing list