diff --git a/Readme.md b/Readme.md index f8b08f09d68d310776cae873cce2a734c21b5dda..8f5c955775e599a7bef067b1e7500d477b82b048 100644 --- a/Readme.md +++ b/Readme.md @@ -1,98 +1,112 @@ -# OpenArkCompiler - -## 概述 ------------------ -> 面向多设备、支持多语言的统一编程平台。 - -OpenArkCompiler是来自华为方舟编译器的开源项目。 - -### OpenArkCompiler 四个技术特点 ### - -能够将不同语言代码编译成一套可执行文件,在运行环境中高效执行: -- 支持多语言联合优化、消除跨语言调用开销; -- 更轻量的语言运行时; -- 软硬协同充分发挥硬件能效; -- 支持多样化的终端设备平台 - -## 开源计划 -**编译器框架代码开源** -- 时间:2019年8月 -- 开源范围:编译器IR+中端语言实现 -- 开放能力: - - 框架开源供参考学习,了解方舟编译器架构及框架代码 - - 开发者可构建出完整编译器工具链,支持Java Sample程序编译(非应用) - -**后续开源范围** -陆续开源编译器前端、后端、编译优化;完整支持Java程序编译、JavaScript语言应用的编译等。 - -**计划持续更新...** - -## 相关文档 - -- 架构设计原理 - - [MAPLE IR Design](doc/en/MapleIRDesign.md) - - [RC API](doc/cn/RC_API.md) - - [Naive RC操作插入原理](doc/cn/Naive_RC_Insertion_Description.md) - - [虚函数表和接口函数表设计介绍](doc/cn/Vtable_Itable_Description.md) - - [Phase设计介绍](doc/cn/Compiler_Phase_Description.md) - -- [环境配置](doc/cn/Development_Preparation.md) - -- [开发者指南](doc/cn/Developer_Guide.md) - -- [编程规范](doc/cn/Programming_Specifications.md) - - - -## 许可证 -- [LICENSE](license/LICENSE) - - - -## Overview ------------------ -> Unified programming platform supporting multiple devices and languages - -OpenArkCompiler is Huawei's open source project. - -### Four Technical Features of OpenArkCompiler ### - -Compiles code of different languages into a set of executable files and efficiently executes the files in the running environment. -- Supports joint optimization of multiple languages and eliminates cross-language calling overhead. -- Achieves lightweight language runtime. -- Collaborates hardware and software to maximize hardware energy efficiency. -- Supports diversified terminal platforms. - -## Open Source Plan -**Open source compiler framework code** -- Time: August, 2019 -- Scope: Compiler IR and middle-end language implementation -- Benefits: - - Provides an open source framework for understanding the architecture and framework code of OpenArkCompiler. - - Allows developers to build a complete compiler toolchain that supports the compilation of Java samples (non-application). - -**Subsequent open source scope** -Open the front end, back end, and compilation optimization of compilers. Support the full compilation of Java programs and JavaScript applications. - -**Updating...** - -## Related Documents - -- Architecture Design Principles - - [MAPLE IR Design](doc/en/MapleIRDesign.md) - - [RC API](doc/en/RC_API.md) - - [Naive RC Insertion Principle](doc/en/Naive_RC_Insertion_Description.md) - - [Virtual Table and Interface Table Design](doc/en/Vtable_Itable_Description.md) - - [Phase Design](doc/en/Compiler_Phase_Description.md) - - -- [Environment Configuration](doc/en/Development_Preparation.md) - -- [Developer Guide](doc/en/Developer_Guide.md) - -- [Programming Specifications](doc/en/Programming_Specifications.md) - - - -## License -- [LICENSE](license/LICENSE) \ No newline at end of file +# OpenArkCompiler + +## 概述 +----------------- +> 面向多设备、支持多语言的统一编程平台。 + +OpenArkCompiler是来自华为方舟编译器的开源项目。 + +### OpenArkCompiler 四个技术特点 ### + +能够将不同语言代码编译成一套可执行文件,在运行环境中高效执行: +- 支持多语言联合优化、消除跨语言调用开销; +- 更轻量的语言运行时; +- 软硬协同充分发挥硬件能效; +- 支持多样化的终端设备平台 + +## 开源计划 +**编译器框架代码开源** +- 时间:2019年8月 +- 开源范围:编译器IR+中端语言实现 +- 开放能力: + - 框架开源供参考学习,了解方舟编译器架构及框架代码 + - 开发者可构建出完整编译器工具链,支持Java Sample程序编译(非应用) + +**后续开源范围** +陆续开源编译器前端、后端、编译优化;完整支持Java程序编译、JavaScript语言应用的编译等。 + +|开源范围 |2020年3月 |2020年5月 | +| ------------ | -------------------|--------------------- | +|编译器前端 |jbc前端基础框架 |前端全量开源 | +|编译器中端 |独立优化Phase每周持续开源 || +|编译器后端 |后端开源(O0) (aarch64)|独立优化按周开源(O2) (aarch64)| +|测试框架 |测试框架+基础用例开源| | + +**计划持续更新...** + +## 相关文档 + +- 架构设计原理 + - [MAPLE IR Design](doc/en/MapleIRDesign.md) + - [RC API](doc/cn/RC_API.md) + - [Naive RC操作插入原理](doc/cn/Naive_RC_Insertion_Description.md) + - [虚函数表和接口函数表设计介绍](doc/cn/Vtable_Itable_Description.md) + - [Phase设计介绍](doc/cn/Compiler_Phase_Description.md) + +- [环境配置](doc/cn/Development_Preparation.md) + +- [开发者指南](doc/cn/Developer_Guide.md) + +- [编程规范](doc/cn/Programming_Specifications.md) + + + +## 许可证 +- [LICENSE](license/LICENSE) + + + +## Overview +----------------- +> Unified programming platform supporting multiple devices and languages + +OpenArkCompiler is Huawei's open source project. + +### Four Technical Features of OpenArkCompiler ### + +Compiles code of different languages into a set of executable files and efficiently executes the files in the running environment. +- Supports joint optimization of multiple languages and eliminates cross-language calling overhead. +- Achieves lightweight language runtime. +- Collaborates hardware and software to maximize hardware energy efficiency. +- Supports diversified terminal platforms. + +## Open Source Plan +**Open source compiler framework code** +- Time: August, 2019 +- Scope: Compiler IR and middle-end language implementation +- Benefits: + - Provides an open source framework for understanding the architecture and framework code of OpenArkCompiler. + - Allows developers to build a complete compiler toolchain that supports the compilation of Java samples (non-application). + +**Subsequent open source scope** +Open the front end, back end, and compilation optimization of compilers. Support the full compilation of Java programs and JavaScript applications. + +|Open Source Scope|March 2020 |May 2020 | +| ------------ | -------------------|--------------------- | +|Front end| Jbc front-end basic framework | Front-end full open source | +|Middle end |Weekly open source optimization phase | | +|Back end |Backend open source (O0) (aarch64)|Weekly open source optimization (O2) (aarch64)| +|Test framework|Test framework and basic Cases| | + +**Updating...** + +## Related Documents + +- Architecture Design Principles + - [MAPLE IR Design](doc/en/MapleIRDesign.md) + - [RC API](doc/en/RC_API.md) + - [Naive RC Insertion Principle](doc/en/Naive_RC_Insertion_Description.md) + - [Virtual Table and Interface Table Design](doc/en/Vtable_Itable_Description.md) + - [Phase Design](doc/en/Compiler_Phase_Description.md) + + +- [Environment Configuration](doc/en/Development_Preparation.md) + +- [Developer Guide](doc/en/Developer_Guide.md) + +- [Programming Specifications](doc/en/Programming_Specifications.md) + + + +## License +- [LICENSE](license/LICENSE) diff --git a/build/config/BUILDCONFIG.gn b/build/config/BUILDCONFIG.gn index c36b0f3b9430e167055d9f124cb74ef9f56777e7..072250868a59e6935c52e23c37cb46512d5bfc3e 100644 --- a/build/config/BUILDCONFIG.gn +++ b/build/config/BUILDCONFIG.gn @@ -44,18 +44,29 @@ GN_RANLIB_CROSS_COMPILER = "/usr/bin/aarch64-linux-gnu-ranlib" # C/CXX Build flags cflags = [] +cflags_cc = [] +cflags_c = [] if (GN_BUILD_TYPE == "RELEASE") { - cflags_cc = [ "-O3" ] - cflags_c = [ "-O3" ] + cflags_cc += [ "-O2" ] + cflags_c += [ "-O2" ] } else if (GN_BUILD_TYPE == "DEBUG") { - cflags_cc = [ + cflags_cc += [ "-O0", "-g3", ] - cflags_c = [ + cflags_c += [ "-O0", "-g3", ] +} else { + cflags_cc += [ + "-O2", + "-g", + ] + cflags_c += [ + "-O2", + "-g", + ] } cflags_c += [ diff --git a/src/bin/jbc2mpl b/src/bin/jbc2mpl index 17dc2c32c6d4d65483c9d09f5de5231a67de1e21..cda7ba6d4877991ece9166593edc8e5aaeafbf5e 100755 Binary files a/src/bin/jbc2mpl and b/src/bin/jbc2mpl differ diff --git a/src/bin/maple b/src/bin/maple index a93ce9804a9290c9a5eafef1f5ae8660bb5ca8b8..7c64c05eacea21dce23efacac0cfb0482a9afc63 100755 Binary files a/src/bin/maple and b/src/bin/maple differ diff --git a/src/deplibs/libmplphase.a b/src/deplibs/libmplphase.a index 5548da460e160e785e02080520b02449cedaad31..3948955a14d609c1ab3234140e4df415018f77e1 100644 Binary files a/src/deplibs/libmplphase.a and b/src/deplibs/libmplphase.a differ diff --git a/src/deplibs/libmplutil.a b/src/deplibs/libmplutil.a index 1295f6e06da54aece2c4a83a0ee32569dfa11f17..87ca3e6fbb4f3f331ebc32da081cc729dccca0f4 100644 Binary files a/src/deplibs/libmplutil.a and b/src/deplibs/libmplutil.a differ diff --git a/src/maple_driver/include/option_parser.h b/src/maple_driver/include/option_parser.h index 3ef522dee9453213fb72f254e69be9ae3b9b3f6a..f228412da855bbb834ab01fe295a6a52b567ccfe 100644 --- a/src/maple_driver/include/option_parser.h +++ b/src/maple_driver/include/option_parser.h @@ -31,8 +31,7 @@ enum ArgCheckPolicy { kArgCheckPolicyNone, kArgCheckPolicyOptional, kArgCheckPolicyRequired, - kArgCheckPolicyNumeric, - kArgCheckPolicyBool + kArgCheckPolicyNumeric }; struct ExtraOption { @@ -91,7 +90,7 @@ struct Descriptor { const char * const exeName; // option key mapping to target tool - const std::vector extras; + const ExtraOption extras[kMaxExtraOptions]; #endif bool IsEnabledForCurrentBuild() const { @@ -204,12 +203,6 @@ class OptionParser { return nonOptionsArgs.size(); } -#ifdef OPTION_PARSER_EXTRAOPT - void InsertExtraUsage(const Descriptor &usage); -#endif - - void CreateNoOption(const Descriptor &usage); - void PrintUsage() const; #ifdef OPTION_PARSER_EXTRAOPT @@ -230,15 +223,11 @@ class OptionParser { } } bool CheckSpecialOption(const std::string &option, std::string &key, std::string &value); - std::vector rawUsages; + const Descriptor *rawUsages; std::multimap usages; std::vector