]> granicus.if.org Git - clang/commitdiff
Non-functional change. Fix previous patch D34784.
authorGheorghe-Teodor Bercea <gheorghe-teod.bercea@ibm.com>
Mon, 7 Aug 2017 18:43:37 +0000 (18:43 +0000)
committerGheorghe-Teodor Bercea <gheorghe-teod.bercea@ibm.com>
Mon, 7 Aug 2017 18:43:37 +0000 (18:43 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@310282 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Driver/Compilation.cpp

index 6626662b9e452a96fae66a706391c6345c578fcf..3ddd648fa12b80a1da8bcf1c588da14808d50c75 100644 (file)
@@ -60,11 +60,15 @@ Compilation::getArgsForToolChain(const ToolChain *TC, StringRef BoundArch,
   DerivedArgList *&Entry = TCArgs[{TC, BoundArch, DeviceOffloadKind}];
   if (!Entry) {
     // Translate OpenMP toolchain arguments provided via the -Xopenmp-target flags.
-    Entry = TC->TranslateOpenMPTargetArgs(*TranslatedArgs, DeviceOffloadKind);
-    if (!Entry)
-      Entry = TranslatedArgs;
+    DerivedArgList *OpenMPArgs = TC->TranslateOpenMPTargetArgs(*TranslatedArgs,
+        DeviceOffloadKind);
+    if (!OpenMPArgs) {
+      Entry = TC->TranslateArgs(*TranslatedArgs, BoundArch, DeviceOffloadKind);
+    } else {
+      Entry = TC->TranslateArgs(*OpenMPArgs, BoundArch, DeviceOffloadKind);
+      delete OpenMPArgs;
+    }
 
-    Entry = TC->TranslateArgs(*Entry, BoundArch, DeviceOffloadKind);
     if (!Entry)
       Entry = TranslatedArgs;
   }