@@ -3277,18 +3277,22 @@ impl Tool {
32773277 self . removed_args . push ( flag) ;
32783278 }
32793279
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 .
32813281 ///
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.
32853286 fn push_cc_arg ( & mut self , flag : OsString ) {
32863287 if self . cuda {
32873288 self . args . push ( "-Xcompiler" . into ( ) ) ;
32883289 }
32893290 self . args . push ( flag) ;
32903291 }
32913292
3293+ /// Checks if an argument or flag has already been specified or conflicts.
3294+ ///
3295+ /// Currently only checks optimization flags.
32923296 fn is_duplicate_opt_arg ( & self , flag : & OsString ) -> bool {
32933297 let flag = flag. to_str ( ) . unwrap ( ) ;
32943298 let mut chars = flag. chars ( ) ;
@@ -3316,7 +3320,7 @@ impl Tool {
33163320 return false ;
33173321 }
33183322
3319- /// Don't push optimization arg if it conflicts with existing args
3323+ /// Don't push optimization arg if it conflicts with existing args.
33203324 fn push_opt_unless_duplicate ( & mut self , flag : OsString ) {
33213325 if self . is_duplicate_opt_arg ( & flag) {
33223326 println ! ( "Info: Ignoring duplicate arg {:?}" , & flag) ;
0 commit comments