[llvm] Add -verify-with-context option to enable better reporting of verifier errors (PR #84867)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 23 07:19:57 PDT 2024


================
@@ -132,9 +132,64 @@ static cl::opt<bool> VerifyNoAliasScopeDomination(
     cl::desc("Ensure that llvm.experimental.noalias.scope.decl for identical "
              "scopes are not dominating"));
 
+static cl::opt<bool> VerifyWithContext(
+    "verify-with-context", cl::Hidden, cl::init(false),
+    cl::desc("Enable a detailed context reporting for verification errors"));
+
 namespace llvm {
 
-struct VerifierSupport {
+/// Helper type to manage the current context of a Verifier.
+struct VerifierCtxManager {
----------------
arsenm wrote:

I think this is more complicated than necessary. The context doesn't really need a trackable path, you already know directly from the instruction's parent the block and function. 

 It would be an improvement to just add the context function when applicable. 

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


More information about the llvm-commits mailing list