[bazel] Fix some --features=layering_check issues
authorFangrui Song <i@maskray.me>
Thu, 22 Dec 2022 08:12:58 +0000 (00:12 -0800)
committerFangrui Song <i@maskray.me>
Thu, 22 Dec 2022 08:12:58 +0000 (00:12 -0800)
utils/bazel/llvm-project-overlay/clang/BUILD.bazel
utils/bazel/llvm-project-overlay/llvm/BUILD.bazel

index 8b7dd4b..1ca7fa8 100644 (file)
@@ -1069,6 +1069,7 @@ cc_library(
         "include/clang/Tooling/Inclusions/**/*.inc",
     ]),
     deps = [
+        ":ast",
         ":basic",
         ":lex",
         ":rewrite",
@@ -1364,7 +1365,9 @@ cc_library(
         ":parse",
         ":static_analyzer_checkers_gen",
         "//llvm:BinaryFormat",
+        "//llvm:Instrumentation",
         "//llvm:MC",
+        "//llvm:Object",
         "//llvm:Option",
         "//llvm:ProfileData",
         "//llvm:Support",
@@ -2211,6 +2214,7 @@ cc_library(
         ":basic",
         ":frontend",
         ":index",
+        ":lex",
         "//llvm:Option",
         "//llvm:Support",
     ],
index a72eeca..efc63bb 100644 (file)
@@ -839,6 +839,7 @@ cc_library(
     ],
     copts = llvm_copts,
     deps = [
+        ":BinaryFormat",
         ":BitstreamReader",
         ":Core",
         ":Support",
@@ -856,6 +857,7 @@ cc_library(
     copts = llvm_copts,
     deps = [
         ":BinaryFormat",
+        ":DebugInfoCodeView",
         ":MC",
         ":Support",
         ":config",
@@ -954,7 +956,10 @@ cc_library(
     copts = llvm_copts,
     deps = [
         ":Core",
+        ":DebugInfo",
         ":DebugInfoDWARF",
+        ":Demangle",
+        ":Object",
         ":Support",
         ":Symbolize",
         ":config",
@@ -1024,6 +1029,7 @@ cc_library(
     copts = llvm_copts,
     deps = [
         ":Analysis",
+        ":BitReader",
         ":BitstreamWriter",
         ":Core",
         ":MC",
@@ -1196,9 +1202,11 @@ cc_library(
         ":Analysis",
         ":BinaryFormat",
         ":Core",
+        ":Demangle",
         ":MC",
         ":ProfileData",
         ":Support",
+        ":Target",
         ":TransformUtils",
         ":config",
     ],
@@ -1236,6 +1244,7 @@ cc_library(
     deps = [
         ":AggressiveInstCombine",
         ":Analysis",
+        ":BinaryFormat",
         ":Core",
         ":InstCombine",
         ":ProfileData",
@@ -1334,8 +1343,10 @@ cc_library(
     deps = [
         ":Analysis",
         ":Core",
+        ":MC",
         ":Scalar",
         ":Support",
+        ":Target",
         ":TransformUtils",
     ],
 )
@@ -1401,6 +1412,7 @@ cc_library(
         ":BinaryFormat",
         ":Core",
         ":Support",
+        ":attributes_gen",
     ],
 )
 
@@ -1456,6 +1468,7 @@ cc_library(
     copts = llvm_copts,
     deps = [
         ":Core",
+        ":Object",
         ":Support",
         ":TransformUtils",
         ":config",
@@ -1525,6 +1538,7 @@ cc_library(
     copts = llvm_copts,
     deps = [
         ":Analysis",
+        ":BinaryFormat",
         ":Core",
         ":IPO",
         ":Scalar",
@@ -1579,6 +1593,7 @@ cc_library(
         "include/llvm/CodeGen/**/*.inc",
     ]),
     deps = [
+        ":AggressiveInstCombine",
         ":Analysis",
         ":AsmParser",
         ":BinaryFormat",
@@ -1588,6 +1603,7 @@ cc_library(
         ":DebugInfoCodeView",
         ":DebugInfoDWARF",
         ":IPO",
+        ":Instrumentation",
         ":MC",
         ":MCParser",
         ":ProfileData",
@@ -2022,6 +2038,7 @@ gentbl(
         strip_include_prefix = "lib/Target/" + target["name"],
         deps = [
             ":" + target["name"] + "CommonTableGen",
+            ":MC",
             ":Support",
             ":Target",
         ],
@@ -2070,6 +2087,7 @@ gentbl(
         features = [
             "-parse_headers",
             "-header_modules",
+            "-layering_check",
         ],
         strip_include_prefix = "lib/Target/" + target["name"],
         deps = [
@@ -2080,6 +2098,7 @@ gentbl(
             ":DebugInfoCodeView",
             ":MC",
             ":MCDisassembler",
+            ":Core",
             ":Support",
             ":Target",
             ":config",
@@ -2097,6 +2116,7 @@ gentbl(
         ]),
         hdrs = ["lib/Target/" + target["name"] + "/" + target["short_name"] + ".h"],
         copts = llvm_copts,
+        features = ["-layering_check"],
         strip_include_prefix = "lib/Target/" + target["name"],
         textual_hdrs = glob([
             "lib/Target/" + target["name"] + "/*.def",
@@ -2138,6 +2158,7 @@ gentbl(
             ":Target",
             ":" + target["name"] + "CodeGen",
             ":" + target["name"] + "CommonTableGen",
+            ":" + target["name"] + "Info",
             ":" + target["name"] + "UtilsAndDesc",
         ],
     )],
@@ -2274,14 +2295,21 @@ cc_library(
     hdrs = glob(["include/llvm/Passes/*.h"]) + ["include/llvm-c/Transforms/PassBuilder.h"],
     copts = llvm_copts,
     deps = [
+        ":AggressiveInstCombine",
         ":Analysis",
         ":CodeGen",
         ":Core",
         ":Coroutines",
+        ":IPO",
+        ":IRPrinter",
+        ":InstCombine",
+        ":Instrumentation",
         ":MLPolicies",
+        ":Scalar",
         ":Support",
         ":Target",
         ":TransformUtils",
+        ":Vectorize",
         ":common_transforms",
         ":config",
         ":pass_registry_def",
@@ -2307,13 +2335,17 @@ cc_library(
         ":BitWriter",
         ":CodeGen",
         ":Core",
+        ":IPO",
         ":IRPrinter",
         ":IRReader",
         ":Linker",
         ":MC",
         ":MCParser",
+        ":ObjCARC",
         ":Object",
         ":Passes",
+        ":Remarks",
+        ":Scalar",
         ":Support",
         ":Target",
         ":TransformUtils",
@@ -4221,10 +4253,14 @@ cc_binary(
         ":BitWriter",
         ":CodeGen",
         ":Core",
+        ":IPO",
         ":IRPrinter",
         ":IRReader",
+        ":Instrumentation",
         ":MC",
         ":Passes",
+        ":Remarks",
+        ":Scalar",
         ":Support",
         ":Target",
         ":TransformUtils",