<div dir="ltr">Should/could this have a test case?</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Apr 22, 2020 at 5:05 PM Vedant Kumar via llvm-commits <<a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br>
Author: Vedant Kumar<br>
Date: 2020-04-22T17:03:39-07:00<br>
New Revision: 2fa656cdfd836d5d3959466f05e44ae51bcded4e<br>
<br>
URL: <a href="https://github.com/llvm/llvm-project/commit/2fa656cdfd836d5d3959466f05e44ae51bcded4e" rel="noreferrer" target="_blank">https://github.com/llvm/llvm-project/commit/2fa656cdfd836d5d3959466f05e44ae51bcded4e</a><br>
DIFF: <a href="https://github.com/llvm/llvm-project/commit/2fa656cdfd836d5d3959466f05e44ae51bcded4e.diff" rel="noreferrer" target="_blank">https://github.com/llvm/llvm-project/commit/2fa656cdfd836d5d3959466f05e44ae51bcded4e.diff</a><br>
<br>
LOG: [Debugify] Do not require named metadata to be present when stripping<br>
<br>
This allows -mir-strip-debug to be run without -debugify having run<br>
before.<br>
<br>
Added: <br>
<br>
<br>
Modified: <br>
    llvm/lib/Transforms/Utils/Debugify.cpp<br>
<br>
Removed: <br>
<br>
<br>
<br>
################################################################################<br>
diff  --git a/llvm/lib/Transforms/Utils/Debugify.cpp b/llvm/lib/Transforms/Utils/Debugify.cpp<br>
index f2739a8257a2..19c73f3840fc 100644<br>
--- a/llvm/lib/Transforms/Utils/Debugify.cpp<br>
+++ b/llvm/lib/Transforms/Utils/Debugify.cpp<br>
@@ -224,7 +224,8 @@ bool llvm::stripDebugifyMetadata(Module &M) {<br>
   // Strip out the module-level Debug Info Version metadata.<br>
   // FIXME: There must be an easier way to remove an operand from a NamedMDNode.<br>
   NamedMDNode *NMD = M.getModuleFlagsMetadata();<br>
-  assert(NMD && "debugify metadata present without Debug Info Version set?");<br>
+  if (!NMD)<br>
+    return Changed;<br>
   SmallVector<MDNode *, 4> Flags;<br>
   for (MDNode *Flag : NMD->operands())<br>
     Flags.push_back(Flag);<br>
<br>
<br>
<br>
_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a><br>
<a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><br>
</blockquote></div>