[TF:XLA] Ensure that deadness_analysis.cc is only linked once

Escaping the transitive dependency on :compilation_passes is impossible:
//tensorflow/compiler/jit:deadness_analysis_test
-> //tensorflow/compiler/jit/kernels:xla_launch_op
-> //tensorflow/compiler/jit:xla_device
-> //tensorflow/compiler/jit:jit_compilation_passes
-> //tensorflow/compiler/jit:compilation_passes

Linking both :compilation_passes and :deadness_analysis_internal into one test
leads to ODR conflicts. Asan complains about them. Just remove the internal
target and add the internal header to the test.

PiperOrigin-RevId: 207546071
This commit is contained in:
Benjamin Kramer 2018-08-06 08:06:09 -07:00 committed by TensorFlower Gardener
parent 2b8df9f406
commit 7304afd4f2

View File

@ -301,22 +301,6 @@ tf_cc_test(
], ],
) )
cc_library(
name = "deadness_analysis_internal",
testonly = True,
srcs = [
"deadness_analysis.cc",
],
hdrs = [
"deadness_analysis.h",
"deadness_analysis_internal.h",
],
deps = [
"//tensorflow/core:graph",
"//tensorflow/core:lib",
],
)
cc_library( cc_library(
name = "compilation_passes", name = "compilation_passes",
srcs = [ srcs = [
@ -398,11 +382,12 @@ tf_cc_test(
name = "deadness_analysis_test", name = "deadness_analysis_test",
size = "small", size = "small",
srcs = [ srcs = [
"deadness_analysis_internal.h",
"deadness_analysis_test.cc", "deadness_analysis_test.cc",
], ],
deps = [ deps = [
":common", ":common",
":deadness_analysis_internal", ":compilation_passes",
"//tensorflow/cc:cc_ops", "//tensorflow/cc:cc_ops",
"//tensorflow/cc:cc_ops_internal", "//tensorflow/cc:cc_ops_internal",
"//tensorflow/cc:function_ops", "//tensorflow/cc:function_ops",
@ -414,6 +399,7 @@ tf_cc_test(
"//tensorflow/core:core_cpu", "//tensorflow/core:core_cpu",
"//tensorflow/core:framework", "//tensorflow/core:framework",
"//tensorflow/core:framework_internal", "//tensorflow/core:framework_internal",
"//tensorflow/core:graph",
"//tensorflow/core:lib", "//tensorflow/core:lib",
"//tensorflow/core:test", "//tensorflow/core:test",
"//tensorflow/core:test_main", "//tensorflow/core:test_main",