Skip to content

Commit 8f8aadc

Browse files
committed
Avoid string_view
Signed-off-by: Ryan Nett <[email protected]>
1 parent fbe696a commit 8f8aadc

File tree

2 files changed

+37
-40
lines changed
  • tensorflow-core/tensorflow-core-api/src

2 files changed

+37
-40
lines changed

tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TFLogEntry.java

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -21,23 +21,10 @@ public class TFLogEntry extends Pointer {
2121
/** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */
2222
public TFLogEntry(Pointer p) { super(p); }
2323

24-
public TFLogEntry(int severity, @StdString @Cast({"char*", "std::string&&"}) BytePointer message) { super((Pointer)null); allocate(severity, message); }
25-
private native void allocate(int severity, @StdString @Cast({"char*", "std::string&&"}) BytePointer message);
26-
public TFLogEntry(int severity, @StdString @Cast({"char*", "std::string&&"}) String message) { super((Pointer)null); allocate(severity, message); }
27-
private native void allocate(int severity, @StdString @Cast({"char*", "std::string&&"}) String message);
28-
29-
public TFLogEntry(int severity, @StdString @Cast({"char*", "std::string&&"}) BytePointer fname, int line,
30-
@StdString @Cast({"char*", "std::string&&"}) BytePointer message) { super((Pointer)null); allocate(severity, fname, line, message); }
31-
private native void allocate(int severity, @StdString @Cast({"char*", "std::string&&"}) BytePointer fname, int line,
32-
@StdString @Cast({"char*", "std::string&&"}) BytePointer message);
33-
public TFLogEntry(int severity, @StdString @Cast({"char*", "std::string&&"}) String fname, int line,
34-
@StdString @Cast({"char*", "std::string&&"}) String message) { super((Pointer)null); allocate(severity, fname, line, message); }
35-
private native void allocate(int severity, @StdString @Cast({"char*", "std::string&&"}) String fname, int line,
36-
@StdString @Cast({"char*", "std::string&&"}) String message);
3724

3825
public native @Cast("absl::LogSeverity") int log_severity();
3926
public native @StdString @Cast({"char*", "std::string&&"}) BytePointer FName();
4027
public native int Line();
4128
public native @StdString @Cast({"char*", "std::string&&"}) BytePointer ToString();
42-
public native @StdString @Cast({"char*", "std::string&&"}) BytePointer text_message();
29+
public native @StdString @Cast({"", "", "std::string"}) BytePointer text_message();
4330
}

tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/internal/c_api/presets/tensorflow.java

Lines changed: 36 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -403,33 +403,43 @@ public void map(InfoMap infoMap) {
403403
.cast()
404404
.valueTypes("long")
405405
.pointerTypes("LongPointer", "long[]"))
406-
.put(new Info("absl::string_view", "absl::lts_2020_09_23::string_view", "string", "std::string", "tensorflow::string").annotations("@StdString")
406+
.put(new Info("string", "std::string", "tensorflow::string").annotations("@StdString")
407407
.valueTypes("@Cast({\"char*\", \"std::string&&\"}) BytePointer", "@Cast({\"char*\", \"std::string&&\"}) String")
408408
.pointerTypes("@Cast({\"char*\", \"std::string*\"}) BytePointer"))
409-
.put(new Info("absl::LogSeverity", "LogSeverity", "tensorflow::LogSeverity").cast().valueTypes("int").pointerTypes("IntPointer", "int[]"))
410-
.put(new Info("tensorflow::internal::LogEveryNSecState",
411-
"tensorflow::internal::LogEveryNState",
412-
"tensorflow::internal::LogEveryPow2State",
413-
"tensorflow::internal::LogFirstNState",
414-
"tensorflow::internal::Voidifier",
415-
"tensorflow::internal::LogMessage",
416-
"tensorflow::internal::LogMessageFatal",
417-
"tensorflow::internal::LogMessageNull",
418-
"tensorflow::internal::CheckOpMessageBuilder",
419-
"tensorflow::internal::CheckOpString",
420-
"tensorflow::internal::GetReferenceableValue",
421-
"DVLOG",
422-
"absl::LogSeverities").skip())
423-
.put(new Info(
424-
"tensorflow::INFO",
425-
"tensorflow::WARNING",
426-
"tensorflow::ERROR",
427-
"tensorflow::FATAL",
428-
"tensorflow::NUM_SEVERITIES",
429-
"_TF_LOG_INFO",
430-
"_TF_LOG_WARNING",
431-
"_TF_LOG_ERROR",
432-
"_TF_LOG_FATAL",
433-
"_TF_LOG_QFATAL").skip());
409+
.put(
410+
new Info("absl::LogSeverity", "LogSeverity", "tensorflow::LogSeverity")
411+
.cast()
412+
.valueTypes("int")
413+
.pointerTypes("IntPointer", "int[]"))
414+
.put(new Info("tensorflow::TFLogEntry").purify())
415+
.put(
416+
new Info(
417+
"tensorflow::internal::LogEveryNSecState",
418+
"tensorflow::internal::LogEveryNState",
419+
"tensorflow::internal::LogEveryPow2State",
420+
"tensorflow::internal::LogFirstNState",
421+
"tensorflow::internal::Voidifier",
422+
"tensorflow::internal::LogMessage",
423+
"tensorflow::internal::LogMessageFatal",
424+
"tensorflow::internal::LogMessageNull",
425+
"tensorflow::internal::CheckOpMessageBuilder",
426+
"tensorflow::internal::CheckOpString",
427+
"tensorflow::internal::GetReferenceableValue",
428+
"DVLOG",
429+
"absl::LogSeverities")
430+
.skip())
431+
.put(
432+
new Info(
433+
"tensorflow::INFO",
434+
"tensorflow::WARNING",
435+
"tensorflow::ERROR",
436+
"tensorflow::FATAL",
437+
"tensorflow::NUM_SEVERITIES",
438+
"_TF_LOG_INFO",
439+
"_TF_LOG_WARNING",
440+
"_TF_LOG_ERROR",
441+
"_TF_LOG_FATAL",
442+
"_TF_LOG_QFATAL")
443+
.skip());
434444
}
435445
}

0 commit comments

Comments
 (0)