Update llvm 10 Darwin config

Ran 'python3 third_party/llvm-10.0/scripts/update.py darwin' to regenerate new linux
configs that use options specified in the script.

* Removes targets we don't need to support, since the update.py script specifies the exact targets we want to build. When Ben first added LLVM 10 configs, he ran the default build, which built all targets.

* It also removes defines for certain options that were in update.py. Again, Ben's initial run was not done with update.py, which explains the differences.

Bug: b/152339534
Change-Id: Ie09972a0ba493508884bcfd08e418ca456a8e4cc
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/46268
Kokoro-Result: kokoro <noreply+kokoro@google.com>
Tested-by: Antonio Maiorano <amaiorano@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
diff --git a/third_party/llvm-10.0/configs/darwin/include/llvm/Config/AsmParsers.def b/third_party/llvm-10.0/configs/darwin/include/llvm/Config/AsmParsers.def
index 6d84e12..bce0713 100644
--- a/third_party/llvm-10.0/configs/darwin/include/llvm/Config/AsmParsers.def
+++ b/third_party/llvm-10.0/configs/darwin/include/llvm/Config/AsmParsers.def
@@ -24,21 +24,21 @@
 #  error Please define the macro LLVM_ASM_PARSER(TargetName)
 #endif
 
+#if defined(__aarch64__)
 LLVM_ASM_PARSER(AArch64)
-LLVM_ASM_PARSER(AMDGPU)
+#endif
+#if defined(__arm__)
 LLVM_ASM_PARSER(ARM)
-LLVM_ASM_PARSER(AVR)
-LLVM_ASM_PARSER(BPF)
-LLVM_ASM_PARSER(Hexagon)
-LLVM_ASM_PARSER(Lanai)
-LLVM_ASM_PARSER(Mips)
-LLVM_ASM_PARSER(MSP430)
-LLVM_ASM_PARSER(PowerPC)
-LLVM_ASM_PARSER(RISCV)
-LLVM_ASM_PARSER(Sparc)
-LLVM_ASM_PARSER(SystemZ)
-LLVM_ASM_PARSER(WebAssembly)
+#endif
+#if defined(__i386__) || defined(__x86_64__)
 LLVM_ASM_PARSER(X86)
+#endif
+#if defined(__mips__)
+LLVM_ASM_PARSER(Mips)
+#endif
+#if defined(__powerpc64__)
+LLVM_ASM_PARSER(PowerPC)
+#endif
 
 
 #undef LLVM_ASM_PARSER
diff --git a/third_party/llvm-10.0/configs/darwin/include/llvm/Config/AsmPrinters.def b/third_party/llvm-10.0/configs/darwin/include/llvm/Config/AsmPrinters.def
index 335e10b..112b1a4 100644
--- a/third_party/llvm-10.0/configs/darwin/include/llvm/Config/AsmPrinters.def
+++ b/third_party/llvm-10.0/configs/darwin/include/llvm/Config/AsmPrinters.def
@@ -24,23 +24,21 @@
 #  error Please define the macro LLVM_ASM_PRINTER(TargetName)
 #endif
 
+#if defined(__aarch64__)
 LLVM_ASM_PRINTER(AArch64)
-LLVM_ASM_PRINTER(AMDGPU)
+#endif
+#if defined(__arm__)
 LLVM_ASM_PRINTER(ARM)
-LLVM_ASM_PRINTER(AVR)
-LLVM_ASM_PRINTER(BPF)
-LLVM_ASM_PRINTER(Hexagon)
-LLVM_ASM_PRINTER(Lanai)
-LLVM_ASM_PRINTER(Mips)
-LLVM_ASM_PRINTER(MSP430)
-LLVM_ASM_PRINTER(NVPTX)
-LLVM_ASM_PRINTER(PowerPC)
-LLVM_ASM_PRINTER(RISCV)
-LLVM_ASM_PRINTER(Sparc)
-LLVM_ASM_PRINTER(SystemZ)
-LLVM_ASM_PRINTER(WebAssembly)
+#endif
+#if defined(__i386__) || defined(__x86_64__)
 LLVM_ASM_PRINTER(X86)
-LLVM_ASM_PRINTER(XCore)
+#endif
+#if defined(__mips__)
+LLVM_ASM_PRINTER(Mips)
+#endif
+#if defined(__powerpc64__)
+LLVM_ASM_PRINTER(PowerPC)
+#endif
 
 
 #undef LLVM_ASM_PRINTER
