[llvm] 4ac51dd - [gn build] Port core part of f09cf34d0062

Nico Weber via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 20 06:46:21 PST 2022


Author: Nico Weber
Date: 2022-12-20T09:46:14-05:00
New Revision: 4ac51dd53d93b8dd18c58093766483c657fe3a08

URL: https://github.com/llvm/llvm-project/commit/4ac51dd53d93b8dd18c58093766483c657fe3a08
DIFF: https://github.com/llvm/llvm-project/commit/4ac51dd53d93b8dd18c58093766483c657fe3a08.diff

LOG: [gn build] Port core part of f09cf34d0062

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.

Added: 
    llvm/utils/gn/secondary/llvm/lib/TargetParser/BUILD.gn
    llvm/utils/gn/secondary/llvm/unittests/TargetParser/BUILD.gn

Modified: 
    llvm/utils/gn/secondary/llvm/lib/Support/BUILD.gn
    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

Removed: 
    


################################################################################
diff  --git a/llvm/utils/gn/secondary/llvm/lib/Support/BUILD.gn b/llvm/utils/gn/secondary/llvm/lib/Support/BUILD.gn
index 1b0b2c01db4b..3f0deccadda8 100644
--- a/llvm/utils/gn/secondary/llvm/lib/Support/BUILD.gn
+++ b/llvm/utils/gn/secondary/llvm/lib/Support/BUILD.gn
@@ -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
index 000000000000..ba127b291d88
--- /dev/null
+++ b/llvm/utils/gn/secondary/llvm/lib/TargetParser/BUILD.gn
@@ -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",
+  ]
+}

diff  --git a/llvm/utils/gn/secondary/llvm/unittests/ADT/BUILD.gn b/llvm/utils/gn/secondary/llvm/unittests/ADT/BUILD.gn
index bb0481f89ced..a29dfc1290ce 100644
--- a/llvm/utils/gn/secondary/llvm/unittests/ADT/BUILD.gn
+++ b/llvm/utils/gn/secondary/llvm/unittests/ADT/BUILD.gn
@@ -85,7 +85,6 @@ unittest("ADTTests") {
     "StringSetTest.cpp",
     "StringSwitchTest.cpp",
     "TinyPtrVectorTest.cpp",
-    "TripleTest.cpp",
     "TwineTest.cpp",
     "TypeSwitchTest.cpp",
     "TypeTraitsTest.cpp",

diff  --git a/llvm/utils/gn/secondary/llvm/unittests/BUILD.gn b/llvm/utils/gn/secondary/llvm/unittests/BUILD.gn
index dde0c8ac4e36..2a150cf8faaa 100644
--- a/llvm/utils/gn/secondary/llvm/unittests/BUILD.gn
+++ b/llvm/utils/gn/secondary/llvm/unittests/BUILD.gn
@@ -44,6 +44,7 @@ group("unittests") {
     "Support:SupportTests",
     "Support/DynamicLibrary:DynamicLibraryTests",
     "TableGen:TableGenTests",
+    "TargetParser:TargetParserTests",
     "Testing/ADT:TestingADTTests",
     "Testing/Support:TestingSupportTests",
     "TextAPI:TextAPITests",

diff  --git a/llvm/utils/gn/secondary/llvm/unittests/Support/BUILD.gn b/llvm/utils/gn/secondary/llvm/unittests/Support/BUILD.gn
index ab388b84f5e7..92a722957acc 100644
--- a/llvm/utils/gn/secondary/llvm/unittests/Support/BUILD.gn
+++ b/llvm/utils/gn/secondary/llvm/unittests/Support/BUILD.gn
@@ -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
index 000000000000..df5fb3fb3a6a
--- /dev/null
+++ b/llvm/utils/gn/secondary/llvm/unittests/TargetParser/BUILD.gn
@@ -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",
+  ]
+}


        


More information about the llvm-commits mailing list