From 8f7e8cf003a85dcf0330a87f2ec4a36f0511f925 Mon Sep 17 00:00:00 2001 From: Pavel Kosov Date: Thu, 1 Dec 2022 11:26:23 +0300 Subject: [PATCH] [OHOS][Docs] Add development guideline Signed-off-by: Pavel Kosov --- .gitee/PULL_REQUEST_TEMPLATE.en.md | 2 ++ OpenHarmonyDevelopmentGuidelines.md | 37 +++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+) create mode 100644 OpenHarmonyDevelopmentGuidelines.md diff --git a/.gitee/PULL_REQUEST_TEMPLATE.en.md b/.gitee/PULL_REQUEST_TEMPLATE.en.md index aa60947a3ec9..f6d433f6d188 100644 --- a/.gitee/PULL_REQUEST_TEMPLATE.en.md +++ b/.gitee/PULL_REQUEST_TEMPLATE.en.md @@ -1,2 +1,4 @@ ## PR Description A clear and concise description of changes and rationale. Provide a link to external references / discussion if appropriate + +Development Guidelines: https://gitee.com/openharmony/third_party_llvm-project/blob/master/OpenHarmonyDevelopmentGuidelines.md diff --git a/OpenHarmonyDevelopmentGuidelines.md b/OpenHarmonyDevelopmentGuidelines.md new file mode 100644 index 000000000000..212f6596d863 --- /dev/null +++ b/OpenHarmonyDevelopmentGuidelines.md @@ -0,0 +1,37 @@ +## Generic Guidelines + +--------------------- + +### LLVM-related rules + +All changes should adhere to LLVM Developer Policy / Coding Standarts: +- https://llvm.org/docs/CodingStandards.html +- https://llvm.org/docs/DeveloperPolicy.html + +--------------------- + +### Mark changes properly + +All OHOS-related changes to mainline LLVM / clang code MUST be clearly marked such as: + +``` +unsigned LoopSizeThreshold = 32; // OHOS_LOCAL +``` + +or in case of multiline change: + +``` +// OHOS_LOCAL begin + +Some local OHOS change + +// OHOS_LOCAL begin +``` + +The presence of such marks greatly simplifies porting such code snippets to new LLVM versions. All such changes MUST be accompanied with a test case that MUST fail should the change is reverted. + +--------------------- + +### ABI Breakage + +All ABI-breaking changes MUST be scheduled to a major toolchain releases. One should explicitly discuss and document such changes. Ideally ABI-breaking change should cause linking error, it should not cause silent and hard to track bugs. -- Gitee