This is an archive of the discontinued LLVM Phabricator instance.

[libFuzzer] Separate platform related macros out from FuzzerDefs.h into FuzzerPlatform.h, and adjust includes in other files.
ClosedPublic

Authored by dokyungs on Jul 14 2020, 12:31 PM.

Details

Summary

This patch separates platform related macros in lib/fuzzer/FuzzerDefs.h into lib/fuzzer/FuzzerPlatform.h, and use FuzzerPlatform.h where necessary. This separation helps when compiling libFuzzer's interceptor module (under review); an unnecessary include of standard headers (such as string.h) may produce conflicts/ambiguation with the interceptor's declarations/definitions of library functions, which complicates interceptor implementation.

Diff Detail

Event Timeline

dokyungs created this revision.Jul 14 2020, 12:31 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 14 2020, 12:31 PM
Herald added subscribers: Restricted Project, krytarowski. · View Herald Transcript
morehouse accepted this revision.Jul 14 2020, 12:50 PM
morehouse added inline comments.
compiler-rt/lib/fuzzer/FuzzerExtraCounters.cpp
13

Nit: The convention in libfuzzer seems to be local includes first, then standard headers.

compiler-rt/lib/fuzzer/FuzzerValueBitMap.h
16

Nit: Please reverse order.

This revision is now accepted and ready to land.Jul 14 2020, 12:50 PM
dokyungs updated this revision to Diff 277959.Jul 14 2020, 1:21 PM

Addressed comments.

dokyungs marked 2 inline comments as done.Jul 14 2020, 1:22 PM
morehouse accepted this revision.Jul 14 2020, 1:43 PM
This revision was automatically updated to reflect the committed changes.