# HG changeset patch # User mir3636 # Date 1470306435 -32400 # Node ID a6d007e4e7a3ba0fb1cc41117071867308337c25 # Parent b8d969d74b9314e5d8126890876ac9d57240546d in __code cleanup is done just before tail call (goto) diff -r b8d969d74b93 -r a6d007e4e7a3 tools/clang/lib/CodeGen/CGCall.cpp --- a/tools/clang/lib/CodeGen/CGCall.cpp Mon Jun 27 19:21:24 2016 +0900 +++ b/tools/clang/lib/CodeGen/CGCall.cpp Thu Aug 04 19:27:15 2016 +0900 @@ -3459,7 +3459,10 @@ assert(IRFunctionArgs.hasInallocaArg()); IRCallArgs[IRFunctionArgs.getInallocaArgNo()] = Arg; } - +#ifndef noCbC + if (CGF.FnRetTy.getTypePtr()->is__CodeType()) // + Fn->Emit(CGF, flags); +#endif if (!CallArgs.getCleanupsToDeactivate().empty()) deactivateArgCleanupsBeforeCall(*this, CallArgs); diff -r b8d969d74b93 -r a6d007e4e7a3 tools/clang/lib/CodeGen/CGCleanup.cpp --- a/tools/clang/lib/CodeGen/CGCleanup.cpp Mon Jun 27 19:21:24 2016 +0900 +++ b/tools/clang/lib/CodeGen/CGCleanup.cpp Thu Aug 04 19:27:15 2016 +0900 @@ -511,7 +511,10 @@ } // Ask the cleanup to emit itself. - Fn->Emit(CGF, flags); +#ifndef noCbC + if (!CGF.FnRetTy.getTypePtr()->is__CodeType()) // in __code cleanup is done just before tail call (goto) +#endif + Fn->Emit(CGF, flags); assert(CGF.HaveInsertPoint() && "cleanup ended with no insertion point?"); // Emit the continuation block if there was an active flag.