<div dir="ltr">Please include some details on why a patch is reverted in the revert commit message.</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Nov 30, 2023 at 3:09 PM Adrian Prantl 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: Adrian Prantl<br>
Date: 2023-11-30T15:09:24-08:00<br>
New Revision: 4e724c2a214cc62fd024237f0bdf903ed8fbf45b<br>
<br>
URL: <a href="https://github.com/llvm/llvm-project/commit/4e724c2a214cc62fd024237f0bdf903ed8fbf45b" rel="noreferrer" target="_blank">https://github.com/llvm/llvm-project/commit/4e724c2a214cc62fd024237f0bdf903ed8fbf45b</a><br>
DIFF: <a href="https://github.com/llvm/llvm-project/commit/4e724c2a214cc62fd024237f0bdf903ed8fbf45b.diff" rel="noreferrer" target="_blank">https://github.com/llvm/llvm-project/commit/4e724c2a214cc62fd024237f0bdf903ed8fbf45b.diff</a><br>
<br>
LOG: Revert "[DWARFv5] Verify all-or-nothing constraint on DIFile source"<br>
<br>
This reverts commit 4ed5195712fd1f3f43e23678d8f666c47d1aa7d5.<br>
<br>
Added: <br>
<br>
<br>
Modified: <br>
    llvm/lib/IR/Verifier.cpp<br>
<br>
Removed: <br>
    llvm/test/Assembler/debug-info-source-invalid.ll<br>
    llvm/test/Assembler/debug-info-source.ll<br>
