!39022 Change special code to unicode

Merge pull request !39022 from LiangZhibo/code
This commit is contained in:
i-robot 2022-07-28 08:10:28 +00:00 committed by Gitee
commit ee30358c8d
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 39 additions and 21 deletions

View File

@ -547,9 +547,9 @@ void ClipPointsComponent(const std::string &points, const std::string &clipped,
namespace while_loop_export { namespace while_loop_export {
namespace { namespace {
const char CONTROL_PATTERN[] = ""; const char CONTROL_PATTERN[] = "\u21B5"; // ↵
const char LOOP_BODY_PATTERN[] = ""; const char LOOP_BODY_PATTERN[] = "\u21BB"; // ↻
const char AFTER_LOOP_PATTERN[] = ""; const char AFTER_LOOP_PATTERN[] = "\u2193"; // ↓
const size_t LOOP_BODY_INPUT = 2; const size_t LOOP_BODY_INPUT = 2;
const size_t AFTER_LOOP_INPUT = 3; const size_t AFTER_LOOP_INPUT = 3;

View File

@ -59,7 +59,8 @@ class TracePhi : public TraceInfo {
public: public:
explicit TracePhi(const DebugInfoPtr &info) : TraceInfo(info) {} explicit TracePhi(const DebugInfoPtr &info) : TraceInfo(info) {}
~TracePhi() override = default; ~TracePhi() override = default;
MS_DECLARE_TRACE_NAME_SYMBOL("phi", "Φ"); // phi: Φ
MS_DECLARE_TRACE_NAME_SYMBOL("phi", "\u0444");
TraceInfoPtr clone() override { return std::make_shared<TracePhi>(*this); } TraceInfoPtr clone() override { return std::make_shared<TracePhi>(*this); }
}; };
@ -69,7 +70,8 @@ class TraceIfStmtTrueBranch : public TraceInfo {
TraceIfStmtTrueBranch &operator=(const TraceIfStmtTrueBranch &) = default; TraceIfStmtTrueBranch &operator=(const TraceIfStmtTrueBranch &) = default;
explicit TraceIfStmtTrueBranch(const DebugInfoPtr &info) : TraceInfo(info) {} explicit TraceIfStmtTrueBranch(const DebugInfoPtr &info) : TraceInfo(info) {}
~TraceIfStmtTrueBranch() override = default; ~TraceIfStmtTrueBranch() override = default;
MS_DECLARE_TRACE_NAME_SYMBOL("if_true", ""); // if_true: ✓
MS_DECLARE_TRACE_NAME_SYMBOL("if_true", "\u2713");
TraceInfoPtr clone() override { return std::make_shared<TraceIfStmtTrueBranch>(*this); } TraceInfoPtr clone() override { return std::make_shared<TraceIfStmtTrueBranch>(*this); }
}; };
@ -79,7 +81,8 @@ class TraceIfStmtFalseBranch : public TraceInfo {
TraceIfStmtFalseBranch &operator=(const TraceIfStmtFalseBranch &) = default; TraceIfStmtFalseBranch &operator=(const TraceIfStmtFalseBranch &) = default;
explicit TraceIfStmtFalseBranch(const DebugInfoPtr &info) : TraceInfo(info) {} explicit TraceIfStmtFalseBranch(const DebugInfoPtr &info) : TraceInfo(info) {}
~TraceIfStmtFalseBranch() override = default; ~TraceIfStmtFalseBranch() override = default;
MS_DECLARE_TRACE_NAME_SYMBOL("if_false", ""); // if_false: ✗
MS_DECLARE_TRACE_NAME_SYMBOL("if_false", "\u2717");
TraceInfoPtr clone() override { return std::make_shared<TraceIfStmtFalseBranch>(*this); } TraceInfoPtr clone() override { return std::make_shared<TraceIfStmtFalseBranch>(*this); }
}; };
@ -87,7 +90,8 @@ class TraceIfStmtAfterBranch : public TraceInfo {
public: public:
explicit TraceIfStmtAfterBranch(const DebugInfoPtr &info) : TraceInfo(info) {} explicit TraceIfStmtAfterBranch(const DebugInfoPtr &info) : TraceInfo(info) {}
~TraceIfStmtAfterBranch() override = default; ~TraceIfStmtAfterBranch() override = default;
MS_DECLARE_TRACE_NAME_SYMBOL("if_after", ""); // if_after: ↓
MS_DECLARE_TRACE_NAME_SYMBOL("if_after", "\u2193");
TraceInfoPtr clone() override { return std::make_shared<TraceIfStmtAfterBranch>(*this); } TraceInfoPtr clone() override { return std::make_shared<TraceIfStmtAfterBranch>(*this); }
}; };
@ -95,7 +99,8 @@ class TraceIfExpTrueBranch : public TraceInfo {
public: public:
explicit TraceIfExpTrueBranch(const DebugInfoPtr &info) : TraceInfo(info) {} explicit TraceIfExpTrueBranch(const DebugInfoPtr &info) : TraceInfo(info) {}
~TraceIfExpTrueBranch() override = default; ~TraceIfExpTrueBranch() override = default;
MS_DECLARE_TRACE_NAME_SYMBOL("ifexp_true", ""); // ifexp_true: ↰
MS_DECLARE_TRACE_NAME_SYMBOL("ifexp_true", "\u21B0");
TraceInfoPtr clone() override { return std::make_shared<TraceIfExpTrueBranch>(*this); } TraceInfoPtr clone() override { return std::make_shared<TraceIfExpTrueBranch>(*this); }
}; };
@ -103,7 +108,8 @@ class TraceIfExpFalseBranch : public TraceInfo {
public: public:
explicit TraceIfExpFalseBranch(const DebugInfoPtr &info) : TraceInfo(info) {} explicit TraceIfExpFalseBranch(const DebugInfoPtr &info) : TraceInfo(info) {}
~TraceIfExpFalseBranch() override = default; ~TraceIfExpFalseBranch() override = default;
MS_DECLARE_TRACE_NAME_SYMBOL("ifexp_false", ""); // ifexp_false: ↱
MS_DECLARE_TRACE_NAME_SYMBOL("ifexp_false", "\u21B1");
TraceInfoPtr clone() override { return std::make_shared<TraceIfExpFalseBranch>(*this); } TraceInfoPtr clone() override { return std::make_shared<TraceIfExpFalseBranch>(*this); }
}; };
@ -128,7 +134,8 @@ class TraceWhileHeader : public TraceInfo {
public: public:
explicit TraceWhileHeader(const DebugInfoPtr &info) : TraceInfo(info) {} explicit TraceWhileHeader(const DebugInfoPtr &info) : TraceInfo(info) {}
~TraceWhileHeader() override = default; ~TraceWhileHeader() override = default;
MS_DECLARE_TRACE_NAME_SYMBOL("while_header", ""); // while_header: ↵
MS_DECLARE_TRACE_NAME_SYMBOL("while_header", "\u21B5");
TraceInfoPtr clone() override { return std::make_shared<TraceWhileHeader>(*this); } TraceInfoPtr clone() override { return std::make_shared<TraceWhileHeader>(*this); }
}; };
@ -136,7 +143,8 @@ class TraceWhileBody : public TraceInfo {
public: public:
explicit TraceWhileBody(const DebugInfoPtr &info) : TraceInfo(info) {} explicit TraceWhileBody(const DebugInfoPtr &info) : TraceInfo(info) {}
~TraceWhileBody() override = default; ~TraceWhileBody() override = default;
MS_DECLARE_TRACE_NAME_SYMBOL("while_body", ""); // while_body: ↻
MS_DECLARE_TRACE_NAME_SYMBOL("while_body", "\u21BB");
TraceInfoPtr clone() override { return std::make_shared<TraceWhileBody>(*this); } TraceInfoPtr clone() override { return std::make_shared<TraceWhileBody>(*this); }
}; };
@ -144,7 +152,8 @@ class TraceWhileAfter : public TraceInfo {
public: public:
explicit TraceWhileAfter(const DebugInfoPtr &info) : TraceInfo(info) {} explicit TraceWhileAfter(const DebugInfoPtr &info) : TraceInfo(info) {}
~TraceWhileAfter() override = default; ~TraceWhileAfter() override = default;
MS_DECLARE_TRACE_NAME_SYMBOL("while_after", ""); // while_after: ↓
MS_DECLARE_TRACE_NAME_SYMBOL("while_after", "\u2193");
TraceInfoPtr clone() override { return std::make_shared<TraceWhileAfter>(*this); } TraceInfoPtr clone() override { return std::make_shared<TraceWhileAfter>(*this); }
}; };
@ -152,7 +161,8 @@ class TraceForHeader : public TraceInfo {
public: public:
explicit TraceForHeader(const DebugInfoPtr &info) : TraceInfo(info) {} explicit TraceForHeader(const DebugInfoPtr &info) : TraceInfo(info) {}
~TraceForHeader() override = default; ~TraceForHeader() override = default;
MS_DECLARE_TRACE_NAME_SYMBOL("for_header", ""); // for_header: ↵
MS_DECLARE_TRACE_NAME_SYMBOL("for_header", "\u21B5");
TraceInfoPtr clone() override { return std::make_shared<TraceForHeader>(*this); } TraceInfoPtr clone() override { return std::make_shared<TraceForHeader>(*this); }
}; };
@ -160,7 +170,8 @@ class TraceForBody : public TraceInfo {
public: public:
explicit TraceForBody(const DebugInfoPtr &info) : TraceInfo(info) {} explicit TraceForBody(const DebugInfoPtr &info) : TraceInfo(info) {}
~TraceForBody() override = default; ~TraceForBody() override = default;
MS_DECLARE_TRACE_NAME_SYMBOL("for_body", ""); // for_body: ↻
MS_DECLARE_TRACE_NAME_SYMBOL("for_body", "\u21BB");
TraceInfoPtr clone() override { return std::make_shared<TraceForBody>(*this); } TraceInfoPtr clone() override { return std::make_shared<TraceForBody>(*this); }
}; };
@ -176,7 +187,8 @@ class TraceForAfter : public TraceInfo {
public: public:
explicit TraceForAfter(const DebugInfoPtr &info) : TraceInfo(info) {} explicit TraceForAfter(const DebugInfoPtr &info) : TraceInfo(info) {}
~TraceForAfter() override = default; ~TraceForAfter() override = default;
MS_DECLARE_TRACE_NAME_SYMBOL("for_after", ""); // for_after: ↓
MS_DECLARE_TRACE_NAME_SYMBOL("for_after", "\u2193");
TraceInfoPtr clone() override { return std::make_shared<TraceForAfter>(*this); } TraceInfoPtr clone() override { return std::make_shared<TraceForAfter>(*this); }
}; };
@ -184,7 +196,8 @@ class TraceLoopEnd : public TraceInfo {
public: public:
explicit TraceLoopEnd(const DebugInfoPtr &info) : TraceInfo(info) {} explicit TraceLoopEnd(const DebugInfoPtr &info) : TraceInfo(info) {}
~TraceLoopEnd() override = default; ~TraceLoopEnd() override = default;
MS_DECLARE_TRACE_NAME_SYMBOL("loop_end", "↓↓"); // loop_end: ⇊
MS_DECLARE_TRACE_NAME_SYMBOL("loop_end", "\u21CA");
TraceInfoPtr clone() override { return std::make_shared<TraceLoopEnd>(*this); } TraceInfoPtr clone() override { return std::make_shared<TraceLoopEnd>(*this); }
}; };
@ -201,7 +214,8 @@ class TraceGradFpropApp : public TraceInfo {
TraceGradFpropApp() : TraceInfo(nullptr) {} TraceGradFpropApp() : TraceInfo(nullptr) {}
explicit TraceGradFpropApp(const DebugInfoPtr &info) : TraceInfo(info) {} explicit TraceGradFpropApp(const DebugInfoPtr &info) : TraceInfo(info) {}
~TraceGradFpropApp() override = default; ~TraceGradFpropApp() override = default;
MS_DECLARE_TRACE_NAME_SYMBOL("grad_fprop_app", ""); // grad_fprop_app: ▲
MS_DECLARE_TRACE_NAME_SYMBOL("grad_fprop_app", "\u25B2");
TraceInfoPtr clone() override { return std::make_shared<TraceGradFpropApp>(*this); } TraceInfoPtr clone() override { return std::make_shared<TraceGradFpropApp>(*this); }
}; };
@ -210,7 +224,8 @@ class TraceGradBpropApp : public TraceInfo {
TraceGradBpropApp() : TraceInfo(nullptr) {} TraceGradBpropApp() : TraceInfo(nullptr) {}
explicit TraceGradBpropApp(const DebugInfoPtr &info) : TraceInfo(info) {} explicit TraceGradBpropApp(const DebugInfoPtr &info) : TraceInfo(info) {}
~TraceGradBpropApp() override = default; ~TraceGradBpropApp() override = default;
MS_DECLARE_TRACE_NAME_SYMBOL("grad_bprop_app", ""); // grad_bprop_app: ▼
MS_DECLARE_TRACE_NAME_SYMBOL("grad_bprop_app", "\u25BC");
TraceInfoPtr clone() override { return std::make_shared<TraceGradBpropApp>(*this); } TraceInfoPtr clone() override { return std::make_shared<TraceGradBpropApp>(*this); }
}; };
@ -219,7 +234,8 @@ class TraceGradFprop : public TraceInfo {
TraceGradFprop() : TraceInfo(nullptr) {} TraceGradFprop() : TraceInfo(nullptr) {}
explicit TraceGradFprop(const DebugInfoPtr &info) : TraceInfo(info) {} explicit TraceGradFprop(const DebugInfoPtr &info) : TraceInfo(info) {}
~TraceGradFprop() override = default; ~TraceGradFprop() override = default;
MS_DECLARE_TRACE_NAME_SYMBOL("grad_fprop", ""); // grad_fprop: ▶
MS_DECLARE_TRACE_NAME_SYMBOL("grad_fprop", "\u25B8");
TraceInfoPtr clone() override { return std::make_shared<TraceGradFprop>(*this); } TraceInfoPtr clone() override { return std::make_shared<TraceGradFprop>(*this); }
}; };
@ -228,7 +244,8 @@ class TraceGradBprop : public TraceInfo {
TraceGradBprop() : TraceInfo(nullptr) {} TraceGradBprop() : TraceInfo(nullptr) {}
explicit TraceGradBprop(const DebugInfoPtr &info) : TraceInfo(info) {} explicit TraceGradBprop(const DebugInfoPtr &info) : TraceInfo(info) {}
~TraceGradBprop() override = default; ~TraceGradBprop() override = default;
MS_DECLARE_TRACE_NAME_SYMBOL("grad_bprop", ""); // grad_bprop: ◀
MS_DECLARE_TRACE_NAME_SYMBOL("grad_bprop", "\u25C2");
TraceInfoPtr clone() override { return std::make_shared<TraceGradBprop>(*this); } TraceInfoPtr clone() override { return std::make_shared<TraceGradBprop>(*this); }
}; };
@ -237,7 +254,8 @@ class TraceGradSens : public TraceInfo {
TraceGradSens() : TraceInfo(nullptr) {} TraceGradSens() : TraceInfo(nullptr) {}
explicit TraceGradSens(const DebugInfoPtr &info) : TraceInfo(info) {} explicit TraceGradSens(const DebugInfoPtr &info) : TraceInfo(info) {}
~TraceGradSens() override = default; ~TraceGradSens() override = default;
MS_DECLARE_TRACE_NAME_SYMBOL("grad_sens", ""); // grad_sens: ∇
MS_DECLARE_TRACE_NAME_SYMBOL("grad_sens", "\u25BD");
TraceInfoPtr clone() override { return std::make_shared<TraceGradSens>(*this); } TraceInfoPtr clone() override { return std::make_shared<TraceGradSens>(*this); }
}; };