[clang] [clang][Tooling] Fix assertion failure when processing CUDA files (PR #173762)
Joseph Huber via cfe-commits
cfe-commits at lists.llvm.org
Mon Jan 12 07:25:57 PST 2026
================
@@ -108,13 +108,14 @@ static bool ignoreExtraCC1Commands(const driver::Compilation *Compilation) {
// tooling will consider host-compilation only. For tooling on device
// compilation, device compilation only option, such as
// `--cuda-device-only`, needs specifying.
- assert(Actions.size() > 1);
- assert(
- isa<driver::CompileJobAction>(Actions.front()) ||
- // On MacOSX real actions may end up being wrapped in
- // BindArchAction.
- (isa<driver::BindArchAction>(Actions.front()) &&
- isa<driver::CompileJobAction>(*Actions.front()->input_begin())));
+ if (Actions.size() > 1) {
+ assert(
+ isa<driver::CompileJobAction>(Actions.front()) ||
+ // On MacOSX real actions may end up being wrapped in
+ // BindArchAction.
+ (isa<driver::BindArchAction>(Actions.front()) &&
+ isa<driver::CompileJobAction>(*Actions.front()->input_begin())));
+ }
----------------
jhuber6 wrote:
Is this even valid if we pass more than one architecture? We should have a test for `--offload-arch=sm_70,sm_80`
https://github.com/llvm/llvm-project/pull/173762
More information about the cfe-commits
mailing list