<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><br></div>In r185354. Passes "make check-all".<div><br></div><div>Manman</div><div><br><div><div>On Jun 29, 2013, at 6:34 PM, David Blaikie wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><p dir="ltr"><br>
On Jun 28, 2013 10:04 PM, "Manman Ren" <<a href="mailto:mren@apple.com">mren@apple.com</a>> wrote:<br>
><br>
> Author: mren<br>
> Date: Sat Jun 29 00:01:19 2013<br>
> New Revision: 185249<br>
><br>
> URL: <a href="http://llvm.org/viewvc/llvm-project?rev=185249&view=rev">http://llvm.org/viewvc/llvm-project?rev=185249&view=rev</a><br>
> Log:<br>
> Debug Info: clean up usage of Verify.<br>
><br>
> No functionality change.<br>
> It should suffice to check the type of a debug info metadata, instead of<br>
> calling Verify. For cases where we know the type of a DI metadata, use<br>
> assert.<br>
><br>
> Modified:<br>
> llvm/trunk/lib/IR/DIBuilder.cpp<br>
> llvm/trunk/lib/IR/DebugInfo.cpp<br>
><br>
> Modified: llvm/trunk/lib/IR/DIBuilder.cpp<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/DIBuilder.cpp?rev=185249&r1=185248&r2=185249&view=diff">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/DIBuilder.cpp?rev=185249&r1=185248&r2=185249&view=diff</a><br>
> ==============================================================================<br>
> --- llvm/trunk/lib/IR/DIBuilder.cpp (original)<br>
> +++ llvm/trunk/lib/IR/DIBuilder.cpp Sat Jun 29 00:01:19 2013<br>
> @@ -1153,7 +1153,8 @@ DILexicalBlock DIBuilder::createLexicalB<br>
> Instruction *DIBuilder::insertDeclare(Value *Storage, DIVariable VarInfo,<br>
> Instruction *InsertBefore) {<br>
> assert(Storage && "no storage passed to dbg.declare");<br>
> - assert(VarInfo.Verify() && "empty DIVariable passed to dbg.declare");<br>
> + assert(VarInfo.isVariable() &&<br>
> + "empty or invalid DIVariable passed to dbg.declare");<br>
> if (!DeclareFn)<br>
> DeclareFn = Intrinsic::getDeclaration(&M, Intrinsic::dbg_declare);<br>
><br>
> @@ -1165,7 +1166,8 @@ Instruction *DIBuilder::insertDeclare(Va<br>
> Instruction *DIBuilder::insertDeclare(Value *Storage, DIVariable VarInfo,<br>
> BasicBlock *InsertAtEnd) {<br>
> assert(Storage && "no storage passed to dbg.declare");<br>
> - assert(VarInfo.Verify() && "invalid DIVariable passed to dbg.declare");<br>
> + assert(VarInfo.isVariable() &&<br>
> + "empty or invalid DIVariable passed to dbg.declare");<br>
> if (!DeclareFn)<br>
> DeclareFn = Intrinsic::getDeclaration(&M, Intrinsic::dbg_declare);<br>
><br>
> @@ -1184,7 +1186,8 @@ Instruction *DIBuilder::insertDbgValueIn<br>
> DIVariable VarInfo,<br>
> Instruction *InsertBefore) {<br>
> assert(V && "no value passed to dbg.value");<br>
> - assert(VarInfo.Verify() && "invalid DIVariable passed to dbg.value");<br>
> + assert(VarInfo.isVariable() &&<br>
> + "empty or invalid DIVariable passed to dbg.value");<br>
> if (!ValueFn)<br>
> ValueFn = Intrinsic::getDeclaration(&M, Intrinsic::dbg_value);<br>
><br>
> @@ -1199,7 +1202,8 @@ Instruction *DIBuilder::insertDbgValueIn<br>
> DIVariable VarInfo,<br>
> BasicBlock *InsertAtEnd) {<br>
> assert(V && "no value passed to dbg.value");<br>
> - assert(VarInfo.Verify() && "invalid DIVariable passed to dbg.value");<br>
> + assert(VarInfo.isVariable() &&<br>
> + "empty or invalid DIVariable passed to dbg.value");<br>
> if (!ValueFn)<br>
> ValueFn = Intrinsic::getDeclaration(&M, Intrinsic::dbg_value);<br>
><br>
><br>
> Modified: llvm/trunk/lib/IR/DebugInfo.cpp<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/DebugInfo.cpp?rev=185249&r1=185248&r2=185249&view=diff">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/DebugInfo.cpp?rev=185249&r1=185248&r2=185249&view=diff</a><br>
> ==============================================================================<br>
> --- llvm/trunk/lib/IR/DebugInfo.cpp (original)<br>
> +++ llvm/trunk/lib/IR/DebugInfo.cpp Sat Jun 29 00:01:19 2013<br>
> @@ -1213,8 +1213,10 @@ static void printDebugLoc(DebugLoc DL, r<br>
> const LLVMContext &Ctx) {<br>
> if (!DL.isUnknown()) { // Print source line info.<br>
> DIScope Scope(DL.getScope(Ctx));<br>
> + assert((!Scope || Scope.isScope()) &&<br>
> + "Scope of a DebugLoc should be null or a DIScope.");</p><p dir="ltr">As I mentioned in my previous email - I'm not sure if/when this happens. Can you confirm that there are correct cases where a drebugloc has a null scope? What are those cases? Do we have tests for them? (If there are no such cases, letas drop the check below)</p><p dir="ltr">> // Omit the directory, because it's likely to be long and uninteresting.<br>
> - if (Scope.Verify())<br>
> + if (Scope)<br>
> CommentOS << Scope.getFilename();<br>
> else<br>
> CommentOS << "<unknown>";<br>
><br>
><br>
> _______________________________________________<br>
> llvm-commits mailing list<br>
> <a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a><br>
> <a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
</p>
</blockquote></div><br></div></body></html>