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