]> granicus.if.org Git - llvm/commitdiff
gn build: Cmanually) merge r374590
authorNico Weber <nicolasweber@gmx.de>
Fri, 11 Oct 2019 23:05:24 +0000 (23:05 +0000)
committerNico Weber <nicolasweber@gmx.de>
Fri, 11 Oct 2019 23:05:24 +0000 (23:05 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@374608 91177308-0d34-0410-b5e6-96231b3b80d8

utils/gn/secondary/llvm/lib/Target/targets.gni
utils/gn/secondary/llvm/tools/llvm-exegesis/lib/Mips/BUILD.gn [new file with mode: 0644]
utils/gn/secondary/llvm/unittests/BUILD.gn
utils/gn/secondary/llvm/unittests/tools/llvm-exegesis/Mips/BUILD.gn [new file with mode: 0644]

index e82dd775e07af0b83b8254bb4828a00f5b52734c..8306b5daabccef7998566d4d32d3204e94b21888 100644 (file)
@@ -46,6 +46,7 @@ if (llvm_targets_to_build == "host") {
 llvm_build_AArch64 = false
 llvm_build_ARM = false
 llvm_build_BPF = false
+llvm_build_Mips = false
 llvm_build_PowerPC = false
 llvm_build_WebAssembly = false
 llvm_build_X86 = false
@@ -56,6 +57,8 @@ foreach(target, llvm_targets_to_build) {
     llvm_build_ARM = true
   } else if (target == "BPF") {
     llvm_build_BPF = true
+  } else if (target == "Mips") {
+    llvm_build_Mips = true
   } else if (target == "PowerPC") {
     llvm_build_PowerPC = true
   } else if (target == "WebAssembly") {
@@ -63,17 +66,16 @@ foreach(target, llvm_targets_to_build) {
   } else if (target == "X86") {
     llvm_build_X86 = true
   } else if (target == "AMDGPU" || target == "AVR" || target == "Hexagon" ||
-             target == "Lanai" || target == "Mips" || target == "NVPTX" ||
-             target == "RISCV" || target == "Sparc" || target == "SystemZ") {
+             target == "Lanai" || target == "NVPTX" || target == "RISCV" ||
+             target == "Sparc" || target == "SystemZ") {
     # Nothing to do.
   } else {
     all_targets_string = ""
     foreach(target, llvm_all_targets) {
       all_targets_string += "$0x0a    " + target
     }
-    assert(false,
-           "Unknown target '$target' in llvm_targets_to_build. " +
-               "Known targets:" + all_targets_string)
+    assert(false, "Unknown target '$target' in llvm_targets_to_build. " +
+                      "Known targets:" + all_targets_string)
   }
 }
 
diff --git a/utils/gn/secondary/llvm/tools/llvm-exegesis/lib/Mips/BUILD.gn b/utils/gn/secondary/llvm/tools/llvm-exegesis/lib/Mips/BUILD.gn
new file mode 100644 (file)
index 0000000..61d5f1f
--- /dev/null
@@ -0,0 +1,21 @@
+import("//llvm/utils/TableGen/tablegen.gni")
+
+tablegen("MipsGenExegesis") {
+  args = [ "-gen-exegesis" ]
+  td_file = "//llvm/lib/Target/Mips/Mips.td"
+}
+
+static_library("Mips") {
+  output_name = "LLVMExegesisMips"
+  deps = [
+    ":MipsGenExegesis",
+
+    # Exegesis reaches inside the Target/Mips tablegen internals and must
+    # depend on these Target/Mips-internal build targets.
+    "//llvm/lib/Target/Mips/MCTargetDesc",
+  ]
+  sources = [
+    "Target.cpp",
+  ]
+  include_dirs = [ "//llvm/lib/Target/Mips" ]
+}
index 3d607dd77471172f821926739e62ea11e5250f9e..3ad8f6a50f08f68903b0943c0529e68e560b147a 100644 (file)
@@ -61,12 +61,15 @@ group("unittests") {
       "tools/llvm-exegesis/ARM:LLVMExegesisARMTests",
     ]
   }
-  if (llvm_build_WebAssembly) {
-    deps += [ "Target/WebAssembly:WebAssemblyTests" ]
+  if (llvm_build_Mips) {
+    deps += [ "tools/llvm-exegesis/Mips:LLVMExegesisMipsTests" ]
   }
   if (llvm_build_PowerPC) {
     deps += [ "tools/llvm-exegesis/PowerPC:LLVMExegesisPowerPCTests" ]
   }
+  if (llvm_build_WebAssembly) {
+    deps += [ "Target/WebAssembly:WebAssemblyTests" ]
+  }
   if (llvm_build_X86) {
     deps += [ "tools/llvm-exegesis/X86:LLVMExegesisX86Tests" ]
   }
diff --git a/utils/gn/secondary/llvm/unittests/tools/llvm-exegesis/Mips/BUILD.gn b/utils/gn/secondary/llvm/unittests/tools/llvm-exegesis/Mips/BUILD.gn
new file mode 100644 (file)
index 0000000..c1f6f6e
--- /dev/null
@@ -0,0 +1,25 @@
+import("//llvm/utils/unittest/unittest.gni")
+
+unittest("LLVMExegesisMipsTests") {
+  deps = [
+    "//llvm/lib/DebugInfo/Symbolize",
+    "//llvm/lib/MC",
+    "//llvm/lib/MC/MCParser",
+    "//llvm/lib/Object",
+    "//llvm/lib/Support",
+    "//llvm/lib/Target/Mips",
+
+    # Exegesis reaches inside the Target/Mips tablegen internals and must
+    # depend on these Target/Mips-internal build targets.
+    "//llvm/lib/Target/Mips/MCTargetDesc",
+    "//llvm/tools/llvm-exegesis/lib",
+    "//llvm/tools/llvm-exegesis/lib/Mips",
+  ]
+  include_dirs = [
+    "//llvm/lib/Target/Mips",
+    "//llvm/tools/llvm-exegesis/lib",
+  ]
+  sources = [
+    "TargetTest.cpp",
+  ]
+}