gn build: Merge r353471, r353373.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353518 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/utils/gn/secondary/clang/include/clang/Config/BUILD.gn b/utils/gn/secondary/clang/include/clang/Config/BUILD.gn
index a3c0d5a..5390832 100644
--- a/utils/gn/secondary/clang/include/clang/Config/BUILD.gn
+++ b/utils/gn/secondary/clang/include/clang/Config/BUILD.gn
@@ -29,7 +29,6 @@
     "CLANG_CONFIG_FILE_USER_DIR=",
     "DEFAULT_SYSROOT=",
     "GCC_INSTALL_PREFIX=",
-    "CLANG_ANALYZER_WITH_Z3=",
     "BACKEND_PACKAGE_STRING=LLVM ${llvm_version}svn",
     "ENABLE_LINKER_BUILD_ID=",
     "ENABLE_X86_RELAX_RELOCATIONS=",
diff --git a/utils/gn/secondary/clang/lib/StaticAnalyzer/Core/BUILD.gn b/utils/gn/secondary/clang/lib/StaticAnalyzer/Core/BUILD.gn
index 745bc23..a9dd15c 100644
--- a/utils/gn/secondary/clang/lib/StaticAnalyzer/Core/BUILD.gn
+++ b/utils/gn/secondary/clang/lib/StaticAnalyzer/Core/BUILD.gn
@@ -48,6 +48,7 @@
     "RangeConstraintManager.cpp",
     "RangedConstraintManager.cpp",
     "RegionStore.cpp",
+    "SMTConstraintManager.cpp",
     "SValBuilder.cpp",
     "SVals.cpp",
     "SarifDiagnostics.cpp",
@@ -58,9 +59,5 @@
     "SymbolManager.cpp",
     "TaintManager.cpp",
     "WorkList.cpp",
-    "Z3ConstraintManager.cpp",
   ]
-
-  # FIXME: clang/Config/BUILD.gn currently always sets CLANG_ANALYZER_WITH_Z3
-  # to false. If that changes we need to link to Z3 libs here.
 }
diff --git a/utils/gn/secondary/clang/test/BUILD.gn b/utils/gn/secondary/clang/test/BUILD.gn
index 681b07c..bdaa97b 100644
--- a/utils/gn/secondary/clang/test/BUILD.gn
+++ b/utils/gn/secondary/clang/test/BUILD.gn
@@ -39,7 +39,7 @@
   output = clang_lit_site_cfg_file
 
   extra_values = [
-    "CLANG_ANALYZER_WITH_Z3=",  # Must be empty, not 0.
+    "LLVM_WITH_Z3=",  # Must be empty, not 0.
     "CLANG_BUILD_EXAMPLES=0",
     "CLANG_DEFAULT_CXX_STDLIB=",  # Empty string means "default value" here.
     "CLANG_TOOLS_DIR=" + rebase_path("$root_out_dir/bin"),
diff --git a/utils/gn/secondary/llvm/include/llvm/Config/BUILD.gn b/utils/gn/secondary/llvm/include/llvm/Config/BUILD.gn
index 4d0a3a8..820f631 100644
--- a/utils/gn/secondary/llvm/include/llvm/Config/BUILD.gn
+++ b/utils/gn/secondary/llvm/include/llvm/Config/BUILD.gn
@@ -124,6 +124,7 @@
     "RETSIGTYPE=void",
     "LLVM_GISEL_COV_ENABLED=",
     "LLVM_GISEL_COV_PREFIX=",
+    "LLVM_WITH_Z3=",
 
     # This is both in llvm-config.h and config.h; llvm-config.h doesn't
     # define it if it's not set while config.h defines it to empty in that case.
diff --git a/utils/gn/secondary/llvm/lib/Support/BUILD.gn b/utils/gn/secondary/llvm/lib/Support/BUILD.gn
index 9a5fbd9..ab5f336 100644
--- a/utils/gn/secondary/llvm/lib/Support/BUILD.gn
+++ b/utils/gn/secondary/llvm/lib/Support/BUILD.gn
@@ -152,10 +152,14 @@
     "Valgrind.cpp",
     "VirtualFileSystem.cpp",
     "Watchdog.cpp",
+    "Z3Solver.cpp",
   ]
 
   libs = []
 
+  # FIXME: llvm/Config/BUILD.gn currently always sets LLVM_WITH_Z3
+  # to false. If that changes we need to link to Z3 libs here.
+
   if (current_os == "linux" || current_os == "android") {
     libs += [ "dl" ]
   }
diff --git a/utils/gn/secondary/llvm/lib/Transforms/InstCombine/BUILD.gn b/utils/gn/secondary/llvm/lib/Transforms/InstCombine/BUILD.gn
index 0082528..d68a007 100644
--- a/utils/gn/secondary/llvm/lib/Transforms/InstCombine/BUILD.gn
+++ b/utils/gn/secondary/llvm/lib/Transforms/InstCombine/BUILD.gn
@@ -17,6 +17,7 @@
   sources = [
     "InstCombineAddSub.cpp",
     "InstCombineAndOrXor.cpp",
+    "InstCombineAtomicRMW.cpp",
     "InstCombineCalls.cpp",
     "InstCombineCasts.cpp",
     "InstCombineCompares.cpp",