Mercurial > hg > CbC > CbC_llvm
changeset 137:dc788094b8e4
force SROA and TailRecursionElimination on non optimize mode for code segment
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Tue, 06 Mar 2018 08:58:23 +0900 |
parents | 6cd7e602c98b |
children | 53f12981605a 3b9da4c581d5 |
files | lib/Transforms/Scalar/SROA.cpp lib/Transforms/Scalar/TailRecursionElimination.cpp tools/clang/lib/AST/ExprConstant.cpp |
diffstat | 3 files changed, 4 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/lib/Transforms/Scalar/SROA.cpp Sat Feb 17 11:50:31 2018 +0900 +++ b/lib/Transforms/Scalar/SROA.cpp Tue Mar 06 08:58:23 2018 +0900 @@ -4454,7 +4454,7 @@ #endif bool runOnFunction(Function &F) override { - if (skipFunction(F)) + if ( (! F.getReturnType()->is__CodeTy()) && skipFunction(F)) return false; auto PA = Impl.runImpl(
--- a/lib/Transforms/Scalar/TailRecursionElimination.cpp Sat Feb 17 11:50:31 2018 +0900 +++ b/lib/Transforms/Scalar/TailRecursionElimination.cpp Tue Mar 06 08:58:23 2018 +0900 @@ -177,7 +177,7 @@ }; } -#ifndef noCbC +#ifndef noCmarkTailToCodeSegmentsbC static bool markTailToCodeSegments(Function &F){ bool Modified = false; for (Function::iterator BB = F.begin(), E = F.end(); BB != E; ++BB) { @@ -845,7 +845,7 @@ } bool runOnFunction(Function &F) override { - if (skipFunction(F)) + if ( (! F.getReturnType()->is__CodeTy()) && skipFunction(F)) return false; return eliminateTailRecursion(
--- a/tools/clang/lib/AST/ExprConstant.cpp Sat Feb 17 11:50:31 2018 +0900 +++ b/tools/clang/lib/AST/ExprConstant.cpp Tue Mar 06 08:58:23 2018 +0900 @@ -7189,6 +7189,7 @@ #define PLACEHOLDER_TYPE(ID, SINGLETON_ID) case BuiltinType::ID: break; #include "clang/AST/BuiltinTypes.def" case BuiltinType::Void: + case BuiltinType::__Code: return void_type_class; case BuiltinType::Bool: