[gn build] Port core part of f09cf34d0062
authorNico Weber <thakis@chromium.org>
Tue, 20 Dec 2022 14:42:45 +0000 (09:42 -0500)
committerNico Weber <thakis@chromium.org>
Tue, 20 Dec 2022 14:46:14 +0000 (09:46 -0500)
For now, this adds a dep from Support on the new TargetParser library
instead of the other way round. That'll be fixed in a mechanical follow-up.

llvm/utils/gn/secondary/llvm/lib/Support/BUILD.gn
llvm/utils/gn/secondary/llvm/lib/TargetParser/BUILD.gn [new file with mode: 0644]
llvm/utils/gn/secondary/llvm/unittests/ADT/BUILD.gn
llvm/utils/gn/secondary/llvm/unittests/BUILD.gn
llvm/utils/gn/secondary/llvm/unittests/Support/BUILD.gn
llvm/utils/gn/secondary/llvm/unittests/TargetParser/BUILD.gn [new file with mode: 0644]

index 1b0b2c0..3f0decc 100644 (file)
@@ -4,6 +4,9 @@ static_library("Support") {
     "BLAKE3",
     "//llvm/include/llvm/Config:config",
     "//llvm/lib/Demangle",
+
+    # FIXME: Remove this dep.
+    "//llvm/lib/TargetParser",
     "//llvm/utils/gn/build/libs/pthread",
     "//llvm/utils/gn/build/libs/terminfo",
     "//llvm/utils/gn/build/libs/zlib",
@@ -32,7 +35,6 @@ static_library("Support") {
     "Windows",
   ]
   sources = [
-    "AArch64TargetParser.cpp",
     "ABIBreak.cpp",
     "AMDGPUMetadata.cpp",
     "APFixedPoint.cpp",
@@ -41,8 +43,6 @@ static_library("Support") {
     "APSInt.cpp",
     "ARMAttributeParser.cpp",
     "ARMBuildAttrs.cpp",
-    "ARMTargetParser.cpp",
-    "ARMTargetParserCommon.cpp",
     "ARMWinEH.cpp",
     "AddressRanges.cpp",
     "Allocator.cpp",
@@ -59,7 +59,6 @@ static_library("Support") {
     "CRC.cpp",
     "CSKYAttributeParser.cpp",
     "CSKYAttributes.cpp",
-    "CSKYTargetParser.cpp",
     "CachePruning.cpp",
     "Caching.cpp",
     "Chrono.cpp",
@@ -101,7 +100,6 @@ static_library("Support") {
     "LineIterator.cpp",
     "Locale.cpp",
     "LockFileManager.cpp",
-    "LoongArchTargetParser.cpp",
     "LowLevelType.cpp",
     "MD5.cpp",
     "MSP430AttributeParser.cpp",
@@ -119,7 +117,6 @@ static_library("Support") {
     "PrettyStackTrace.cpp",
     "RISCVAttributeParser.cpp",
     "RISCVAttributes.cpp",
-    "RISCVISAInfo.cpp",
     "RWMutex.cpp",
     "RandomNumberGenerator.cpp",
     "Regex.cpp",
@@ -141,13 +138,11 @@ static_library("Support") {
     "SymbolRemappingReader.cpp",
     "SystemUtils.cpp",
     "TarWriter.cpp",
-    "TargetParser.cpp",
     "ThreadPool.cpp",
     "TimeProfiler.cpp",
     "Timer.cpp",
     "ToolOutputFile.cpp",
     "TrigramIndex.cpp",
-    "Triple.cpp",
     "Twine.cpp",
     "TypeSize.cpp",
     "Unicode.cpp",
@@ -156,7 +151,6 @@ static_library("Support") {
     "UnicodeNameToCodepointGenerated.cpp",
     "VersionTuple.cpp",
     "WithColor.cpp",
-    "X86TargetParser.cpp",
     "YAMLParser.cpp",
     "YAMLTraits.cpp",
     "Z3Solver.cpp",
@@ -174,7 +168,6 @@ static_library("Support") {
     "Atomic.cpp",
     "DynamicLibrary.cpp",
     "Errno.cpp",
-    "Host.cpp",
     "Memory.cpp",
     "Path.cpp",
     "Process.cpp",
diff --git a/llvm/utils/gn/secondary/llvm/lib/TargetParser/BUILD.gn b/llvm/utils/gn/secondary/llvm/lib/TargetParser/BUILD.gn
new file mode 100644 (file)
index 0000000..ba127b2
--- /dev/null
@@ -0,0 +1,21 @@
+static_library("TargetParser") {
+  output_name = "LLVMTargetParser"
+
+  # FIXME: Make this depend on Support.
+  include_dirs = [
+    "Unix",
+    "Windows",
+  ]
+  sources = [
+    "AArch64TargetParser.cpp",
+    "ARMTargetParserCommon.cpp",
+    "ARMTargetParser.cpp",
+    "CSKYTargetParser.cpp",
+    "Host.cpp",
+    "LoongArchTargetParser.cpp",
+    "RISCVISAInfo.cpp",
+    "TargetParser.cpp",
+    "Triple.cpp",
+    "X86TargetParser.cpp",
+  ]
+}
index bb0481f..a29dfc1 100644 (file)
@@ -85,7 +85,6 @@ unittest("ADTTests") {
     "StringSetTest.cpp",
     "StringSwitchTest.cpp",
     "TinyPtrVectorTest.cpp",
-    "TripleTest.cpp",
     "TwineTest.cpp",
     "TypeSwitchTest.cpp",
     "TypeTraitsTest.cpp",
index dde0c8a..2a150cf 100644 (file)
@@ -44,6 +44,7 @@ group("unittests") {
     "Support:SupportTests",
     "Support/DynamicLibrary:DynamicLibraryTests",
     "TableGen:TableGenTests",
+    "TargetParser:TargetParserTests",
     "Testing/ADT:TestingADTTests",
     "Testing/Support:TestingSupportTests",
     "TextAPI:TextAPITests",
index ab388b8..92a7229 100644 (file)
@@ -20,7 +20,6 @@ unittest("SupportTests") {
     "BranchProbabilityTest.cpp",
     "CRCTest.cpp",
     "CSKYAttributeParserTest.cpp",
-    "CSKYTargetParserTest.cpp",
     "CachePruningTest.cpp",
     "Casting.cpp",
     "CheckedArithmeticTest.cpp",
@@ -47,7 +46,6 @@ unittest("SupportTests") {
     "FormatVariadicTest.cpp",
     "GlobPatternTest.cpp",
     "HashBuilderTest.cpp",
-    "Host.cpp",
     "IndexedAccessorTest.cpp",
     "InstructionCostTest.cpp",
     "ItaniumManglingCanonicalizerTest.cpp",
@@ -83,7 +81,6 @@ unittest("SupportTests") {
     "SwapByteOrderTest.cpp",
     "SymbolRemappingReaderTest.cpp",
     "TarWriterTest.cpp",
-    "TargetParserTest.cpp",
     "TaskQueueTest.cpp",
     "ThreadLocalTest.cpp",
     "ThreadPool.cpp",
diff --git a/llvm/utils/gn/secondary/llvm/unittests/TargetParser/BUILD.gn b/llvm/utils/gn/secondary/llvm/unittests/TargetParser/BUILD.gn
new file mode 100644 (file)
index 0000000..df5fb3f
--- /dev/null
@@ -0,0 +1,15 @@
+import("//third-party/unittest/unittest.gni")
+
+unittest("TargetParserTests") {
+  deps = [
+    "//llvm/lib/Support",
+    "//llvm/lib/TargetParser",
+    "//llvm/lib/Testing/Support",
+  ]
+  sources = [
+    "CSKYTargetParserTest.cpp",
+    "Host.cpp",
+    "TargetParserTest.cpp",
+    "TripleTest.cpp",
+  ]
+}