This is an archive of the discontinued LLVM Phabricator instance.

[CUDA] Don't initialize the CUDA toolchain if we don't have any CUDA inputs.
ClosedPublic

Authored by jlebar on Mar 30 2016, 4:11 PM.

Details

Summary

This prevents errors when you invoke clang with a flag that the NVPTX
toolchain doesn't support. For example, on x86-64,

clang -mthread-model single -x c++ /dev/null -o /dev/null

should output just one error about "invalid thread model 'single' in
'-mthread-model single' for this target"; x86-64 doesn't support
-mthread-model, but we shouldn't also instantiate a NVPTX target!

Diff Detail

Repository
rL LLVM

Event Timeline

jlebar updated this revision to Diff 52146.Mar 30 2016, 4:11 PM
jlebar retitled this revision from to [CUDA] Don't initialize the CUDA toolchain if we don't have any CUDA inputs..
jlebar updated this object.
jlebar added a reviewer: tra.
jlebar added subscribers: cfe-commits, sunfish, echristo.
echristo accepted this revision.Mar 30 2016, 4:22 PM
echristo added a reviewer: echristo.

Not sure if that's clang-formatted, but please do so if not :)

-eric

This revision is now accepted and ready to land.Mar 30 2016, 4:22 PM

Discussed offline, this is clang-formatted. Thank you for the review, Eric!

This revision was automatically updated to reflect the committed changes.