r310282 - Non-functional change. Fix previous patch D34784.

Gheorghe-Teodor Bercea via cfe-commits cfe-commits at lists.llvm.org
Mon Aug 7 11:43:37 PDT 2017


Author: gbercea
Date: Mon Aug  7 11:43:37 2017
New Revision: 310282

URL: http://llvm.org/viewvc/llvm-project?rev=310282&view=rev
Log:
Non-functional change. Fix previous patch D34784.

Modified:
    cfe/trunk/lib/Driver/Compilation.cpp

Modified: cfe/trunk/lib/Driver/Compilation.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Compilation.cpp?rev=310282&r1=310281&r2=310282&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/Compilation.cpp (original)
+++ cfe/trunk/lib/Driver/Compilation.cpp Mon Aug  7 11:43:37 2017
@@ -60,11 +60,15 @@ Compilation::getArgsForToolChain(const T
   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;
   }




More information about the cfe-commits mailing list