From: Alexey Bataev Date: Fri, 4 Aug 2017 21:26:25 +0000 (+0000) Subject: Revert "[OPENMP] Fix for pacify buildbots, NFC." X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3ae5f4e75b0c6ac368f53097ff2c6643870b3c33;p=clang Revert "[OPENMP] Fix for pacify buildbots, NFC." This reverts commit r310120. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@310134 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/CGStmtOpenMP.cpp b/lib/CodeGen/CGStmtOpenMP.cpp index 54d381798c..e7e5976e60 100644 --- a/lib/CodeGen/CGStmtOpenMP.cpp +++ b/lib/CodeGen/CGStmtOpenMP.cpp @@ -320,7 +320,10 @@ static std::pair emitOutlinedFunctionPrologue( ArgType, ImplicitParamDecl::Other); Args.emplace_back(Arg); // Do not cast arguments if we emit function with non-original types. - TargetArgs.emplace_back(CGM.getOpenMPRuntime().translateParameter(FD, Arg)); + TargetArgs.emplace_back( + FO.UIntPtrCastRequired + ? Arg + : CGM.getOpenMPRuntime().translateParameter(FD, Arg)); ++I; } Args.append( @@ -444,11 +447,15 @@ CodeGenFunction::GenerateOpenMPCapturedStmtFunction(const CapturedStmt &S) { FunctionArgList Args; llvm::DenseMap> LocalAddrs; llvm::DenseMap> VLASizes; - FunctionOptions FO(&S, !NeedWrapperFunction, /*RegisterCastedArgsOnly=*/false, - CapturedStmtInfo->getHelperName(), - [](CodeGenFunction &CGF, const VarDecl *VD, Address Addr) { - CGF.setAddrOfLocalVar(VD, Addr); - }); + FunctionOptions FO( + &S, !NeedWrapperFunction, /*RegisterCastedArgsOnly=*/false, + CapturedStmtInfo->getHelperName(), + [NeedWrapperFunction](CodeGenFunction &CGF, const VarDecl *VD, + Address Addr) { + assert(NeedWrapperFunction && "Function should not be called if " + "wrapper function is not required."); + CGF.setAddrOfLocalVar(VD, Addr); + }); llvm::Function *F; bool HasUIntPtrArgs; std::tie(F, HasUIntPtrArgs) = emitOutlinedFunctionPrologue( @@ -470,12 +477,11 @@ CodeGenFunction::GenerateOpenMPCapturedStmtFunction(const CapturedStmt &S) { SmallString<256> Buffer; llvm::raw_svector_ostream Out(Buffer); Out << "__nondebug_wrapper_" << CapturedStmtInfo->getHelperName(); - FunctionOptions WrapperFO( - &S, /*UIntPtrCastRequired=*/true, - /*RegisterCastedArgsOnly=*/true, Out.str(), - [](CodeGenFunction &CGF, const VarDecl *VD, Address Addr) { - CGF.setAddrOfLocalVar(VD, Addr); - }); + FunctionOptions WrapperFO(&S, /*UIntPtrCastRequired=*/true, + /*RegisterCastedArgsOnly=*/true, Out.str(), + [](CodeGenFunction &, const VarDecl *, Address) { + llvm_unreachable("Function should not be called"); + }); CodeGenFunction WrapperCGF(CGM, /*suppressNewContext=*/true); WrapperCGF.disableDebugInfo(); Args.clear();