<html><head><meta http-equiv="Content-Type" content="text/html charset=iso-8859-1"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div><br></div>Theoretically they should be.<div>But we were using an "if" on "Verify()", which means it may be possible Verify() can return false.</div><div>I can try to further replace the "if" with an "assert" and see whether all testing cases can pass.</div><div><br></div><div>Manman</div><div><br><div><div>On Jul 8, 2013, at 11:39 AM, Eric Christopher <<a href="mailto:echristo@gmail.com">echristo@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;">These should be asserts yes?<br><br>-eric<br><br><blockquote type="cite">void CompileUnit::addSourceLine(DIE *Die, DIVariable V) {<br>  // Verify variable.<br>-  if (!V.Verify())<br>+  if (!V.isVariable())<br>    return;<br><br>  unsigned Line = V.getLineNumber();<br>@@ -259,7 +259,7 @@ void CompileUnit::addSourceLine(DIE *Die<br>/// entry.<br>void CompileUnit::addSourceLine(DIE *Die, DIGlobalVariable G) {<br>  // Verify global variable.<br>-  if (!G.Verify())<br>+  if (!G.isGlobalVariable())<br>    return;<br><br>  unsigned Line = G.getLineNumber();<br>@@ -276,7 +276,7 @@ void CompileUnit::addSourceLine(DIE *Die<br>/// entry.<br>void CompileUnit::addSourceLine(DIE *Die, DISubprogram SP) {<br>  // Verify subprogram.<br>-  if (!SP.Verify())<br>+  if (!SP.isSubprogram())<br>    return;<br><br>  // If the line number is 0, don't add it.<br>@@ -295,7 +295,7 @@ void CompileUnit::addSourceLine(DIE *Die<br>/// entry.<br>void CompileUnit::addSourceLine(DIE *Die, DIType Ty) {<br>  // Verify type.<br>-  if (!Ty.Verify())<br>+  if (!Ty.isType())<br>    return;<br><br>  unsigned Line = Ty.getLineNumber();<br>@@ -312,7 +312,7 @@ void CompileUnit::addSourceLine(DIE *Die<br>/// entry.<br>void CompileUnit::addSourceLine(DIE *Die, DIObjCProperty Ty) {<br>  // Verify type.<br>-  if (!Ty.Verify())<br>+  if (!Ty.isObjCProperty())<br>    return;<br><br></blockquote><br><br><blockquote type="cite">  unsigned Line = Ty.getLineNumber();<br>@@ -734,7 +734,7 @@ void CompileUnit::addToContextOwner(DIE<br>/// given DIType.<br>DIE *CompileUnit::getOrCreateTypeDIE(const MDNode *TyNode) {<br>  DIType Ty(TyNode);<br>-  if (!Ty.Verify())<br>+  if (!Ty.isType())<br>    return NULL;<br>  DIE *TyDIE = getDIE(Ty);<br>  if (TyDIE)<br>@@ -773,7 +773,7 @@ DIE *CompileUnit::getOrCreateTypeDIE(con<br><br>/// addType - Add a new type attribute to the specified entity.<br>void CompileUnit::addType(DIE *Entity, DIType Ty, unsigned Attribute) {<br>-  if (!Ty.Verify())<br>+  if (!Ty.isType())<br>    return;<br><br>  // Check for pre-existence.<br>@@ -818,7 +818,7 @@ void CompileUnit::addPubTypes(DISubprogr<br>  DIArray Args = SPTy.getTypeArray();<br>  for (unsigned i = 0, e = Args.getNumElements(); i != e; ++i) {<br>    DIType ATy(Args.getElement(i));<br>-    if (!ATy.Verify())<br>+    if (!ATy.isType())<br>      continue;<br>    addGlobalType(ATy);<br>  }<br>@@ -904,7 +904,7 @@ void CompileUnit::constructTypeDIE(DIE &<br>      }<br>    }<br>    DIType DTy = CTy.getTypeDerivedFrom();<br>-    if (DTy.Verify()) {<br>+    if (DTy.isType()) {<br>      addType(&Buffer, DTy);<br>      addUInt(&Buffer, dwarf::DW_AT_enum_class, dwarf::DW_FORM_flag, 1);<br>    }<br>@@ -1296,7 +1296,7 @@ void CompileUnit::createGlobalVariableDI<br>    return;<br><br>  DIGlobalVariable GV(N);<br>-  if (!GV.Verify())<br>+  if (!GV.isGlobalVariable())<br>    return;<br><br>  DIDescriptor GVContext = GV.getContext();<br><br>Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp<br>URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp?rev=185847&r1=185846&r2=185847&view=diff">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp?rev=185847&r1=185846&r2=185847&view=diff</a><br>==============================================================================<br>--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp (original)<br>+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp Mon Jul  8 13:33:29 2013<br>@@ -934,7 +934,7 @@ void DwarfDebug::collectDeadVariables()<br>      for (unsigned i = 0, e = Subprograms.getNumElements(); i != e; ++i) {<br>        DISubprogram SP(Subprograms.getElement(i));<br>        if (ProcessedSPNodes.count(SP) != 0) continue;<br>-        if (!SP.Verify()) continue;<br>+        if (!SP.isSubprogram()) continue;<br>        if (!SP.isDefinition()) continue;<br>        DIArray Variables = SP.getVariables();<br>        if (Variables.getNumElements() == 0) continue;<br>@@ -950,7 +950,7 @@ void DwarfDebug::collectDeadVariables()<br>        DIE *ScopeDIE = SPCU->getDIE(SP);<br>        for (unsigned vi = 0, ve = Variables.getNumElements(); vi != ve; ++vi) {<br>          DIVariable DV(Variables.getElement(vi));<br>-          if (!DV.Verify()) continue;<br>+          if (!DV.isVariable()) continue;<br>          DbgVariable *NewVar = new DbgVariable(DV, NULL);<br>          if (DIE *VariableDIE =<br>              SPCU->constructVariableDIE(NewVar, Scope->isAbstractScope()))<br>@@ -1314,7 +1314,7 @@ DwarfDebug::collectVariableInfo(const Ma<br>  DIArray Variables = DISubprogram(FnScope->getScopeNode()).getVariables();<br>  for (unsigned i = 0, e = Variables.getNumElements(); i != e; ++i) {<br>    DIVariable DV(Variables.getElement(i));<br>-    if (!DV || !DV.Verify() || !Processed.insert(DV))<br>+    if (!DV || !DV.isVariable() || !Processed.insert(DV))<br>      continue;<br>    if (LexicalScope *Scope = LScopes.findLexicalScope(DV.getContext()))<br>      addScopeVariable(Scope, new DbgVariable(DV, NULL));<br>@@ -1445,7 +1445,7 @@ static MDNode *getScopeNode(DebugLoc DL,<br>static DebugLoc getFnDebugLoc(DebugLoc DL, const LLVMContext &Ctx) {<br>  const MDNode *Scope = getScopeNode(DL, Ctx);<br>  DISubprogram SP = getDISubprogram(Scope);<br>-  if (SP.Verify()) {<br>+  if (SP.isSubprogram()) {<br>    // Check for number of operands since the compatibility is<br>    // cheap here.<br>    if (SP->getNumOperands() > 19)<br>@@ -1513,7 +1513,7 @@ void DwarfDebug::beginFunction(const Mac<br>          // The first mention of a function argument gets the FunctionBeginSym<br>          // label, so arguments are visible when breaking at function entry.<br>          DIVariable DV(Var);<br>-          if (DV.Verify() && DV.getTag() == dwarf::DW_TAG_arg_variable &&<br>+          if (DV.isVariable() && DV.getTag() == dwarf::DW_TAG_arg_variable &&<br>              DISubprogram(getDISubprogram(DV.getContext()))<br>                .describes(MF->getFunction()))<br>            LabelsBeforeInsn[MI] = FunctionBeginSym;<br>@@ -1699,12 +1699,12 @@ void DwarfDebug::endFunction(const Machi<br>  for (unsigned i = 0, e = AList.size(); i != e; ++i) {<br>    LexicalScope *AScope = AList[i];<br>    DISubprogram SP(AScope->getScopeNode());<br>-    if (SP.Verify()) {<br>+    if (SP.isSubprogram()) {<br>      // Collect info for variables that were optimized out.<br>      DIArray Variables = SP.getVariables();<br>      for (unsigned i = 0, e = Variables.getNumElements(); i != e; ++i) {<br>        DIVariable DV(Variables.getElement(i));<br>-        if (!DV || !DV.Verify() || !ProcessedVars.insert(DV))<br>+        if (!DV || !DV.isVariable() || !ProcessedVars.insert(DV))<br>          continue;<br>        // Check that DbgVariable for DV wasn't created earlier, when<br>        // findAbstractVariable() was called for inlined instance of DV.<br><br>Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.h<br>URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.h?rev=185847&r1=185846&r2=185847&view=diff">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.h?rev=185847&r1=185846&r2=185847&view=diff</a><br>==============================================================================<br>--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.h (original)<br>+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.h Mon Jul  8 13:33:29 2013<br>@@ -193,15 +193,15 @@ public:<br>  }<br><br>  bool variableHasComplexAddress()   const {<br>-    assert(Var.Verify() && "Invalid complex DbgVariable!");<br>+    assert(Var.isVariable() && "Invalid complex DbgVariable!");<br>    return Var.hasComplexAddress();<br>  }<br>  bool isBlockByrefVariable()        const {<br>-    assert(Var.Verify() && "Invalid complex DbgVariable!");<br>+    assert(Var.isVariable() && "Invalid complex DbgVariable!");<br>    return Var.isBlockByrefVariable();<br>  }<br>  unsigned getNumAddrElements()      const {<br>-    assert(Var.Verify() && "Invalid complex DbgVariable!");<br>+    assert(Var.isVariable() && "Invalid complex DbgVariable!");<br>    return Var.getNumAddrElements();<br>  }<br>  uint64_t getAddrElement(unsigned i) const {<br><br><br>_______________________________________________<br>llvm-commits mailing list<br><a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a><br>http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</blockquote></div></blockquote></div><br></div></body></html>