From: Gheorghe-Teodor Bercea Date: Mon, 7 Aug 2017 18:43:37 +0000 (+0000) Subject: Non-functional change. Fix previous patch D34784. X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=bcfdd7861e4f390e478751c06d678066049cd061;p=platform%2Fupstream%2Fllvm.git Non-functional change. Fix previous patch D34784. llvm-svn: 310282 --- diff --git a/clang/lib/Driver/Compilation.cpp b/clang/lib/Driver/Compilation.cpp index 6626662..3ddd648 100644 --- a/clang/lib/Driver/Compilation.cpp +++ b/clang/lib/Driver/Compilation.cpp @@ -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; }