From: Alex Lorenz Date: Tue, 8 Aug 2017 11:22:21 +0000 (+0000) Subject: Darwin's toolchain should be initialized before openmp offloading X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1775aeb0557c7fb6dd6598fd9793d3433f9f69e0;p=clang Darwin's toolchain should be initialized before openmp offloading is processed This fixes an 'openmp-offload.c' test failure introduced by r310263. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@310347 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Driver/Driver.cpp b/lib/Driver/Driver.cpp index 030b9c6cd3..04090f567f 100644 --- a/lib/Driver/Driver.cpp +++ b/lib/Driver/Driver.cpp @@ -3224,6 +3224,12 @@ InputInfo Driver::BuildJobsForActionNoCache( InputInfoList OffloadDependencesInputInfo; bool BuildingForOffloadDevice = TargetDeviceOffloadKind != Action::OFK_None; if (const OffloadAction *OA = dyn_cast(A)) { + // The 'Darwin' toolchain is initialized only when its arguments are + // computed. Get the default arguments for OFK_None to ensure that + // initialization is performed before processing the offload action. + // FIXME: Remove when darwin's toolchain is initialized during construction. + C.getArgsForToolChain(TC, BoundArch, Action::OFK_None); + // The offload action is expected to be used in four different situations. // // a) Set a toolchain/architecture/kind for a host action: