[gn build] (manually) port 0b2bc69ba29
authorNico Weber <thakis@chromium.org>
Fri, 23 Apr 2021 02:40:53 +0000 (22:40 -0400)
committerNico Weber <thakis@chromium.org>
Fri, 23 Apr 2021 02:40:53 +0000 (22:40 -0400)
llvm/utils/gn/secondary/llvm/lib/Target/WebAssembly/AsmParser/BUILD.gn
llvm/utils/gn/secondary/llvm/lib/Target/WebAssembly/BUILD.gn
llvm/utils/gn/secondary/llvm/lib/Target/WebAssembly/Disassembler/BUILD.gn
llvm/utils/gn/secondary/llvm/lib/Target/WebAssembly/MCTargetDesc/BUILD.gn
llvm/utils/gn/secondary/llvm/lib/Target/WebAssembly/Utils/BUILD.gn [new file with mode: 0644]

index d7180b5..ce29b35 100644 (file)
@@ -15,6 +15,7 @@ static_library("AsmParser") {
     "//llvm/lib/Support",
     "//llvm/lib/Target/WebAssembly/MCTargetDesc",
     "//llvm/lib/Target/WebAssembly/TargetInfo",
+    "//llvm/lib/Target/WebAssembly/Utils",
   ]
   include_dirs = [ ".." ]
   sources = [ "WebAssemblyAsmParser.cpp" ]
index dba1f98..5e3c4e7 100644 (file)
@@ -72,7 +72,6 @@ static_library("LLVMWebAssemblyCodeGen") {
     "WebAssemblyTargetMachine.cpp",
     "WebAssemblyTargetObjectFile.cpp",
     "WebAssemblyTargetTransformInfo.cpp",
-    "WebAssemblyUtilities.cpp",
   ]
 }
 
index 8a86b67..e78002e 100644 (file)
@@ -15,6 +15,7 @@ static_library("Disassembler") {
     "//llvm/lib/Support",
     "//llvm/lib/Target/WebAssembly/MCTargetDesc",
     "//llvm/lib/Target/WebAssembly/TargetInfo",
+    "//llvm/lib/Target/WebAssembly/Utils",
   ]
   include_dirs = [ ".." ]
   sources = [ "WebAssemblyDisassembler.cpp" ]
index 2249138..0fd628c 100644 (file)
@@ -13,7 +13,7 @@ tablegen("WebAssemblyGenMCCodeEmitter") {
 }
 
 tablegen("WebAssemblyGenRegisterInfo") {
-  visibility = [ ":MCTargetDesc" ]
+  visibility = [ ":tablegen" ]
   args = [ "-gen-register-info" ]
   td_file = "../WebAssembly.td"
 }
@@ -24,6 +24,17 @@ tablegen("WebAssemblyGenSubtargetInfo") {
   td_file = "../WebAssembly.td"
 }
 
+# This should contain tablegen targets generating .inc files included
+# by other targets. .inc files only used by .cpp files in this directory
+# should be in deps on the static_library instead.
+group("tablegen") {
+  visibility = [
+    ":MCTargetDesc",
+    "../Utils",
+  ]
+  public_deps = [ ":WebAssemblyGenRegisterInfo" ]
+}
+
 static_library("MCTargetDesc") {
   output_name = "LLVMWebAssemblyDesc"
 
@@ -31,7 +42,7 @@ static_library("MCTargetDesc") {
   # by other targets. .inc files only used by .cpp files in this directory
   # should be in deps instead.
   public_deps = [
-    ":WebAssemblyGenRegisterInfo",
+    ":tablegen",
     ":WebAssemblyGenSubtargetInfo",
   ]
   deps = [
@@ -40,6 +51,7 @@ static_library("MCTargetDesc") {
     "//llvm/lib/MC",
     "//llvm/lib/Support",
     "//llvm/lib/Target/WebAssembly/TargetInfo",
+    "//llvm/lib/Target/WebAssembly/Utils",
   ]
   include_dirs = [ ".." ]
   sources = [
diff --git a/llvm/utils/gn/secondary/llvm/lib/Target/WebAssembly/Utils/BUILD.gn b/llvm/utils/gn/secondary/llvm/lib/Target/WebAssembly/Utils/BUILD.gn
new file mode 100644 (file)
index 0000000..d9f36d2
--- /dev/null
@@ -0,0 +1,19 @@
+static_library("Utils") {
+  output_name = "LLVMWebAssemblyUtils"
+  deps = [
+    "//llvm/lib/CodeGen",
+    "//llvm/lib/IR",
+    "//llvm/lib/MC",
+    "//llvm/lib/Support",
+
+    # MCTargetDesc depends on Utils, so we can't depend on the full
+    # MCTargetDesc target here: it would form a cycle.
+    "//llvm/lib/Target/WebAssembly/MCTargetDesc:tablegen",
+    "//llvm/lib/Target/WebAssembly/TargetInfo",
+  ]
+  include_dirs = [ ".." ]
+  sources = [
+    "WebAssemblyUtilities.cpp",
+    "WebAssemblyTypeUtilities.cpp",
+  ]
+}