diff --git a/src/bin/jbc2mpl b/src/bin/jbc2mpl index 0ec0fc76111db1ad55ee08f5c33d4ce6c6e817f2..5e14ddc51ae05d079b9d0e13cbb8692be8ad1949 100755 Binary files a/src/bin/jbc2mpl and b/src/bin/jbc2mpl differ diff --git a/src/bin/maple b/src/bin/maple index 3c4417ecf864552484363d2cb4abf0de98045d9e..87c4a23d60a6038e948f2706e93efe2fa26917cd 100755 Binary files a/src/bin/maple and b/src/bin/maple differ diff --git a/src/bin/mplcg b/src/bin/mplcg index de252c51c1e310618d3fecf7474cb885cca26b72..0cde5feb50cb471e985d482b234ca9973458c259 100755 Binary files a/src/bin/mplcg and b/src/bin/mplcg differ diff --git a/src/deplibs/libmempool.a b/src/deplibs/libmempool.a index 3556ed066881d0c678af4cb3dd735b05f581182b..63f41759ca7a65c590579392f499f04b32c35abf 100644 Binary files a/src/deplibs/libmempool.a and b/src/deplibs/libmempool.a differ diff --git a/src/deplibs/libmplphase.a b/src/deplibs/libmplphase.a index aee4d531c7f47987b819538200196e673f200284..f5f8dfae5c742484feb36f112ef19111e4d4d3f0 100644 Binary files a/src/deplibs/libmplphase.a and b/src/deplibs/libmplphase.a differ diff --git a/src/maple_driver/include/file_utils.h b/src/maple_driver/include/file_utils.h index 5b832d8f85362bcd29f79ba0dfcd8fa1aafc483d..47a6cb2e85bd6b31328acf88e1a8266a9e4185fe 100644 --- a/src/maple_driver/include/file_utils.h +++ b/src/maple_driver/include/file_utils.h @@ -27,7 +27,6 @@ class FileUtils { static std::string GetFileName(const std::string &filePath, bool isWithExtension); static std::string GetFileExtension(const std::string &filePath); static std::string GetFileFolder(const std::string &filePath); - static std::string ConvertPathIfNeeded(const std::string &src); static int Remove(const std::string &filePath); static std::string AppendMapleRootIfNeeded(bool needRootPath, const std::string &path, const std::string &defaultRoot = "." + kFileSeperatorStr); diff --git a/src/maple_driver/include/usages.h b/src/maple_driver/include/usages.h index a4342640030406c70e910f5ca887e68d824797a5..cbc774fd57d377a6035e64799ce0b7ad591e195e 100644 --- a/src/maple_driver/include/usages.h +++ b/src/maple_driver/include/usages.h @@ -75,10 +75,10 @@ enum OptionIndex : uint64 { kInlineWithoutProfile, kMpl2MplUseInline, kMpl2MplNoInline, + kMpl2MplNoInlineFuncList, kMpl2MplUseCrossModuleInline, kMpl2MplNoCrossModuleInline, kInlineSmallFunctionThreshold, - kInlineSyntheticFunctionThreshold, kInlineHotFunctionThreshold, kInlineModuleGrowth, kInlineColdFunctionThreshold, diff --git a/src/maple_driver/src/compiler.cpp b/src/maple_driver/src/compiler.cpp index 5b26d21deb782e8681b753266ef46d671e6e7ae2..42baa791156e2476e772f47260572585fe203c73 100644 --- a/src/maple_driver/src/compiler.cpp +++ b/src/maple_driver/src/compiler.cpp @@ -30,7 +30,7 @@ const std::string kBinNameMapleComb = "maplecomb"; int Compiler::Exe(const MplOptions &mplOptions, const std::string &options) const { std::ostringstream ostrStream; ostrStream << GetBinPath(mplOptions) << GetBinName(); - std::string binPath = FileUtils::ConvertPathIfNeeded(ostrStream.str()); + std::string binPath = ostrStream.str(); return SafeExe::Exe(binPath, options); } @@ -87,7 +87,7 @@ std::string Compiler::MakeOption(const MplOptions &options) const { if (options.HasSetDebugFlag()) { LogInfo::MapleLogger() << Compiler::GetName() << " input files: " << GetInputFileName(options) << '\n'; } - return FileUtils::ConvertPathIfNeeded(strOption.str()); + return strOption.str(); } void Compiler::AppendDefaultOptions(std::map &finalOptions, diff --git a/src/maple_driver/src/file_utils.cpp b/src/maple_driver/src/file_utils.cpp index 3eea8ac8c66950130795c72021c272d17a4e9939..4ace696857cb8bf8853155ed01e405ee8ccc6899 100644 --- a/src/maple_driver/src/file_utils.cpp +++ b/src/maple_driver/src/file_utils.cpp @@ -42,15 +42,14 @@ std::string FileUtils::GetFileExtension(const std::string &filePath) { std::string FileUtils::GetFileFolder(const std::string &filePath) { std::string folder = StringUtils::GetStrBeforeLast(filePath, kFileSeperatorStr, true); +#ifdef _WIN32 + if (folder.empty()) { + folder = StringUtils::GetStrBeforeLast(filePath, kFileSeperatorWindowsStyleStr, true); + } +#endif return folder.empty() ? ("." + kFileSeperatorStr) : (folder + kFileSeperatorStr); } -std::string FileUtils::ConvertPathIfNeeded(const std::string &src) { - std::string ret = src; - ret = StringUtils::Replace(ret, kFileSeperatorWindowsStyleStr, kFileSeperatorLinuxStyleStr); - return ret; -} - int FileUtils::Remove(const std::string &filePath) { return remove(filePath.c_str()); } diff --git a/src/maple_driver/src/maple_comb_compiler.cpp b/src/maple_driver/src/maple_comb_compiler.cpp index abdf0e4ed4f321913de8f8db58ea56016dd70b18..6621692a0a88d4af950ac0c3750d7f6e9dc3b8f0 100644 --- a/src/maple_driver/src/maple_comb_compiler.cpp +++ b/src/maple_driver/src/maple_comb_compiler.cpp @@ -226,6 +226,9 @@ Options *MapleCombCompiler::MakeMpl2MplOptions(const MplOptions &options, MemPoo case kMpl2MplNoInline: mpl2mplOption->useInline = false; break; + case kMpl2MplNoInlineFuncList: + mpl2mplOption->noInlineFuncList = opt.Args(); + break; case kMpl2MplUseCrossModuleInline: mpl2mplOption->useCrossModuleInline = true; break; @@ -240,14 +243,6 @@ Options *MapleCombCompiler::MakeMpl2MplOptions(const MplOptions &options, MemPoo mpl2mplOption->inlineSmallFunctionThreshold = std::stoul(opt.Args()); } break; - case kInlineSyntheticFunctionThreshold: - if (opt.Args().empty()) { - LogInfo::MapleLogger(kLlErr) << "expecting not empty for --inline-synthetic-function-threshold\n"; - exit(1); - } else { - mpl2mplOption->inlineSyntheticFunctionThreshold = std::stoul(opt.Args()); - } - break; case kInlineHotFunctionThreshold: if (opt.Args().empty()) { LogInfo::MapleLogger(kLlErr) << "expecting not empty for --inline-hot-function-threshold\n"; diff --git a/src/maple_driver/src/mpl_options.cpp b/src/maple_driver/src/mpl_options.cpp index f1b0442b7614d5d013e7710e24fc2a21bb2cab9b..51fa14563b8ac4ef96f2334a3fb3436162596844 100644 --- a/src/maple_driver/src/mpl_options.cpp +++ b/src/maple_driver/src/mpl_options.cpp @@ -615,6 +615,18 @@ const mapleOption::Descriptor USAGES[] = { " --no-inline \tDisable function inlining\n", "mpl2mpl", { { nullptr } } }, + { kMpl2MplNoInlineFuncList, + 0, + nullptr, + "no-inlinefunclist", + nullptr, + false, + nullptr, + mapleOption::BuildType::kBuildTypeAll, + mapleOption::ArgCheckPolicy::kArgCheckPolicyRequired, + " --no-inlinefunclist=list \tDo not inline function in this list\n", + "mpl2mpl", + { { nullptr } } }, { kMpl2MplUseCrossModuleInline, 0, nullptr, @@ -651,18 +663,6 @@ const mapleOption::Descriptor USAGES[] = { " --inline-small-function-threshold=15 \tThreshold for inlining small function\n", "mpl2mpl", { { nullptr } } }, - { kInlineSyntheticFunctionThreshold, - 0, - nullptr, - "inline-synthetic-function-threshold", - nullptr, - false, - nullptr, - mapleOption::BuildType::kBuildTypeAll, - mapleOption::ArgCheckPolicy::kArgCheckPolicyRequired, - " --inline-synthetic-function-threshold=15 \tThreshold for inlining synthetic function\n", - "mpl2mpl", - { { nullptr } } }, { kInlineHotFunctionThreshold, 0, nullptr, diff --git a/src/maple_ir/include/mir_function.h b/src/maple_ir/include/mir_function.h index cb03661ab5ed3b62126bdd95bb00bde0edb5b172..966007690f3e0640436456467ccd78071a533c62 100644 --- a/src/maple_ir/include/mir_function.h +++ b/src/maple_ir/include/mir_function.h @@ -212,10 +212,6 @@ class MIRFunction { return funcAttrs.GetAttr(FUNCATTR_protected); } - bool IsPackagePrivate() const { - return !IsPublic() && !IsPrivate() && !IsProtected(); - } - bool IsConstructor() const { return funcAttrs.GetAttr(FUNCATTR_constructor); } @@ -667,7 +663,7 @@ class MIRFunction { formals.clear(); } - uint32 GetSymbolTabSize() const { + size_t GetSymbolTabSize() const { return symTab->GetSymbolTableSize(); } MIRSymbol *GetSymbolTabItem(uint32 idx, bool checkFirst = false) const { diff --git a/src/maple_ir/include/option.h b/src/maple_ir/include/option.h index 4ddf02c691bf3313daeafcc1dd313522d0978c7b..bbb1daf689e4a6ceb983bcbf4f7a4a619eea4f00 100644 --- a/src/maple_ir/include/option.h +++ b/src/maple_ir/include/option.h @@ -59,9 +59,9 @@ class Options { static bool nativeWrapper; static bool inlineWithProfile; static bool useInline; + static std::string noInlineFuncList; static bool useCrossModuleInline; static uint32 inlineSmallFunctionThreshold; - static uint32 inlineSyntheticFunctionThreshold; static uint32 inlineHotFunctionThreshold; static uint32 inlineModuleGrowth; static uint32 inlineColdFunctionThreshold; diff --git a/src/maple_ir/src/option.cpp b/src/maple_ir/src/option.cpp index 1d1db7188c2ff7fae665a27ca53c31213b0c5d8d..6cd1f467ca27ab79a5ee72f1598f76fb90a5fb30 100644 --- a/src/maple_ir/src/option.cpp +++ b/src/maple_ir/src/option.cpp @@ -35,8 +35,8 @@ bool Options::nativeWrapper = true; // Enabled by default bool Options::inlineWithProfile = false; bool Options::useInline = true; // Enabled by default bool Options::useCrossModuleInline = true; // Enabled by default +std::string Options::noInlineFuncList = ""; uint32 Options::inlineSmallFunctionThreshold = 15; -uint32 Options::inlineSyntheticFunctionThreshold = 15; uint32 Options::inlineHotFunctionThreshold = 30; uint32 Options::inlineModuleGrowth = 10; uint32 Options::inlineColdFunctionThreshold = 3; @@ -69,10 +69,10 @@ enum OptionIndex { kInlineWithoutProfile, kUseInline, kNoInline, + kNoInlineFuncList, kUseCrossModuleInline, kNoCrossModuleInline, kInlineSmallFunctionThreshold, - kInlineSyntheticFunctionThreshold, kInlineHotFunctionThreshold, kInlineModuleGrowth, kInlineColdFunctionThreshold, @@ -120,15 +120,14 @@ const Descriptor kUsage[] = { " --inline Enable function inlining" }, { kNoInline, 0, "", "no-inline", kBuildTypeAll, kArgCheckPolicyNone, " --no-inline Disable function inlining" }, + { kNoInlineFuncList, 0, "", "no-inlinefunclist", kBuildTypeAll, kArgCheckPolicyRequired, + " --no-inlinefunclist=list Do not inline function in this list" }, { kUseCrossModuleInline, 0, "", "cross-module-inline", kBuildTypeAll, kArgCheckPolicyNone, " --cross-module-inline Enable cross-module inlining" }, { kNoCrossModuleInline, 0, "", "no-cross-module-inline", kBuildTypeAll, kArgCheckPolicyNone, " --no-cross-module-inline Disable cross-module inlining" }, { kInlineSmallFunctionThreshold, 0, "", "inline-small-function-threshold", kBuildTypeAll, kArgCheckPolicyRequired, " --inline-small-function-threshold=15 Threshold for inlining small function" }, - { kInlineSyntheticFunctionThreshold, 0, "", "inline-synthetic-function-threshold", - kBuildTypeAll, kArgCheckPolicyRequired, - " --inline-synthetic-function-threshold=15 Threshold for inlining synthetic function" }, { kInlineHotFunctionThreshold, 0, "", "inline-hot-function-threshold", kBuildTypeAll, kArgCheckPolicyRequired, " --inline-hot-function-threshold=30 Threshold for inlining hot function" }, { kInlineModuleGrowth, 0, "", "inline-module-growth", kBuildTypeAll, kArgCheckPolicyRequired, @@ -226,6 +225,9 @@ bool Options::ParseOptions(int argc, char **argv, std::string &fileName) const { case kNoInline: Options::useInline = false; break; + case kNoInlineFuncList: + Options::noInlineFuncList = opt.Args(); + break; case kUseCrossModuleInline: Options::useCrossModuleInline = true; break; @@ -235,9 +237,6 @@ bool Options::ParseOptions(int argc, char **argv, std::string &fileName) const { case kInlineSmallFunctionThreshold: Options::inlineSmallFunctionThreshold = std::stoul(opt.Args()); break; - case kInlineSyntheticFunctionThreshold: - Options::inlineSyntheticFunctionThreshold = std::stoul(opt.Args()); - break; case kInlineHotFunctionThreshold: Options::inlineHotFunctionThreshold = std::stoul(opt.Args()); break; diff --git a/src/maple_me/include/bb.h b/src/maple_me/include/bb.h index ab10431631a9b7c9413bd5f60f8d68c2fc57e880..443f1668e070164c31a70773951ef104824a06d6 100644 --- a/src/maple_me/include/bb.h +++ b/src/maple_me/include/bb.h @@ -289,6 +289,11 @@ class BB { kind = bbKind; } + void SetKindReturn() { + SetKind(kBBReturn); + SetAttributes(kBBAttrIsExit); + } + MapleVector &GetPred() { return pred; } diff --git a/src/maple_me/src/irmap.cpp b/src/maple_me/src/irmap.cpp index 75abf71e9ed0a0df73a424251796df140fc971da..fae2c756f1eab03bdedf6f7560ad5d20fa87778a 100644 --- a/src/maple_me/src/irmap.cpp +++ b/src/maple_me/src/irmap.cpp @@ -394,7 +394,7 @@ MeStmt *IRMap::BuildMeStmtWithNoSSAPart(StmtNode &stmt) { case OP_free: case OP_switch: { auto &unaryStmt = static_cast(stmt); - UnaryMeStmt *unMeStmt = + auto *unMeStmt = static_cast((op == OP_switch) ? NewInPool(&stmt) : New(&stmt)); unMeStmt->SetOpnd(0, BuildExpr(*unaryStmt.Opnd(0))); return unMeStmt; @@ -731,7 +731,7 @@ bool IRMap::ReplaceMeExprStmt(MeStmt &meStmt, MeExpr &meExpr, MeExpr &repexpr) { bool curOpndReplaced = false; if (i == 0 && op == OP_iassign) { - IassignMeStmt &ivarStmt = static_cast(meStmt); + auto &ivarStmt = static_cast(meStmt); MeExpr *oldBase = ivarStmt.GetLHS()->GetOpnd(0); MeExpr *newBase = nullptr; if (oldBase == &meExpr) { diff --git a/src/maple_me/src/me_builder.cpp b/src/maple_me/src/me_builder.cpp index 94048273ab77f9d5c26cd6b63ae5242fe6441853..94d10102bd098efdc74839da72c7e4bf7cb554fd 100644 --- a/src/maple_me/src/me_builder.cpp +++ b/src/maple_me/src/me_builder.cpp @@ -41,7 +41,7 @@ MeExpr &MeBuilder::CreateMeExpr(int32 exprId, MeExpr &meExpr) const { resultExpr = New(exprId, static_cast(meExpr).GetTyIdx()); break; case kMeOpFieldsDist: { - FieldsDistMeExpr &expr = static_cast(meExpr); + auto &expr = static_cast(meExpr); resultExpr = New(exprId, expr.GetTyIdx(), expr.GetFieldID1(), expr.GetFieldID2()); break; } @@ -83,7 +83,7 @@ MeExpr *MeBuilder::BuildMeExpr(BaseNode &mirNode) const { } MeExpr *MeBuilder::BuildAddrofMeExpr(BaseNode &mirNode) const { - AddrofSSANode &addrofNode = static_cast(mirNode); + auto &addrofNode = static_cast(mirNode); AddrofMeExpr &meExpr = *New(kInvalidExprID, addrofNode.GetSSAVar()->GetOrigSt()->GetIndex()); meExpr.InitBase(mirNode.GetOpCode(), mirNode.GetPrimType(), mirNode.GetNumOpnds()); meExpr.SetFieldID(addrofNode.GetFieldID()); @@ -109,7 +109,7 @@ MeExpr *MeBuilder::BuildSizeoftypeMeExpr(BaseNode &mirNode) const { } MeExpr *MeBuilder::BuildFieldsDistMeExpr(BaseNode &mirNode) const { - FieldsDistNode &fieldsDistNode = static_cast(mirNode); + auto &fieldsDistNode = static_cast(mirNode); FieldsDistMeExpr &meExpr = *New(kInvalidExprID, fieldsDistNode.GetTyIdx(), fieldsDistNode.GetFiledID1(), fieldsDistNode.GetFiledID2()); meExpr.InitBase(mirNode.GetOpCode(), mirNode.GetPrimType(), mirNode.GetNumOpnds()); @@ -117,7 +117,7 @@ MeExpr *MeBuilder::BuildFieldsDistMeExpr(BaseNode &mirNode) const { } MeExpr *MeBuilder::BuildIvarMeExpr(BaseNode &mirNode) const { - IreadSSANode &ireadSSANode = static_cast(mirNode); + auto &ireadSSANode = static_cast(mirNode); IvarMeExpr &meExpr = *New(kInvalidExprID); meExpr.SetFieldID(ireadSSANode.GetFieldID()); meExpr.SetTyIdx(ireadSSANode.GetTyIdx()); @@ -126,7 +126,7 @@ MeExpr *MeBuilder::BuildIvarMeExpr(BaseNode &mirNode) const { } MeExpr *MeBuilder::BuildConstMeExpr(BaseNode &mirNode) const { - ConstvalNode &constvalNode = static_cast(mirNode); + auto &constvalNode = static_cast(mirNode); ConstMeExpr &meExpr = *New(kInvalidExprID, constvalNode.GetConstVal()); meExpr.SetOp(OP_constval); meExpr.SetPtyp(constvalNode.GetPrimType()); @@ -158,7 +158,7 @@ MeExpr *MeBuilder::BuildOpMeExprForTypeCvt(BaseNode &mirNode) const { } MeExpr *MeBuilder::BuildOpMeExprForRetype(BaseNode &mirNode) const { - RetypeNode &retypeNode = static_cast(mirNode); + auto &retypeNode = static_cast(mirNode); OpMeExpr *meExpr = BuildOpMeExpr(mirNode); meExpr->SetOpndType(retypeNode.FromType()); meExpr->SetTyIdx(retypeNode.GetTyIdx()); @@ -166,7 +166,7 @@ MeExpr *MeBuilder::BuildOpMeExprForRetype(BaseNode &mirNode) const { } MeExpr *MeBuilder::BuildOpMeExprForIread(BaseNode &mirNode) const { - IreadNode &ireadNode = static_cast(mirNode); + auto &ireadNode = static_cast(mirNode); OpMeExpr *meExpr = BuildOpMeExpr(mirNode); meExpr->SetTyIdx(ireadNode.GetTyIdx()); meExpr->SetFieldID(ireadNode.GetFieldID()); @@ -174,7 +174,7 @@ MeExpr *MeBuilder::BuildOpMeExprForIread(BaseNode &mirNode) const { } MeExpr *MeBuilder::BuildOpMeExprForExtractbits(BaseNode &mirNode) const { - ExtractbitsNode &extractbitsNode = static_cast(mirNode); + auto &extractbitsNode = static_cast(mirNode); OpMeExpr *meExpr = BuildOpMeExpr(mirNode); meExpr->SetBitsOffSet(extractbitsNode.GetBitsOffset()); meExpr->SetBitsSize(extractbitsNode.GetBitsSize()); @@ -194,7 +194,7 @@ MeExpr *MeBuilder::BuildOpMeExprForResolveFunc(BaseNode &mirNode) const { } MeExpr *MeBuilder::BuildNaryMeExprForArray(BaseNode &mirNode) const { - ArrayNode &arrayNode = static_cast(mirNode); + auto &arrayNode = static_cast(mirNode); NaryMeExpr &meExpr = *NewInPool(kInvalidExprID, arrayNode.GetTyIdx(), INTRN_UNDEFINED, arrayNode.GetBoundsCheck()); meExpr.InitBase(mirNode.GetOpCode(), mirNode.GetPrimType(), mirNode.GetNumOpnds()); @@ -209,7 +209,7 @@ MeExpr *MeBuilder::BuildNaryMeExprForIntrinsicop(BaseNode &mirNode) const { } MeExpr *MeBuilder::BuildNaryMeExprForIntrinsicWithType(BaseNode &mirNode) const { - IntrinsicopNode &intrinNode = static_cast(mirNode); + auto &intrinNode = static_cast(mirNode); NaryMeExpr &meExpr = *NewInPool(kInvalidExprID, intrinNode.GetTyIdx(), intrinNode.GetIntrinsic(), false); meExpr.InitBase(mirNode.GetOpCode(), mirNode.GetPrimType(), mirNode.GetNumOpnds()); return &meExpr; diff --git a/src/maple_me/src/me_cfg.cpp b/src/maple_me/src/me_cfg.cpp index 1ec98652992f838e7bd1e803d057a3ad449b7438..3310286352324531285466a5c776e6a2b3ba8b0d 100644 --- a/src/maple_me/src/me_cfg.cpp +++ b/src/maple_me/src/me_cfg.cpp @@ -611,8 +611,7 @@ void MeCFG::WontExitAnalysis() { bIt = build_filter_iterator( newBBIt, std::bind(FilterNullPtr::const_iterator>, std::placeholders::_1, func.end())); eIt = func.valid_end(); - newBB->SetKind(kBBReturn); - newBB->SetAttributes(kBBAttrIsExit); + newBB->SetKindReturn(); newBB->SetAttributes(kBBAttrArtificial); bb->GetSucc().push_back(newBB); newBB->GetPred().push_back(bb); @@ -699,7 +698,7 @@ void MeCFG::Dump() const { // BSF Dump the cfg LogInfo::MapleLogger() << "####### CFG Dump: "; ASSERT(func.NumBBs() != 0, "size to be allocated is 0"); - bool *visitedMap = static_cast(calloc(func.NumBBs(), sizeof(bool))); + auto *visitedMap = static_cast(calloc(func.NumBBs(), sizeof(bool))); if (visitedMap != nullptr) { std::queue qu; qu.push(func.GetFirstBB()); diff --git a/src/maple_me/src/me_function.cpp b/src/maple_me/src/me_function.cpp index a7295b6fc25db25a3f0a148a26b0c101b31ad92c..fb747bea21ef2f2a8351cbb7133509b1900713dc 100644 --- a/src/maple_me/src/me_function.cpp +++ b/src/maple_me/src/me_function.cpp @@ -178,8 +178,7 @@ void MeFunction::CreateBasicBlocks() { curBB->SetFirst(stmt); } curBB->SetLast(stmt); - curBB->SetKind(kBBReturn); - curBB->SetAttributes(kBBAttrIsExit); + curBB->SetKindReturn(); if (nextStmt != nullptr) { BB *newBB = NewBasicBlock(); if (tryStmt != nullptr) { @@ -385,10 +384,9 @@ void MeFunction::CreateBasicBlocks() { // insert a return statement lastBB->SetFirst(mirModule.GetMIRBuilder()->CreateStmtReturn(nullptr)); lastBB->SetLast(lastBB->GetStmtNodes().begin().d()); - lastBB->SetAttributes(kBBAttrIsExit); - lastBB->SetKind(kBBReturn); + lastBB->SetKindReturn(); } else if (lastBB->GetKind() == kBBUnknown) { - lastBB->SetKind(kBBReturn); + lastBB->SetKindReturn(); } } diff --git a/src/mempool/include/maple_string.h b/src/mempool/include/maple_string.h index 3d4f59a7916881c034a5c17cfac85661f3acae74..2e78dbb911f43bb55824ff36d46b3315d0c52233 100644 --- a/src/mempool/include/maple_string.h +++ b/src/mempool/include/maple_string.h @@ -37,10 +37,6 @@ class MapleString { return dataLength; } - operator const char *() const { - return data; - } - char *c_str() { return data; } @@ -243,6 +239,12 @@ class MapleString { unsigned int dataLength = 0; }; +template +inline OS &operator<<(OS &os, const MapleString &data) { + os << data.c_str(); + return os; +} + // global operators bool operator==(const MapleString &str1, const MapleString &str2); bool operator==(const MapleString &str1, const char *str2);