Make regexp.h internal, only visible to the new tfprof contrib lib.
RE2 is not as portable as we would like, so we want to try to discourage the use of it in core libraries. After having removed it from all core uses, the only remaining use is in tfprof, so we move its visibility to only be to tfprof, which is an external tool. tfprof appears to fundamentally rely on regexp as a user interface, so it cannot be easily removed. However, perhaps one day tfprof will move into its own repo and then we can drop RE2 from our builds entirely. Change: 134120532
This commit is contained in:
parent
4fe09dee99
commit
914625aff6
@ -20,6 +20,9 @@
|
||||
* dot.h / DotGraph was removed (it was an early analysis tool prior
|
||||
to TensorBoard, no longer that useful). It remains in history
|
||||
should someone find the code useful.
|
||||
* re2 / regexp.h was removed from being a public interface of TF.
|
||||
Should users need regular expressions, they should depend on the RE2
|
||||
library directly rather than via TensorFlow.
|
||||
|
||||
# Release 0.10.0
|
||||
|
||||
|
@ -21,6 +21,7 @@ cc_library(
|
||||
"//tensorflow/contrib/tfprof/tools/tfprof:protos_all_cc",
|
||||
"//tensorflow/core:lib",
|
||||
"//tensorflow/core:protos_all_cc",
|
||||
"//tensorflow/core:regexp_internal",
|
||||
],
|
||||
)
|
||||
|
||||
@ -52,6 +53,7 @@ cc_library(
|
||||
"//tensorflow/core:framework",
|
||||
"//tensorflow/core:lib",
|
||||
"//tensorflow/core:protos_all_cc",
|
||||
"//tensorflow/core:regexp_internal",
|
||||
],
|
||||
)
|
||||
|
||||
@ -70,6 +72,7 @@ cc_library(
|
||||
"//tensorflow/contrib/tfprof/tools/tfprof:protos_all_cc",
|
||||
"//tensorflow/core:lib",
|
||||
"//tensorflow/core:protos_all_cc",
|
||||
"//tensorflow/core:regexp_internal",
|
||||
],
|
||||
)
|
||||
|
||||
@ -87,6 +90,7 @@ cc_library(
|
||||
"//tensorflow/contrib/tfprof/tools/tfprof:protos_all_cc",
|
||||
"//tensorflow/core:lib",
|
||||
"//tensorflow/core:protos_all_cc",
|
||||
"//tensorflow/core:regexp_internal",
|
||||
],
|
||||
)
|
||||
|
||||
@ -122,6 +126,7 @@ cc_library(
|
||||
":tfprof_options",
|
||||
"//tensorflow/core:lib",
|
||||
"//tensorflow/core:protos_all_cc",
|
||||
"//tensorflow/core:regexp_internal",
|
||||
],
|
||||
)
|
||||
|
||||
|
@ -193,7 +193,6 @@ cc_library(
|
||||
"platform/notification.h",
|
||||
"platform/profile_utils/cpu_utils.h",
|
||||
"platform/protobuf.h", # TODO(josh11b): make internal
|
||||
"platform/regexp.h",
|
||||
"platform/stacktrace.h",
|
||||
"platform/strong_hash.h",
|
||||
"platform/thread_annotations.h",
|
||||
@ -953,7 +952,6 @@ cc_library(
|
||||
"lib/strings/base64.h",
|
||||
"lib/strings/ordered_code.h",
|
||||
"lib/strings/proto_text_util.h",
|
||||
"lib/strings/regexp.h",
|
||||
"lib/strings/scanner.h",
|
||||
"lib/wav/wav_io.h",
|
||||
"platform/demangle.h",
|
||||
@ -1206,6 +1204,19 @@ tf_cuda_library(
|
||||
alwayslink = 1,
|
||||
)
|
||||
|
||||
# This library is deprecated and no longer publicly available.
|
||||
# Do not add more uses of it.
|
||||
cc_library(
|
||||
name = "regexp_internal",
|
||||
hdrs = [
|
||||
"platform/regexp.h",
|
||||
],
|
||||
visibility = [
|
||||
"//tensorflow/contrib/tfprof:__subpackages__",
|
||||
],
|
||||
deps = [":lib_internal"],
|
||||
)
|
||||
|
||||
tf_cuda_library(
|
||||
name = "direct_session_internal",
|
||||
srcs = ["common_runtime/direct_session.cc"],
|
||||
|
@ -1,34 +0,0 @@
|
||||
/* Copyright 2015 The TensorFlow Authors. All Rights Reserved.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
==============================================================================*/
|
||||
|
||||
#ifndef TENSORFLOW_CORE_LIB_STRINGS_REGEXP_H_
|
||||
#define TENSORFLOW_CORE_LIB_STRINGS_REGEXP_H_
|
||||
|
||||
#include "tensorflow/core/lib/core/stringpiece.h"
|
||||
#include "tensorflow/core/platform/regexp.h"
|
||||
|
||||
namespace tensorflow {
|
||||
|
||||
// Conversion to/from the appropriate StringPiece type for using in RE2
|
||||
inline RegexpStringPiece ToRegexpStringPiece(tensorflow::StringPiece sp) {
|
||||
return RegexpStringPiece(sp.data(), sp.size());
|
||||
}
|
||||
inline tensorflow::StringPiece FromRegexpStringPiece(RegexpStringPiece sp) {
|
||||
return tensorflow::StringPiece(sp.data(), sp.size());
|
||||
}
|
||||
|
||||
} // namespace tensorflow
|
||||
|
||||
#endif // TENSORFLOW_CORE_LIB_STRINGS_REGEXP_H_
|
Loading…
Reference in New Issue
Block a user