!27857 fix dump level in dump ir

Merge pull request !27857 from huanghui/fix-name
This commit is contained in:
i-robot 2021-12-18 05:38:13 +00:00 committed by Gitee
commit 21c11c1189
4 changed files with 7 additions and 7 deletions

View File

@ -628,7 +628,7 @@ void SetDumpConfigByString(const std::string &str, DumpConfig *dump_config) {
{kDumpConfigLineLevel0, kOff}, {kDumpConfigLineLevel1, kTopStack}, {kDumpConfigLineLevel2, kWholeStack}};
auto it = dump_level_map.find(str);
if (it != dump_level_map.end()) {
dump_config->enable_dump_pass_ir = it->second;
dump_config->dump_line_level = it->second;
return;
}
if (str == kDumpConfigDisableBackend) {

View File

@ -474,8 +474,8 @@ void GetTraceStackInfo(std::ostringstream &oss) {
std::ostringstream trace_info;
GetEvalStackInfo(trace_info);
if (trace_info.str().empty()) {
DebugInfoPtr debug_info = TraceManager::GetParseOrResolveDebugInfo();
if (debug_info != nullptr && TraceManager::GetRecordDebugInfoFlag() == true) {
DebugInfoPtr debug_info = TraceManager::record_debug_info();
if (debug_info != nullptr && TraceManager::record_debug_info_flag() == true) {
auto debug_str = trace::GetDebugInfo(debug_info);
if (!debug_str.empty()) {
oss << "\n\n# " << debug_str;

View File

@ -167,7 +167,7 @@ void TraceManager::DebugTrace(const DebugInfoPtr &debug_info, const TraceInfoPtr
(void)TraceManager::trace_context_stack_.emplace_back(cloned_info);
}
DebugInfoPtr TraceManager::GetParseOrResolveDebugInfo() { return TraceManager::record_debug_info_; }
DebugInfoPtr TraceManager::record_debug_info() { return TraceManager::record_debug_info_; }
void TraceManager::ClearParseOrResolveDebugInfo() { TraceManager::record_debug_info_ = nullptr; }
@ -175,7 +175,7 @@ void TraceManager::CloseRecordDebugInfoFlag() { record_debug_info_flag_ = false;
void TraceManager::OpenRecordDebugInfoFlag() { record_debug_info_flag_ = true; }
bool TraceManager::GetRecordDebugInfoFlag() { return record_debug_info_flag_; }
bool TraceManager::record_debug_info_flag() { return record_debug_info_flag_; }
thread_local std::vector<TraceContext> TraceManager::trace_context_stack_;

View File

@ -122,12 +122,12 @@ class MS_CORE_API TraceManager {
/// \brief Get debug info for parse or resolve.
///
/// \return The debug info for parse or resolve.
static DebugInfoPtr GetParseOrResolveDebugInfo();
static DebugInfoPtr record_debug_info();
/// \brief Get the flag of recording a debug info.
///
/// \return A bool.
static bool GetRecordDebugInfoFlag();
static bool record_debug_info_flag();
/// \brief Set the flag to false for not recording a debug info.
static void CloseRecordDebugInfoFlag();