Skip to content

Commit 819fda0

Browse files
authored
Revert two clang patches (llvm#3221)
2 parents fbb7f2c + a40b116 commit 819fda0

20 files changed

+548
-375
lines changed

clang/include/clang/Basic/DiagnosticDriverKinds.td

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,6 @@ def err_drv_cuda_host_arch : Error<
119119
"unsupported architecture '%0' for host compilation">;
120120
def err_drv_mix_cuda_hip : Error<
121121
"mixed CUDA and HIP compilation is not supported">;
122-
def err_drv_mix_offload : Error<
123-
"mixed %0 and %1 offloading compilation is not supported">;
124122
def err_drv_bad_target_id : Error<
125123
"invalid target ID '%0'; format is a processor name followed by an optional "
126124
"colon-delimited list of features followed by an enable/disable sign (e.g., "

clang/include/clang/Driver/Driver.h

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -358,9 +358,6 @@ class Driver {
358358
phases::ID getFinalPhase(const llvm::opt::DerivedArgList &DAL,
359359
llvm::opt::Arg **FinalPhaseArg = nullptr) const;
360360

361-
llvm::Expected<std::unique_ptr<llvm::MemoryBuffer>>
362-
executeProgram(llvm::ArrayRef<llvm::StringRef> Args) const;
363-
364361
private:
365362
/// Certain options suppress the 'no input files' warning.
366363
LLVM_PREFERRED_TYPE(bool)
@@ -376,6 +373,10 @@ class Driver {
376373
/// Number of parallel jobs.
377374
unsigned NumParallelJobs;
378375

376+
/// The associated offloading architectures with each toolchain.
377+
llvm::DenseMap<const ToolChain *, llvm::SmallVector<llvm::StringRef>>
378+
OffloadArchs;
379+
379380
private:
380381
/// TranslateInputArgs - Create a new derived argument list from the input
381382
/// arguments, after applying the standard argument translations.
@@ -547,7 +548,8 @@ class Driver {
547548
/// empty string.
548549
llvm::SmallVector<StringRef>
549550
getOffloadArchs(Compilation &C, const llvm::opt::DerivedArgList &Args,
550-
Action::OffloadKind Kind, const ToolChain &TC) const;
551+
Action::OffloadKind Kind, const ToolChain *TC,
552+
bool SpecificToolchain = true) const;
551553

552554
/// Check that the file referenced by Value exists. If it doesn't,
553555
/// issue a diagnostic and return false.

clang/include/clang/Driver/Options.td

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1161,7 +1161,7 @@ def offload_arch_EQ : CommaJoined<["--"], "offload-arch=">,
11611161
"If 'native' is used the compiler will detect locally installed architectures. "
11621162
"For HIP offloading, the device architecture can be followed by target ID features "
11631163
"delimited by a colon (e.g. gfx908:xnack+:sramecc-). May be specified more than once.">;
1164-
def no_offload_arch_EQ : CommaJoined<["--"], "no-offload-arch=">,
1164+
def no_offload_arch_EQ : Joined<["--"], "no-offload-arch=">,
11651165
Visibility<[ClangOption, FlangOption]>,
11661166
HelpText<"Remove CUDA/HIP offloading device architecture (e.g. sm_35, gfx906) from the list of devices to compile for. "
11671167
"'all' resets the list to its default value.">;
@@ -1633,7 +1633,7 @@ defm auto_import : BoolFOption<"auto-import",
16331633
// In the future this option will be supported by other offloading
16341634
// languages and accept other values such as CPU/GPU architectures,
16351635
// offload kinds and target aliases.
1636-
def offload_EQ : CommaJoined<["--"], "offload=">, Flags<[NoXarchOption]>, Alias<offload_targets_EQ>,
1636+
def offload_EQ : CommaJoined<["--"], "offload=">, Flags<[NoXarchOption]>,
16371637
HelpText<"Specify comma-separated list of offloading target triples (CUDA and HIP only)">;
16381638

16391639
// C++ Coroutines

clang/include/clang/Driver/ToolChain.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,10 @@ class ToolChain {
205205
ToolChain(const Driver &D, const llvm::Triple &T,
206206
const llvm::opt::ArgList &Args);
207207

208+
/// Executes the given \p Executable and returns the stdout.
209+
llvm::Expected<std::unique_ptr<llvm::MemoryBuffer>>
210+
executeToolChainProgram(StringRef Executable) const;
211+
208212
void setTripleEnvironment(llvm::Triple::EnvironmentType Env);
209213

210214
virtual Tool *buildAssembler() const;

0 commit comments

Comments
 (0)