<br>
<br>
################################################################################<br>
diff  --git a/llvm/lib/IR/Verifier.cpp b/llvm/lib/IR/Verifier.cpp<br>
index 5560c037aa3ee6b..5f466581ea98095 100644<br>
--- a/llvm/lib/IR/Verifier.cpp<br>
+++ b/llvm/lib/IR/Verifier.cpp<br>
@@ -329,9 +329,6 @@ class Verifier : public InstVisitor<Verifier>, VerifierSupport {<br>
   /// The current source language.<br>
   dwarf::SourceLanguage CurrentSourceLang = dwarf::DW_LANG_lo_user;<br>
<br>
-  /// Whether source was present on the first DIFile encountered in each CU.<br>
-  DenseMap<const DICompileUnit *, bool> HasSourceDebugInfo;<br>
-<br>
   /// Stores the count of how many objects were passed to llvm.localescape for a<br>
   /// given function and the largest index passed to llvm.localrecover.<br>
   DenseMap<Function *, std::pair<unsigned, unsigned>> FrameEscapeInfo;<br>
@@ -620,9 +617,6 @@ class Verifier : public InstVisitor<Verifier>, VerifierSupport {<br>
   void verifyAttachedCallBundle(const CallBase &Call,<br>
                                 const OperandBundleUse &BU);<br>
<br>
-  /// Verify all-or-nothing property of DIFile source attribute within a CU.<br>
-  void verifySourceDebugInfo(const DICompileUnit &U, const DIFile &F);<br>
-<br>
   /// Verify the llvm.experimental.noalias.scope.decl declarations<br>
   void verifyNoAliasScopeDecl();<br>
 };<br>
@@ -1352,8 +1346,6 @@ void Verifier::visitDICompileUnit(const DICompileUnit &N) {<br>
<br>
   CurrentSourceLang = (dwarf::SourceLanguage)N.getSourceLanguage();<br>
<br>
-  verifySourceDebugInfo(N, *N.getFile());<br>
-<br>
   CheckDI((N.getEmissionKind() <= DICompileUnit::LastEmissionKind),<br>
           "invalid emission kind", &N);<br>
<br>
@@ -1442,8 +1434,6 @@ void Verifier::visitDISubprogram(const DISubprogram &N) {<br>
               "definition subprograms cannot be nested within DICompositeType "<br>
               "when enabling ODR",<br>
               &N);<br>
-    if (N.getFile())<br>
-      verifySourceDebugInfo(*N.getUnit(), *N.getFile());<br>
   } else {<br>
     // Subprogram declarations (part of the type hierarchy).<br>
     CheckDI(!Unit, "subprogram declarations must not have a compile unit", &N);<br>
@@ -6590,14 +6580,6 @@ void Verifier::verifyAttachedCallBundle(const CallBase &Call,<br>
   }<br>
 }<br>
<br>
-void Verifier::verifySourceDebugInfo(const DICompileUnit &U, const DIFile &F) {<br>
-  bool HasSource = F.getSource().has_value();<br>
-  if (!HasSourceDebugInfo.count(&U))<br>
-    HasSourceDebugInfo[&U] = HasSource;<br>
-  CheckDI(HasSource == HasSourceDebugInfo[&U],<br>
-          "inconsistent use of embedded source");<br>
-}<br>
-<br>
 void Verifier::verifyNoAliasScopeDecl() {<br>
   if (NoAliasScopeDecls.empty())<br>
     return;<br>
<br>
diff  --git a/llvm/test/Assembler/debug-info-source-invalid.ll b/llvm/test/Assembler/debug-info-source-invalid.ll<br>
deleted file mode 100644<br>
index d746e9e25fc3d12..000000000000000<br>
--- a/llvm/test/Assembler/debug-info-source-invalid.ll<br>
+++ /dev/null<br>
@@ -1,27 +0,0 @@<br>
-; RUN: llvm-as < %s 2>&1 >/dev/null | FileCheck %s<br>
-<br>
-; Ensure we reject debug info where the DIFiles of a DICompileUnit mix source<br>
-; and no-source.<br>
-<br>
-define dso_local void @foo() !dbg !5 {<br>
-  ret void<br>
-}<br>
-<br>
-define dso_local void @bar() !dbg !6 {<br>
-  ret void<br>
-}<br>
-<br>
-!<a href="http://llvm.dbg.cu" rel="noreferrer" target="_blank">llvm.dbg.cu</a> = !{!4}<br>
-!llvm.module.flags = !{!0, !1}<br>
-<br>
-!0 = !{i32 2, !"Dwarf Version", i32 5}<br>
-!1 = !{i32 2, !"Debug Info Version", i32 3}<br>
-<br>
-!2 = !DIFile(filename: "foo.c", directory: "dir", source: "void foo() { }\0A")<br>
-; CHECK: inconsistent use of embedded source<br>
-; CHECK: warning: ignoring invalid debug info<br>
-!3 = !DIFile(filename: "bar.h", directory: "dir")<br>
-<br>
-!4 = distinct !DICompileUnit(language: DW_LANG_C99, file: !2)<br>
-!5 = distinct !DISubprogram(name: "foo", file: !2, unit: !4)<br>
-!6 = distinct !DISubprogram(name: "bar", file: !3, unit: !4)<br>
<br>
diff  --git a/llvm/test/Assembler/debug-info-source.ll b/llvm/test/Assembler/debug-info-source.ll<br>
deleted file mode 100644<br>
index 381603ef35c3839..000000000000000<br>
--- a/llvm/test/Assembler/debug-info-source.ll<br>
+++ /dev/null<br>
@@ -1,41 +0,0 @@<br>
-; RUN: llvm-as < %s | llvm-dis | llvm-as | llvm-dis | FileCheck %s<br>
-; RUN: verify-uselistorder %s<br>
-<br>
-; Ensure we accept debug info where DIFiles within a DICompileUnit either all<br>
-; have source, or none have source.<br>
-<br>
-define dso_local void @foo() !dbg !6 {<br>
-  ret void<br>
-}<br>
-<br>
-define dso_local void @bar() !dbg !7 {<br>
-  ret void<br>
-}<br>
-<br>
-define dso_local void @baz() !dbg !9 {<br>
-  ret void<br>
-}<br>
-<br>
-define dso_local void @qux() !dbg !11 {<br>
-  ret void<br>
-}<br>
-<br>
-!<a href="http://llvm.dbg.cu" rel="noreferrer" target="_blank">llvm.dbg.cu</a> = !{!0, !2}<br>
-!llvm.module.flags = !{!4, !5}<br>
-<br>
-!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1)<br>
-; CHECK: !1 = !DIFile(filename: "foo.c", directory: "dir", source: "void foo() { }\0A")<br>
-!1 = !DIFile(filename: "foo.c", directory: "dir", source: "void foo() { }\0A")<br>
-!2 = distinct !DICompileUnit(language: DW_LANG_C99, file: !3)<br>
-; CHECK: !3 = !DIFile(filename: "qux.h", directory: "dir")<br>
-!3 = !DIFile(filename: "qux.h", directory: "dir")<br>
-!4 = !{i32 2, !"Dwarf Version", i32 5}<br>
-!5 = !{i32 2, !"Debug Info Version", i32 3}<br>
-!6 = distinct !DISubprogram(name: "foo", file: !1, unit: !0)<br>
-!7 = distinct !DISubprogram(name: "bar", file: !8, unit: !0)<br>
-; CHECK: !8 = !DIFile(filename: "bar.h", directory: "dir", source: "void bar() { }\0A")<br>
-!8 = !DIFile(filename: "bar.h", directory: "dir", source: "void bar() { }\0A")<br>
-!9 = distinct !DISubprogram(name: "baz", file: !10, unit: !2)<br>
-; CHECK: !10 = !DIFile(filename: "baz.c", directory: "dir")<br>
-!10 = !DIFile(filename: "baz.c", directory: "dir")<br>
-!11 = distinct !DISubprogram(name: "qux", file: !3, unit: !2)<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>