Darwin's toolchain should be initialized before openmp offloading
authorAlex Lorenz <arphaman@gmail.com>
Tue, 8 Aug 2017 11:22:21 +0000 (11:22 +0000)
committerAlex Lorenz <arphaman@gmail.com>
Tue, 8 Aug 2017 11:22:21 +0000 (11:22 +0000)
is processed

This fixes an 'openmp-offload.c' test failure introduced by r310263.

llvm-svn: 310347

clang/lib/Driver/Driver.cpp

index 030b9c6..04090f5 100644 (file)
@@ -3224,6 +3224,12 @@ InputInfo Driver::BuildJobsForActionNoCache(
   InputInfoList OffloadDependencesInputInfo;
   bool BuildingForOffloadDevice = TargetDeviceOffloadKind != Action::OFK_None;
   if (const OffloadAction *OA = dyn_cast<OffloadAction>(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: