]> granicus.if.org Git - clang/commitdiff
Remove check for -o option in offloading actions builder.
authorSamuel Antao <sfantao@us.ibm.com>
Thu, 27 Oct 2016 01:08:58 +0000 (01:08 +0000)
committerSamuel Antao <sfantao@us.ibm.com>
Thu, 27 Oct 2016 01:08:58 +0000 (01:08 +0000)
This check is also present when jobs are built, so the offloading builder check is not needed anymore.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@285264 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Driver/Driver.cpp
test/Driver/cuda-output-asm.cu

index 4335bbfd42d23298a4816a74fea25c17353b2e63..8a68684eb005b5436a3641e12d31633f565b6533 100644 (file)
@@ -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<const Arg *, unsigned> 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;
   }
 
index af066ce568ed12a67509290657125d8fbb6c70a3..8ca87a5caa5ca5e31b7d3d7e67f3c0bd765220ec 100644 (file)
@@ -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