This is an archive of the discontinued LLVM Phabricator instance.

[libFuzzer] [NFC] Make compiler command generation more readable.
ClosedPublic

Authored by george.karpenkov on May 23 2018, 3:36 PM.

Diff Detail

Event Timeline

morehouse added inline comments.May 23 2018, 6:13 PM
test/fuzzer/lit.cfg
53

How is config.clang more general than config.c_compiler? What if the host doesn't have clang installed?

65

I think the original name makes more sense here. This is a list of the arguments to -fsanitize, not the full cmd.

test/fuzzer/lit.cfg
53

What if the host doesn't have clang installed?

Well then they don't get to run the LIT tests, which are tightly coupled with trunk version of Clang.
config.clang option adds a bunch of flags to config.c_compiler which might be required for a given build.

65

I guess it could be changed. The logic here was to have all names which go into the final compilation command be postfixed with _cmd

morehouse added inline comments.May 23 2018, 7:14 PM
test/fuzzer/lit.cfg
65

Sure, I think the final variable should be called sanitizers_cmd, but it does seem a bit confusing to change the type of sanitizers_cmd from a list to a string here.

vitalybuka added inline comments.May 24 2018, 3:56 PM
test/fuzzer/lit.cfg
59

same about

link_cmd = '-lc++' if any(x in config.target_triple for x in ('darwin', 'freebsd')) else '-lstdc++'
71

such renaming and reformatting should be in separate patches

also I like current oneliner: isysroot_cmd = config.osx_sysroot_flag if config.osx_sysroot_flag else ''

test/fuzzer/lit.cfg
71

It stops being one-liner in a subsequent revision.

george.karpenkov marked an inline comment as done.
george.karpenkov added inline comments.
test/fuzzer/lit.cfg
59

that's more complex though, it has nested if-s, and the current version explicitly enumerates four conditions

vitalybuka accepted this revision.May 25 2018, 1:11 PM
This revision is now accepted and ready to land.May 25 2018, 1:11 PM
morehouse accepted this revision.Jun 4 2018, 11:17 AM
This revision was automatically updated to reflect the committed changes.
Herald added subscribers: Restricted Project, llvm-commits. · View Herald TranscriptJun 12 2018, 2:18 PM