| 1057 | } |
| 1058 | |
| 1059 | Status GetFullFrame(const Node* n, absl::Span<const ControlFlowInfo> cfi_infos, |
| 1060 | std::vector<string>* frame) { |
| 1061 | int depth = 0; |
| 1062 | for (const ControlFlowInfo* cfi_iter = &cfi_infos[n->id()]; !n->IsSource(); |
| 1063 | n = cfi_iter->parent_frame, cfi_iter = &cfi_infos[n->id()]) { |
| 1064 | frame->push_back(cfi_iter->frame_name); |
| 1065 | |
| 1066 | if (depth++ > 5000) { |
| 1067 | return errors::Internal( |
| 1068 | "Frame of depth > 5000: Probably malformed graph or a bug in " |
| 1069 | "BuildControlFlowInfo"); |
| 1070 | } |
| 1071 | } |
| 1072 | |
| 1073 | return Status::OK(); |
| 1074 | } |
| 1075 | |
| 1076 | // If the node is inside some frames, get the name of the outermost non-empty |
| 1077 | // frame. Otherwise, get an empty frame name. |
no test coverage detected