diff --git a/third_party/llvm-10.0/configs/darwin/include/llvm/Config/Disassemblers.def b/third_party/llvm-10.0/configs/darwin/include/llvm/Config/Disassemblers.def
index f119100..850983c 100644
--- a/third_party/llvm-10.0/configs/darwin/include/llvm/Config/Disassemblers.def
+++ b/third_party/llvm-10.0/configs/darwin/include/llvm/Config/Disassemblers.def
@@ -24,22 +24,21 @@
 #  error Please define the macro LLVM_DISASSEMBLER(TargetName)
 #endif
 
+#if defined(__aarch64__)
 LLVM_DISASSEMBLER(AArch64)
-LLVM_DISASSEMBLER(AMDGPU)
+#endif
+#if defined(__arm__)
 LLVM_DISASSEMBLER(ARM)
-LLVM_DISASSEMBLER(AVR)
-LLVM_DISASSEMBLER(BPF)
-LLVM_DISASSEMBLER(Hexagon)
-LLVM_DISASSEMBLER(Lanai)
-LLVM_DISASSEMBLER(Mips)
-LLVM_DISASSEMBLER(MSP430)
-LLVM_DISASSEMBLER(PowerPC)
-LLVM_DISASSEMBLER(RISCV)
-LLVM_DISASSEMBLER(Sparc)
-LLVM_DISASSEMBLER(SystemZ)
-LLVM_DISASSEMBLER(WebAssembly)
+#endif
+#if defined(__i386__) || defined(__x86_64__)
 LLVM_DISASSEMBLER(X86)
-LLVM_DISASSEMBLER(XCore)
+#endif
+#if defined(__mips__)
+LLVM_DISASSEMBLER(Mips)
+#endif
+#if defined(__powerpc64__)
+LLVM_DISASSEMBLER(PowerPC)
+#endif
 
 
 #undef LLVM_DISASSEMBLER
diff --git a/third_party/llvm-10.0/configs/darwin/include/llvm/Config/Targets.def b/third_party/llvm-10.0/configs/darwin/include/llvm/Config/Targets.def
index 512f416..103d30a 100644
--- a/third_party/llvm-10.0/configs/darwin/include/llvm/Config/Targets.def
+++ b/third_party/llvm-10.0/configs/darwin/include/llvm/Config/Targets.def
@@ -23,23 +23,21 @@
 #  error Please define the macro LLVM_TARGET(TargetName)
 #endif
 
+#if defined(__aarch64__)
 LLVM_TARGET(AArch64)
-LLVM_TARGET(AMDGPU)
+#endif
+#if defined(__arm__)
 LLVM_TARGET(ARM)
-LLVM_TARGET(AVR)
-LLVM_TARGET(BPF)
-LLVM_TARGET(Hexagon)
-LLVM_TARGET(Lanai)
-LLVM_TARGET(Mips)
-LLVM_TARGET(MSP430)
-LLVM_TARGET(NVPTX)
-LLVM_TARGET(PowerPC)
-LLVM_TARGET(RISCV)
-LLVM_TARGET(Sparc)
-LLVM_TARGET(SystemZ)
-LLVM_TARGET(WebAssembly)
+#endif
+#if defined(__i386__) || defined(__x86_64__)
 LLVM_TARGET(X86)
-LLVM_TARGET(XCore)
+#endif
+#if defined(__mips__)
+LLVM_TARGET(Mips)
+#endif
+#if defined(__powerpc64__)
+LLVM_TARGET(PowerPC)
+#endif
 
 
 #undef LLVM_TARGET
diff --git a/third_party/llvm-10.0/configs/darwin/include/llvm/Config/abi-breaking.h b/third_party/llvm-10.0/configs/darwin/include/llvm/Config/abi-breaking.h
index e3ed314..fd32bf3 100644
--- a/third_party/llvm-10.0/configs/darwin/include/llvm/Config/abi-breaking.h
+++ b/third_party/llvm-10.0/configs/darwin/include/llvm/Config/abi-breaking.h
@@ -13,7 +13,7 @@
 #define LLVM_ABI_BREAKING_CHECKS_H
 
 /* Define to enable checks that alter the LLVM C++ ABI */
-#define LLVM_ENABLE_ABI_BREAKING_CHECKS 1
+#define LLVM_ENABLE_ABI_BREAKING_CHECKS 0
 
 /* Define to enable reverse iteration of unordered llvm containers */
 #define LLVM_ENABLE_REVERSE_ITERATION 0
