From 10e905c2e9e470f5f56cc717885c923db348dba4 Mon Sep 17 00:00:00 2001 From: Samuel Antao Date: Thu, 27 Oct 2016 01:08:58 +0000 Subject: [PATCH] Remove check for -o option in offloading actions builder. This check is also present when jobs are built, so the offloading builder check is not needed anymore. llvm-svn: 285264 --- clang/lib/Driver/Driver.cpp | 19 +------------------ clang/test/Driver/cuda-output-asm.cu | 2 ++ 2 files changed, 3 insertions(+), 18 deletions(-) diff --git a/clang/lib/Driver/Driver.cpp b/clang/lib/Driver/Driver.cpp index 4335bbf..8a68684 100644 --- a/clang/lib/Driver/Driver.cpp +++ b/clang/lib/Driver/Driver.cpp @@ -1418,9 +1418,6 @@ class OffloadingActionBuilder final { /// The compilation that is using this builder. Compilation &C; - /// The derived arguments associated with this builder. - DerivedArgList &Args; - /// Map between an input argument and the offload kinds used to process it. std::map InputArgToOffloadKindMap; @@ -1760,7 +1757,7 @@ class OffloadingActionBuilder final { public: OffloadingActionBuilder(Compilation &C, DerivedArgList &Args, const Driver::InputList &Inputs) - : C(C), Args(Args) { + : C(C) { // Create a specialized builder for each device toolchain. IsValid = true; @@ -1876,31 +1873,17 @@ public: /// Add the offloading top level actions to the provided action list. bool appendTopLevelActions(ActionList &AL, Action *HostAction, const Arg *InputArg) { - auto NumActions = AL.size(); - for (auto *SB : SpecializedBuilders) { if (!SB->isValid()) continue; SB->appendTopLevelActions(AL); } - assert(NumActions <= AL.size() && "Expecting more actions, not less!"); - // Propagate to the current host action (if any) the offload information // associated with the current input. if (HostAction) HostAction->propagateHostOffloadInfo(InputArgToOffloadKindMap[InputArg], /*BoundArch=*/nullptr); - - // If any action is added by the builders, -o is ambiguous if we have more - // than one top-level action. - if (NumActions < AL.size() && Args.hasArg(options::OPT_o) && - AL.size() > 1) { - C.getDriver().Diag( - clang::diag::err_drv_output_argument_with_multiple_files); - return true; - } - return false; } diff --git a/clang/test/Driver/cuda-output-asm.cu b/clang/test/Driver/cuda-output-asm.cu index af066ce..8ca87a5 100644 --- a/clang/test/Driver/cuda-output-asm.cu +++ b/clang/test/Driver/cuda-output-asm.cu @@ -29,3 +29,5 @@ // RUN: %clang -### -emit-llvm -c -target x86_64-linux-gnu -o foo.s %s 2>&1 \ // RUN: | FileCheck -check-prefix MULTIPLE-OUTPUT-FILES %s // MULTIPLE-OUTPUT-FILES: error: cannot specify -o when generating multiple output files +// Make sure we do not get duplicate diagnostics. +// MULTIPLE-OUTPUT-FILES-NOT: error: cannot specify -o when generating multiple output files -- 2.7.4