split source files with the same case-insensentive name into different source sets

Avoids mapping llvm/lib/DebugInfo/DWARF/DWARFCompileUnit.cpp and
llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp to the same object file
on a case-insensitive file system.

Might fix https://logs.chromium.org/logs/chromium/buildbucket/cr-buildbucket/8757315701829357889/+/u/compile__with_patch_/raw_io.output_text_failure_summary_

Change-Id: I4595c69993bd9accb7496f67044ccae6201e0343
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/73089
Kokoro-Result: kokoro <noreply+kokoro@google.com>
Commit-Queue: Shahbaz Youssefi <syoussefi@google.com>
Tested-by: Shahbaz Youssefi <syoussefi@google.com>
Reviewed-by: Shahbaz Youssefi <syoussefi@google.com>
Reviewed-by: Corentin Wallez <cwallez@google.com>
diff --git a/third_party/llvm-16.0/BUILD.gn b/third_party/llvm-16.0/BUILD.gn
index f5bde40..c6bd34b 100644
--- a/third_party/llvm-16.0/BUILD.gn
+++ b/third_party/llvm-16.0/BUILD.gn
@@ -617,7 +617,6 @@
     "llvm/lib/DebugInfo/DWARF/DWARFAbbreviationDeclaration.cpp",
     "llvm/lib/DebugInfo/DWARF/DWARFAcceleratorTable.cpp",
     "llvm/lib/DebugInfo/DWARF/DWARFAddressRange.cpp",
-    "llvm/lib/DebugInfo/DWARF/DWARFCompileUnit.cpp",
     "llvm/lib/DebugInfo/DWARF/DWARFContext.cpp",
     "llvm/lib/DebugInfo/DWARF/DWARFDataExtractor.cpp",
     "llvm/lib/DebugInfo/DWARF/DWARFDebugAbbrev.cpp",
@@ -633,13 +632,11 @@
     "llvm/lib/DebugInfo/DWARF/DWARFDebugRangeList.cpp",
     "llvm/lib/DebugInfo/DWARF/DWARFDebugRnglists.cpp",
     "llvm/lib/DebugInfo/DWARF/DWARFDie.cpp",
-    "llvm/lib/DebugInfo/DWARF/DWARFExpression.cpp",
     "llvm/lib/DebugInfo/DWARF/DWARFFormValue.cpp",
     "llvm/lib/DebugInfo/DWARF/DWARFGdbIndex.cpp",
     "llvm/lib/DebugInfo/DWARF/DWARFListTable.cpp",
     "llvm/lib/DebugInfo/DWARF/DWARFTypePrinter.cpp",
     "llvm/lib/DebugInfo/DWARF/DWARFTypeUnit.cpp",
-    "llvm/lib/DebugInfo/DWARF/DWARFUnit.cpp",
     "llvm/lib/DebugInfo/DWARF/DWARFUnitIndex.cpp",
     "llvm/lib/DebugInfo/DWARF/DWARFVerifier.cpp",
     "llvm/lib/Demangle/DLangDemangle.cpp",
@@ -1260,6 +1257,9 @@
 }
 swiftshader_llvm_source_set("swiftshader_llvm_source_set_1") {
   sources = [
+    "llvm/lib/DebugInfo/DWARF/DWARFCompileUnit.cpp",
+    "llvm/lib/DebugInfo/DWARF/DWARFExpression.cpp",
+    "llvm/lib/DebugInfo/DWARF/DWARFUnit.cpp",
     "llvm/lib/ExecutionEngine/JITLink/COFF.cpp",
     "llvm/lib/ExecutionEngine/JITLink/MachO.cpp",
     "llvm/lib/IRPrinter/IRPrintingPasses.cpp",
diff --git a/third_party/llvm-16.0/scripts/generate_build_files.py b/third_party/llvm-16.0/scripts/generate_build_files.py
index 2e4dc73..63dae3e 100755
--- a/third_party/llvm-16.0/scripts/generate_build_files.py
+++ b/third_party/llvm-16.0/scripts/generate_build_files.py
@@ -447,7 +447,8 @@
 def partition_paths(filepaths):
     partitions = []
     for path in filepaths:
-        filename = get_filename(path)
+        # Convert to lower case to support case-insensitive filesystem
+        filename = get_filename(path).lower()
         inserted = False
         for partition in partitions:
             if not filename in partition: