This is an archive of the discontinued LLVM Phabricator instance.

[CUDA] Add -fcuda-allow-variadic-functions.
ClosedPublic

Authored by jlebar on Jan 25 2016, 2:19 PM.

Details

Summary

Turns out the variadic function checking added in r258643 was too strict
for some existing users; give them an escape valve. When
-fcuda-allow-variadic-functions is passed, the front-end makes no
attempt to disallow C-style variadic functions. Calls to va_arg are
still not allowed.

Diff Detail

Repository
rL LLVM

Event Timeline

jlebar updated this revision to Diff 45915.Jan 25 2016, 2:19 PM
jlebar retitled this revision from to [CUDA] Add -fcuda-allow-variadic-functions..
jlebar updated this object.
jlebar added a reviewer: tra.
jlebar added subscribers: bkramer, echristo, jhen, cfe-commits.
bkramer accepted this revision.Jan 26 2016, 9:25 AM
bkramer added a reviewer: bkramer.

Looks good to me, but I don't really now CUDA.

This revision is now accepted and ready to land.Jan 26 2016, 9:25 AM
tra accepted this revision.Jan 26 2016, 9:43 AM
tra edited edge metadata.

LGTM.

This revision was automatically updated to reflect the committed changes.
mcrosier added inline comments.
cfe/trunk/include/clang/Driver/CC1Options.td
681

AFAICT, these are customer facing flags, correct? If so, shouldn't these options be hidden from the help (via the HelpHidden flag AFAICT)?

mcrosier added inline comments.Jan 26 2016, 11:01 AM
cfe/trunk/include/clang/Driver/CC1Options.td
681

This might cause issues such as those reported in PR26317 and PR26318.

tra added inline comments.Jan 26 2016, 11:06 AM
cfe/trunk/include/clang/Driver/CC1Options.td
681

These are cc1-only options and do *not* show up in top-level --help.

mcrosier added inline comments.Jan 26 2016, 11:24 AM
cfe/trunk/include/clang/Driver/CC1Options.td
681

Ah, yes. You are correct.

garymm added a subscriber: garymm.Jun 9 2023, 2:24 PM

Could you please add this to the documentation?
Could this be made the default? It seems like nvcc does this by default.

Herald added a project: Restricted Project. · View Herald TranscriptJun 9 2023, 2:24 PM
tra added a comment.Jun 9 2023, 2:28 PM

Could you please add this to the documentation?
Could this be made the default? It seems like nvcc does this by default.

Clang already does that, though we only allow variadic functions that don't actually use the vararg arguments: https://reviews.llvm.org/D151359
It's sufficient to compile recent CUDA/libcu++ headers w/o errors.