1#ifndef TENSORFLOW_TSL_PLATFORM_STACK_FRAME_H_
2#define TENSORFLOW_TSL_PLATFORM_STACK_FRAME_H_
3
4/* Copyright 2020 Google LLC. All Rights Reserved.
5
6Licensed under the Apache License, Version 2.0 (the "License");
7you may not use this file except in compliance with the License.
8You may obtain a copy of the License at
9
10 http://www.apache.org/licenses/LICENSE-2.0
11
12Unless required by applicable law or agreed to in writing, software
13distributed under the License is distributed on an "AS IS" BASIS,
14WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15See the License for the specific language governing permissions and
16limitations under the License.
17==============================================================================*/
18
19#include <string>
20
21namespace tsl {
22
23// A struct representing a frame in a stack trace.
24struct StackFrame {
25 std::string file_name;
26 int line_number;
27 std::string function_name;
28
29 bool operator==(const StackFrame& other) const {
30 return line_number == other.line_number &&
31 function_name == other.function_name && file_name == other.file_name;
32 }
33
34 bool operator!=(const StackFrame& other) const { return !(*this == other); }
35};
36
37} // namespace tsl
38
39#endif // TENSORFLOW_TSL_PLATFORM_STACK_FRAME_H_
40