[Bazel] Fix --warn-backrefs errors in Analysis target (#170357)

Commit b262785 introduced a separate `AnalysisFpExc` target to try to
workaround the lack of a bazel equivalent of single source file
properties. However, this introduces backref errors when
`--warn-backrefs` is enabled.

This change alternatively just adds the `-ftrapping-math` copt to the
entire `Analysis` target.

Fix suggested by @rocallahan.
This commit is contained in:
Jason Macnak
2025-12-02 13:32:52 -08:00
committed by GitHub
parent d97746c56b
commit 139ebfa63d

View File

@@ -1243,42 +1243,12 @@ cc_library(
],
)
AnalysisFpExcSrcs = [
"lib/Analysis/ConstantFolding.cpp",
]
cc_library(
name = "AnalysisFpExc",
srcs = AnalysisFpExcSrcs,
hdrs = glob(
[
"include/llvm/Analysis/*.h",
"include/llvm/Analysis/Utils/*.h",
],
),
copts = llvm_copts + ["-ftrapping-math"],
textual_hdrs = glob([
"include/llvm/Analysis/*.def",
]),
deps = [
":BinaryFormat",
":Core",
":Object",
":ProfileData",
":Support",
":TargetParser",
":config",
":target_library_info_gen",
],
)
cc_library(
name = "Analysis",
srcs = glob(
[
"lib/Analysis/*.cpp",
],
exclude = AnalysisFpExcSrcs,
),
hdrs = glob(
[
@@ -1288,12 +1258,11 @@ cc_library(
) + [
"include/llvm-c/Analysis.h",
],
copts = llvm_copts,
copts = llvm_copts + ["-ftrapping-math"],
textual_hdrs = glob([
"include/llvm/Analysis/*.def",
]),
deps = [
":AnalysisFpExc",
":BinaryFormat",
":Core",
":FrontendHLSL",