Darwin's toolchain should be initialized before openmp offloading
is processed
This fixes an 'openmp-offload.c' test failure introduced by r310263.
llvm-svn: 310347
diff --git a/clang/lib/Driver/Driver.cpp b/clang/lib/Driver/Driver.cpp
index 030b9c6..04090f5 100644
--- a/clang/lib/Driver/Driver.cpp
+++ b/clang/lib/Driver/Driver.cpp
@@ -3224,6 +3224,12 @@
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: