[PATCH] Debug Info Verifier pass

Eric Christopher echristo at gmail.com
Fri Apr 11 15:17:30 PDT 2014


Hi Duncan,

Thanks for working on this:

1) The Broken variable seems weird.

An idea for a refactor:

+  // CheckFailed - A check failed, so print out the condition and the message
+  // that failed.  This provides a nice place to put a breakpoint if you want
+  // to see why something is not correct.
+  void CheckFailed(const Twine &Message, const Value *V1 = 0,
+                   const Value *V2 = 0, const Value *V3 = 0,
+                   const Value *V4 = 0) {
+    OS << Message.str() << "\n";
+    WriteValue(V1);
+    WriteValue(V2);
+    WriteValue(V3);
+    WriteValue(V4);
+    Broken = true;
+  }
+

Maybe just use a variadic template, iterate over the arguments, and
have "WriteValue" just take either a type or a value? I think that
might work? Can we use those yet?

2)

 void LLVMAddVerifierPass(LLVMPassManagerRef PM) {
   unwrap(PM)->add(createVerifierPass());
+  // FIXME: should this also add createDebugInfoVerifierPass()?
 }

... I'm not even sure why this is here? (Not your code, that comment
is fine, the original though...)

-  if (!NoVerify && !VerifyEach)
-    Passes.add(createVerifierPass());
+  if (!NoVerify) {
+    if (!VerifyEach)
+      Passes.add(createVerifierPass());
+    Passes.add(createDebugInfoVerifierPass());
+  }

Not sure why the difference?

Also the comments from Manman on the other locations to add a verifier pass.

(Side note: Yeesh, that's a lot of places to add a verifier pass.)

-eric

On Mon, Apr 7, 2014 at 2:32 PM, Duncan P. N. Exon Smith
<dexonsmith at apple.com> wrote:
> Eric and Manman,
>
> Picking up from the llvmdev discussion in December [1], here's a
> stab at DebugInfoVerifier:
>
>   - Splits out supporting functionality from Verifier into
>     VerifierSupport.
>
>   - Adds LegacyDebugInfoVerifierPassPass, a ModulePass which wraps
>     DebugInfoVerifier.  Uses -verify-di command-line flag.
>
>   - Change verifyModule() to invoke DebugInfoVerifier as well as
>     Verifier.
>
>   - Add a call to createDebugInfoVerifierPass() wherever there was a
>     call to createVerifierPass().
>
> Is this what you two were thinking of, or have I gone off course?
>
> Thanks,
> Duncan
>
> [1]: http://lists.cs.uiuc.edu/pipermail/llvmdev/2013-December/068870.html
>



More information about the llvm-commits mailing list