diff --git a/third_party/llvm-10.0/configs/darwin/include/llvm/Config/config.h b/third_party/llvm-10.0/configs/darwin/include/llvm/Config/config.h
index 11f556f..1d39eb8 100644
--- a/third_party/llvm-10.0/configs/darwin/include/llvm/Config/config.h
+++ b/third_party/llvm-10.0/configs/darwin/include/llvm/Config/config.h
@@ -8,18 +8,18 @@
 #define BUG_REPORT_URL "https://bugs.llvm.org/"
 
 /* Define to 1 to enable backtraces, and to 0 otherwise. */
-#define ENABLE_BACKTRACES 1
+/* #undef ENABLE_BACKTRACES */
 
 /* Define to 1 to enable crash overrides, and to 0 otherwise. */
-#define ENABLE_CRASH_OVERRIDES 1
+/* #undef ENABLE_CRASH_OVERRIDES */
 
 /* Define to 1 to enable crash memory dumps, and to 0 otherwise. */
 #define LLVM_ENABLE_CRASH_DUMPS 0
 
 /* Define to 1 if you have the `backtrace' function. */
-#define HAVE_BACKTRACE TRUE
+/* #undef HAVE_BACKTRACE */
 
-#define BACKTRACE_HEADER <execinfo.h>
+/* #undef BACKTRACE_HEADER */
 
 /* Define to 1 if you have the <CrashReporterClient.h> header file. */
 /* #undef HAVE_CRASHREPORTERCLIENT_H */
@@ -92,7 +92,7 @@
 #define HAVE_ISATTY 1
 
 /* Define to 1 if you have the `edit' library (-ledit). */
-#define HAVE_LIBEDIT 1
+/* #undef HAVE_LIBEDIT */
 
 /* Define to 1 if you have the `pfm' library (-lpfm). */
 /* #undef HAVE_LIBPFM */
@@ -104,13 +104,13 @@
 #define HAVE_LIBPTHREAD 1
 
 /* Define to 1 if you have the `pthread_getname_np' function. */
-#define HAVE_PTHREAD_GETNAME_NP 1
+/* #undef HAVE_PTHREAD_GETNAME_NP */
 
 /* Define to 1 if you have the `pthread_setname_np' function. */
-#define HAVE_PTHREAD_SETNAME_NP 1
+/* #undef HAVE_PTHREAD_SETNAME_NP */
 
 /* Define to 1 if you have the `z' library (-lz). */
-#define HAVE_LIBZ 1
+/* #undef HAVE_LIBZ */
 
 /* Define to 1 if you have the <link.h> header file. */
 /* #undef HAVE_LINK_H */
@@ -137,7 +137,7 @@
 /* #undef HAVE_POSIX_FALLOCATE */
 
 /* Define to 1 if you have the `posix_spawn' function. */
-#define HAVE_POSIX_SPAWN 1
+/* #undef HAVE_POSIX_SPAWN */
 
 /* Define to 1 if you have the `pread' function. */
 #define HAVE_PREAD 1
@@ -212,13 +212,13 @@
 #define HAVE_SYS_TYPES_H 1
 
 /* Define if the setupterm() function is supported this platform. */
-/* #define HAVE_TERMINFO 1 */
+/* #undef HAVE_TERMINFO */
 
 /* Define if the xar_open() function is supported this platform. */
 #define HAVE_LIBXAR 1
 
 /* Define to 1 if you have the <termios.h> header file. */
-#define HAVE_TERMIOS_H 1
+/* #undef HAVE_TERMIOS_H */
 
 /* Define to 1 if you have the <unistd.h> header file. */
 #define HAVE_UNISTD_H 1
@@ -227,7 +227,7 @@
 /* #undef HAVE_VALGRIND_VALGRIND_H */
 
 /* Define to 1 if you have the <zlib.h> header file. */
-#define HAVE_ZLIB_H 1
+/* #undef HAVE_ZLIB_H */
 
 /* Have host's _alloca */
 /* #undef HAVE__ALLOCA */
@@ -236,7 +236,7 @@
 /* #undef HAVE__CHSIZE_S */
 
 /* Define to 1 if you have the `_Unwind_Backtrace' function. */
-#define HAVE__UNWIND_BACKTRACE 1
+/* #undef HAVE__UNWIND_BACKTRACE */
 
 /* Have host's __alloca */
 /* #undef HAVE___ALLOCA */
@@ -294,10 +294,14 @@
 
 /* Target triple LLVM will generate code for by default */
 /* Doesn't use `cmakedefine` because it is allowed to be empty. */
-#define LLVM_DEFAULT_TARGET_TRIPLE "x86_64-apple-darwin19.3.0"
+#if defined(__x86_64__)
+#define LLVM_DEFAULT_TARGET_TRIPLE "x86_64-apple-darwin"
+#else
+#error "unknown architecture"
+#endif
 
 /* Define if zlib compression is available */
