diff --git a/.gitee/PULL_REQUEST_TEMPLATE.en.md b/.gitee/PULL_REQUEST_TEMPLATE.en.md index aa60947a3ec94a92aa3320fa9a1ae3508d654637..f6d433f6d1889bfeec2696275bd9eae65884796a 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 0000000000000000000000000000000000000000..212f6596d863b88a62bf8b88491b27c9a7934c8a --- /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.