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;
}