-#define LLVM_ENABLE_ZLIB 1
+#define LLVM_ENABLE_ZLIB 0
 
 /* Define if overriding target triple is enabled */
 /* #undef LLVM_TARGET_TRIPLE_ENV */
@@ -309,7 +313,7 @@
 #define LLVM_VERSION_PRINTER_SHOW_HOST_TARGET_INFO 1
 
 /* Define if libxml2 is supported on this platform. */
-#define LLVM_LIBXML2_ENABLED 1
+/* #undef LLVM_LIBXML2_ENABLED */
 
 /* Define to the extension used for shared libraries, say, ".so". */
 #define LTDL_SHLIB_EXT ".dylib"
@@ -321,10 +325,10 @@
 #define PACKAGE_NAME "LLVM"
 
 /* Define to the full name and version of this package. */
-#define PACKAGE_STRING "LLVM 11.0.0git"
+#define PACKAGE_STRING "LLVM 10.0.0"
 
 /* Define to the version of this package. */
-#define PACKAGE_VERSION "11.0.0git"
+#define PACKAGE_VERSION "10.0.0"
 
 /* Define to the vendor of this package. */
 /* #undef PACKAGE_VENDOR */
@@ -351,6 +355,6 @@
 /* #undef LLVM_GISEL_COV_PREFIX */
 
 /* Whether Timers signpost passes in Xcode Instruments */
-#define LLVM_SUPPORT_XCODE_SIGNPOSTS 1
+#define LLVM_SUPPORT_XCODE_SIGNPOSTS 0
 
 #endif
diff --git a/third_party/llvm-10.0/configs/darwin/include/llvm/Config/llvm-config.h b/third_party/llvm-10.0/configs/darwin/include/llvm/Config/llvm-config.h
index 527cb0c..b09df0d 100644
--- a/third_party/llvm-10.0/configs/darwin/include/llvm/Config/llvm-config.h
+++ b/third_party/llvm-10.0/configs/darwin/include/llvm/Config/llvm-config.h
@@ -14,11 +14,25 @@
 #ifndef LLVM_CONFIG_H
 #define LLVM_CONFIG_H
 
+#if !defined(__i386__) && defined(_M_IX86)
+#define __i386__ 1
+#endif
+
+#if !defined(__x86_64__) && (defined(_M_AMD64) || defined (_M_X64))
+#define __x86_64__ 1
+#endif
+
+#define LLVM_CONFIG_H
+
 /* Define if LLVM_ENABLE_DUMP is enabled */
 /* #undef LLVM_ENABLE_DUMP */
 
 /* Target triple LLVM will generate code for by default */
-#define LLVM_DEFAULT_TARGET_TRIPLE "x86_64-apple-darwin19.3.0"
+#if defined(__x86_64__)
+#define LLVM_DEFAULT_TARGET_TRIPLE "x86_64-apple-darwin"
+#else
+#error "unknown architecture"
+#endif
 
 /* Define if threads enabled */
 #define LLVM_ENABLE_THREADS 1
@@ -27,28 +41,116 @@
 #define LLVM_HAS_ATOMICS 1
 
 /* Host triple LLVM will be executed on */
-#define LLVM_HOST_TRIPLE "x86_64-apple-darwin19.3.0"
+#if defined(__x86_64__)
+#define LLVM_HOST_TRIPLE "x86_64-apple-darwin"
+#else
+#error "unknown architecture"
+#endif
 
 /* LLVM architecture name for the native architecture, if available */
+#if defined(__aarch64__)
+#define LLVM_NATIVE_ARCH AArch64
+#elif defined(__arm__)
+#define LLVM_NATIVE_ARCH ARM
+#elif defined(__i386__) || defined(__x86_64__)
 #define LLVM_NATIVE_ARCH X86
+#elif defined(__mips__)
+#define LLVM_NATIVE_ARCH Mips
+#elif defined(__powerpc64__)
+#define LLVM_NATIVE_ARCH PowerPC
+#else
+#error "unknown architecture"
+#endif
 
 /* LLVM name for the native AsmParser init function, if available */
+#if defined(__aarch64__)
+#define LLVM_NATIVE_ASMPARSER LLVMInitializeAArch64AsmParser
+#elif defined(__arm__)
+#define LLVM_NATIVE_ASMPARSER LLVMInitializeARMAsmParser
+#elif defined(__i386__) || defined(__x86_64__)
 #define LLVM_NATIVE_ASMPARSER LLVMInitializeX86AsmParser
