diff --git a/doc/cn/Development_Preparation.md b/doc/cn/Development_Preparation.md index 567caeb0373bdfc2acc58767f46797b82fb8675e..ead71c72a74f8e7531d529cd42f32f8377c6784e 100644 --- a/doc/cn/Development_Preparation.md +++ b/doc/cn/Development_Preparation.md @@ -38,7 +38,7 @@ GN_AR_COMPILER = "${MAPLE_ROOT}/tools/clang_llvm-8.0.0-x86_64-linux-gnu-ubuntu-1 下载**Ninja(v1.9.0)**及**GN(Linux Version)** Ninja下载地址:https://github.com/ninja-build/ninja/releases -GN下载地址:https://archive.softwareheritage.org/browse/content/sha1_git:2dc0d5b26caef44f467de8120b26f8aad8b878be/raw/?filename=gn +GN下载地址:https://gitee.com/xlnb/gn_binary 将GN和Ninja可执行程序放置到openarkcompiler/tools目录,然后修改这两个文件为可执行: ``` diff --git a/doc/en/Development_Preparation.md b/doc/en/Development_Preparation.md index 921fd17a643dbab8afef6432ffc9615b671225c9..c301df29248855301980335410b65b2edb397219 100644 --- a/doc/en/Development_Preparation.md +++ b/doc/en/Development_Preparation.md @@ -38,7 +38,7 @@ ${MAPLE_ROOT} is the root directory of the OpenArkCompiler source code. Download **Ninja(v1.9.0)** and **GN(Linux Version)** Ninja download address: https://github.com/ninja-build/ninja/releases -GN download address: https://archive.softwareheritage.org/browse/content/sha1_git:2dc0d5b26caef44f467de8120b26f8aad8b878be/raw/?filename=gn +GN download address: https://gitee.com/xlnb/gn_binary Place the executable programs of GN and Ninja in the openarkcompiler/tools directory, modify these two files to be executable. diff --git a/src/bin/maple b/src/bin/maple index 579c530236d0bdf8e7c01fb6eac16857a933dd44..88223d1feb4f33d9a193d8b9d1a50230b10a5c0f 100755 Binary files a/src/bin/maple and b/src/bin/maple differ diff --git a/src/maple_me/src/prop.cpp b/src/maple_me/src/prop.cpp index 2175e61b07457680e20290c646382e1bc79df89b..89a3f8c6826c32f489fd031c7e144823373647dd 100644 --- a/src/maple_me/src/prop.cpp +++ b/src/maple_me/src/prop.cpp @@ -27,12 +27,8 @@ bool IsCvtSafe(PrimType typeA, PrimType typeB) { return false; } - if ((IsPrimitiveInteger(typeA) && IsPrimitiveInteger(typeB)) || - (IsPrimitiveFloat(typeA) && IsPrimitiveFloat(typeB))) { - return true; - } - - return false; + return (IsPrimitiveInteger(typeA) && IsPrimitiveInteger(typeB)) || + (IsPrimitiveFloat(typeA) && IsPrimitiveFloat(typeB)); } } // namespace @@ -390,8 +386,8 @@ MeExpr &Prop::PropVar(VarMeExpr &varMeExpr, bool atParm, bool checkPhi) { } MapleVector opndsVec = defPhi.GetOpnds(); for (auto it = opndsVec.rbegin() + 1; it != opndsVec.rend(); ++it) { - VarMeExpr *phiopnd = *it; - MeExpr &opndProp = PropVar(utils::ToRef(phiopnd), atParm, false); + VarMeExpr *phiOpnd = *it; + MeExpr &opndProp = PropVar(utils::ToRef(phiOpnd), atParm, false); if (&opndProp != opndLastProp) { return varMeExpr; } diff --git a/src/mpl2mpl/src/muid_replacement.cpp b/src/mpl2mpl/src/muid_replacement.cpp index df6f541a604849d99985fe3eb7705118d530aca3..a9cb22d969dfb1d98042eef8d257528e49485dc4 100644 --- a/src/mpl2mpl/src/muid_replacement.cpp +++ b/src/mpl2mpl/src/muid_replacement.cpp @@ -488,8 +488,11 @@ void MUIDReplacement::ReplaceFieldMetaStaticAddr(MIRSymbol &mirSymbol, int64 ind return; } MIRAggConst *aggConst = safe_cast(fieldOffsetDataSt->GetKonst()); + CHECK_NULL_FATAL(aggConst); MIRAggConst *agg = safe_cast(aggConst->GetConstVecItem(0)); + CHECK_NULL_FATAL(agg); MIRConst *elem = agg->GetConstVecItem(0); + CHECK_NULL_FATAL(elem); CHECK_FATAL(elem->GetKind() == kConstAddrof, "static field must kConstAddrof."); MIRType &type = elem->GetType(); @@ -758,8 +761,9 @@ void MUIDReplacement::ReplaceFuncTable(const std::string &name) { isVtab = true; } for (auto *&oldTabEntry : safe_cast(oldConst)->GetConstVec()) { + CHECK_NULL_FATAL(oldTabEntry); if (oldTabEntry->GetKind() == kConstAggConst) { - auto *aggrC = safe_cast(oldTabEntry); + auto *aggrC = static_cast(oldTabEntry); for (size_t i = 0; i < aggrC->GetConstVec().size(); ++i) { ReplaceAddroffuncConst(aggrC->GetConstVecItem(i), i + 1, isVtab); } @@ -770,11 +774,12 @@ void MUIDReplacement::ReplaceFuncTable(const std::string &name) { } void MUIDReplacement::ReplaceAddroffuncConst(MIRConst *&entry, uint32 fieldID, bool isVtab = false) { + CHECK_NULL_FATAL(entry); if (entry->GetKind() != kConstAddrofFunc) { return; } MIRType &voidType = *GlobalTables::GetTypeTable().GetVoidPtr(); - auto *funcAddr = safe_cast(entry); + auto *funcAddr = static_cast(entry); MIRFunction *func = GlobalTables::GetFunctionTable().GetFunctionFromPuidx(funcAddr->GetValue()); uint64 offset = 0; MIRIntConst *constNode = nullptr; @@ -815,11 +820,11 @@ void MUIDReplacement::ReplaceDataTable(const std::string &name) { return; } for (MIRConst *&oldTabEntry : oldConst->GetConstVec()) { - ASSERT(oldTabEntry != nullptr, "null ptr check!"); + CHECK_NULL_FATAL(oldTabEntry); if (oldTabEntry->GetKind() == kConstAggConst) { - auto *aggrC = safe_cast(oldTabEntry); + auto *aggrC = static_cast(oldTabEntry); for (size_t i = 0; i < aggrC->GetConstVec().size(); ++i) { - ASSERT(aggrC->GetConstVecItem(i) != nullptr, "null ptr check!"); + CHECK_NULL_FATAL(aggrC->GetConstVecItem(i)); ReplaceAddrofConst(aggrC->GetConstVecItem(i)); aggrC->GetConstVecItem(i)->SetFieldID(i + 1); } @@ -834,11 +839,11 @@ void MUIDReplacement::ReplaceDecoupleKeyTable(MIRAggConst* oldConst) { return; } for (MIRConst *&oldTabEntry : oldConst->GetConstVec()) { - ASSERT(oldTabEntry != nullptr, "null ptr check!"); + CHECK_NULL_FATAL(oldTabEntry); if (oldTabEntry->GetKind() == kConstAggConst) { - auto *aggrC = safe_cast(oldTabEntry); + auto *aggrC = static_cast(oldTabEntry); for (size_t i = 0; i < aggrC->GetConstVec().size(); ++i) { - ASSERT(aggrC->GetConstVecItem(i) != nullptr, "null ptr check!"); + CHECK_NULL_FATAL(aggrC->GetConstVecItem(i)); if (aggrC->GetConstVecItem(i)->GetKind() == kConstAggConst) { ReplaceDecoupleKeyTable(safe_cast(aggrC->GetConstVecItem(i))); } else { @@ -857,9 +862,9 @@ void MUIDReplacement::ReplaceAddrofConst(MIRConst *&entry) { return; } MIRType &voidType = *GlobalTables::GetTypeTable().GetVoidPtr(); - auto *addr = safe_cast(entry); + auto *addr = static_cast(entry); MIRSymbol *addrSym = GlobalTables::GetGsymTable().GetSymbolFromStidx(addr->GetSymbolIndex().Idx()); - ASSERT(addrSym != nullptr, "Invalid MIRSymbol"); + CHECK_NULL_FATAL(addrSym); if (!addrSym->IsReflectionClassInfo() && !addrSym->IsStatic()) { return; }