Skip to content

Commit 139ebfa

Browse files
authored
[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.
1 parent d97746c commit 139ebfa

File tree

1 file changed

+1
-32
lines changed

1 file changed

+1
-32
lines changed

utils/bazel/llvm-project-overlay/llvm/BUILD.bazel

Lines changed: 1 addition & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1243,42 +1243,12 @@ cc_library(
12431243
],
12441244
)
12451245

1246-
AnalysisFpExcSrcs = [
1247-
"lib/Analysis/ConstantFolding.cpp",
1248-
]
1249-
1250-
cc_library(
1251-
name = "AnalysisFpExc",
1252-
srcs = AnalysisFpExcSrcs,
1253-
hdrs = glob(
1254-
[
1255-
"include/llvm/Analysis/*.h",
1256-
"include/llvm/Analysis/Utils/*.h",
1257-
],
1258-
),
1259-
copts = llvm_copts + ["-ftrapping-math"],
1260-
textual_hdrs = glob([
1261-
"include/llvm/Analysis/*.def",
1262-
]),
1263-
deps = [
1264-
":BinaryFormat",
1265-
":Core",
1266-
":Object",
1267-
":ProfileData",
1268-
":Support",
1269-
":TargetParser",
1270-
":config",
1271-
":target_library_info_gen",
1272-
],
1273-
)
1274-
12751246
cc_library(
12761247
name = "Analysis",
12771248
srcs = glob(
12781249
[
12791250
"lib/Analysis/*.cpp",
12801251
],
1281-
exclude = AnalysisFpExcSrcs,
12821252
),
12831253
hdrs = glob(
12841254
[
@@ -1288,12 +1258,11 @@ cc_library(
12881258
) + [
12891259
"include/llvm-c/Analysis.h",
12901260
],
1291-
copts = llvm_copts,
1261+
copts = llvm_copts + ["-ftrapping-math"],
12921262
textual_hdrs = glob([
12931263
"include/llvm/Analysis/*.def",
12941264
]),
12951265
deps = [
1296-
":AnalysisFpExc",
12971266
":BinaryFormat",
12981267
":Core",
12991268
":FrontendHLSL",

0 commit comments

Comments
 (0)