[clang] also skip blacklisted flags when passed as -flag=arg

Summary: There's currently no way to skip these when they are passed to clang.

Reviewed By: martintrojer

Differential Revision: D15669132

fbshipit-source-id: be97d2638
master
Jules Villard 6 years ago committed by Facebook Github Bot
parent 16431f5015
commit d00b31f48c

@ -122,7 +122,10 @@ let filter_and_replace_unsupported_args ?(replace_options_arg = fun _ s -> s) ?(
L.external_warning "Error reading argument file '%s': %s@\n" at_argfile L.external_warning "Error reading argument file '%s': %s@\n" at_argfile
(Exn.to_string e) ; (Exn.to_string e) ;
aux in_argfiles' (false, at_argfile :: res_rev, changed) tl ) aux in_argfiles' (false, at_argfile :: res_rev, changed) tl )
| flag :: tl when List.mem ~equal:String.equal Config.clang_blacklisted_flags flag -> | flag :: tl
when List.mem ~equal:String.equal Config.clang_blacklisted_flags flag
|| List.mem ~equal:String.equal Config.clang_blacklisted_flags_with_arg
(String.split ~on:'=' flag |> List.hd |> Option.value ~default:"") ->
aux in_argfiles (false, res_rev, true) tl aux in_argfiles (false, res_rev, true) tl
| flag :: tl when List.mem ~equal:String.equal Config.clang_blacklisted_flags_with_arg flag -> | flag :: tl when List.mem ~equal:String.equal Config.clang_blacklisted_flags_with_arg flag ->
(* remove the flag and its arg separately in case we are at the end of an argfile *) (* remove the flag and its arg separately in case we are at the end of an argfile *)

Loading…
Cancel
Save