+#elif defined(__mips__)
+#define LLVM_NATIVE_ASMPARSER LLVMInitializeMipsAsmParser
+#elif defined(__powerpc64__)
+#define LLVM_NATIVE_ASMPARSER LLVMInitializePowerPCAsmParser
+#else
+#error "unknown architecture"
+#endif
 
 /* LLVM name for the native AsmPrinter init function, if available */
+#if defined(__aarch64__)
+#define LLVM_NATIVE_ASMPRINTER LLVMInitializeAArch64AsmPrinter
+#elif defined(__arm__)
+#define LLVM_NATIVE_ASMPRINTER LLVMInitializeARMAsmPrinter
+#elif defined(__i386__) || defined(__x86_64__)
 #define LLVM_NATIVE_ASMPRINTER LLVMInitializeX86AsmPrinter
+#elif defined(__mips__)
+#define LLVM_NATIVE_ASMPRINTER LLVMInitializeMipsAsmPrinter
+#elif defined(__powerpc64__)
+#define LLVM_NATIVE_ASMPRINTER LLVMInitializePowerPCAsmPrinter
+#else
+#error "unknown architecture"
+#endif
 
 /* LLVM name for the native Disassembler init function, if available */
+#if defined(__aarch64__)
+#define LLVM_NATIVE_DISASSEMBLER LLVMInitializeAArch64Disassembler
+#elif defined(__arm__)
+#define LLVM_NATIVE_DISASSEMBLER LLVMInitializeARMDisassembler
+#elif defined(__i386__) || defined(__x86_64__)
 #define LLVM_NATIVE_DISASSEMBLER LLVMInitializeX86Disassembler
+#elif defined(__mips__)
+#define LLVM_NATIVE_DISASSEMBLER LLVMInitializeMipsDisassembler
+#elif defined(__powerpc64__)
+#define LLVM_NATIVE_DISASSEMBLER LLVMInitializePowerPCDisassembler
+#else
+#error "unknown architecture"
+#endif
 
 /* LLVM name for the native Target init function, if available */
+#if defined(__aarch64__)
+#define LLVM_NATIVE_TARGET LLVMInitializeAArch64Target
+#elif defined(__arm__)
+#define LLVM_NATIVE_TARGET LLVMInitializeARMTarget
+#elif defined(__i386__) || defined(__x86_64__)
 #define LLVM_NATIVE_TARGET LLVMInitializeX86Target
+#elif defined(__mips__)
+#define LLVM_NATIVE_TARGET LLVMInitializeMipsTarget
+#elif defined(__powerpc64__)
+#define LLVM_NATIVE_TARGET LLVMInitializePowerPCTarget
+#else
+#error "unknown architecture"
+#endif
 
 /* LLVM name for the native TargetInfo init function, if available */
+#if defined(__aarch64__)
+#define LLVM_NATIVE_TARGETINFO LLVMInitializeAArch64TargetInfo
+#elif defined(__arm__)
+#define LLVM_NATIVE_TARGETINFO LLVMInitializeARMTargetInfo
+#elif defined(__i386__) || defined(__x86_64__)
 #define LLVM_NATIVE_TARGETINFO LLVMInitializeX86TargetInfo
+#elif defined(__mips__)
+#define LLVM_NATIVE_TARGETINFO LLVMInitializeMipsTargetInfo
+#elif defined(__powerpc64__)
+#define LLVM_NATIVE_TARGETINFO LLVMInitializePowerPCTargetInfo
+#else
+#error "unknown architecture"
+#endif
 
 /* LLVM name for the native target MC init function, if available */
+#if defined(__aarch64__)
+#define LLVM_NATIVE_TARGETMC LLVMInitializeAArch64TargetMC
+#elif defined(__arm__)
+#define LLVM_NATIVE_TARGETMC LLVMInitializeARMTargetMC
+#elif defined(__i386__) || defined(__x86_64__)
 #define LLVM_NATIVE_TARGETMC LLVMInitializeX86TargetMC
+#elif defined(__mips__)
+#define LLVM_NATIVE_TARGETMC LLVMInitializeMipsTargetMC
+#elif defined(__powerpc64__)
+#define LLVM_NATIVE_TARGETMC LLVMInitializePowerPCTargetMC
+#else
+#error "unknown architecture"
+#endif
 
 /* Define if this is Unixish platform */
 #define LLVM_ON_UNIX 1
@@ -72,7 +174,7 @@
 #define LLVM_VERSION_PATCH 0
 
 /* LLVM version string */
-#define LLVM_VERSION_STRING "11.0.0git"
+#define LLVM_VERSION_STRING "10.0.0"
 
 /* Whether LLVM records statistics for use with GetStatistics(),
  * PrintStatistics() or PrintStatisticsJSON()