@@ -3277,18 +3277,22 @@ impl Tool {
3277
3277
self . removed_args . push ( flag) ;
3278
3278
}
3279
3279
3280
- /// Add a flag, and optionally prepend the NVCC wrapper flag "-Xcompiler" .
3280
+ /// Push a flag to the end of the compiler's arguments list .
3281
3281
///
3282
- /// Currently this is only used for compiling CUDA sources, since NVCC only
3283
- /// accepts a limited set of GNU-like flags, and the rest must be prefixed
3284
- /// with a "-Xcompiler" flag to get passed to the underlying C++ compiler.
3282
+ /// Currently `-Xcompiler` is inserted before the passed flag when compiling
3283
+ /// CUDA sources since NVCC only accepts a limited set of GNU-like flags,
3284
+ /// while the rest must be prefixed with the `-Xcompiler` flag to get passed
3285
+ /// to the underlying C++ compiler.
3285
3286
fn push_cc_arg ( & mut self , flag : OsString ) {
3286
3287
if self . cuda {
3287
3288
self . args . push ( "-Xcompiler" . into ( ) ) ;
3288
3289
}
3289
3290
self . args . push ( flag) ;
3290
3291
}
3291
3292
3293
+ /// Checks if an argument or flag has already been specified or conflicts.
3294
+ ///
3295
+ /// Currently only checks optimization flags.
3292
3296
fn is_duplicate_opt_arg ( & self , flag : & OsString ) -> bool {
3293
3297
let flag = flag. to_str ( ) . unwrap ( ) ;
3294
3298
let mut chars = flag. chars ( ) ;
@@ -3316,7 +3320,7 @@ impl Tool {
3316
3320
return false ;
3317
3321
}
3318
3322
3319
- /// Don't push optimization arg if it conflicts with existing args
3323
+ /// Don't push optimization arg if it conflicts with existing args.
3320
3324
fn push_opt_unless_duplicate ( & mut self , flag : OsString ) {
3321
3325
if self . is_duplicate_opt_arg ( & flag) {
3322
3326
println ! ( "Info: Ignoring duplicate arg {:?}" , & flag) ;
0 commit comments