# HG changeset patch # User Shinji KONO # Date 1520294303 -32400 # Node ID dc788094b8e41dd221eb129bd784c004196c8519 # Parent 6cd7e602c98b8284fe4cc2686e383c3babb77fe7 force SROA and TailRecursionElimination on non optimize mode for code segment diff -r 6cd7e602c98b -r dc788094b8e4 lib/Transforms/Scalar/SROA.cpp --- 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( diff -r 6cd7e602c98b -r dc788094b8e4 lib/Transforms/Scalar/TailRecursionElimination.cpp --- 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( diff -r 6cd7e602c98b -r dc788094b8e4 tools/clang/lib/AST/ExprConstant.cpp --- 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: