Skip to content

Commit 1c5e85b

Browse files
committed
[FuzzMutate] Split out FuzzerCLI library that doesn't depend on IR.
All llvm-project fuzzers use this library to parse command-line arguments. Many of them don't deal with LLVM IR or modules in any way. Bundling those functions in one library forces build dependencies that don't need to be there. Among other things, this means check-clang-pseudo no longer depends on most of LLVM. Differential Revision: https://reviews.llvm.org/D125081
1 parent 0a83ff8 commit 1c5e85b

File tree

13 files changed

+27
-11
lines changed

13 files changed

+27
-11
lines changed

clang-tools-extra/clangd/fuzzer/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
set(LLVM_LINK_COMPONENTS
2-
FuzzMutate
2+
FuzzerCLI
33
Support
44
)
55

clang-tools-extra/pseudo/fuzzer/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
set(LLVM_LINK_COMPONENTS
2-
FuzzMutate
2+
FuzzerCLI
33
Support
44
)
55

clang/tools/clang-fuzzer/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
set(LLVM_LINK_COMPONENTS ${LLVM_TARGETS_TO_BUILD} FuzzMutate)
1+
set(LLVM_LINK_COMPONENTS ${LLVM_TARGETS_TO_BUILD} FuzzerCLI)
22
set(CXX_FLAGS_NOFUZZ ${CMAKE_CXX_FLAGS})
33
set(DUMMY_MAIN DummyClangFuzzer.cpp)
44
if(LLVM_LIB_FUZZING_ENGINE)

llvm/lib/FuzzMutate/CMakeLists.txt

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,23 @@
1-
add_llvm_component_library(LLVMFuzzMutate
1+
# Generic helper for fuzzer binaries.
2+
# This should not depend on LLVM IR etc.
3+
add_llvm_component_library(LLVMFuzzerCLI
24
FuzzerCLI.cpp
5+
PARTIAL_SOURCES_INTENDED
6+
7+
ADDITIONAL_HEADER_DIRS
8+
${LLVM_MAIN_INCLUDE_DIR}/llvm/FuzzMutate
9+
10+
LINK_COMPONENTS
11+
Support
12+
)
13+
14+
# Library for using LLVM IR together with fuzzers.
15+
add_llvm_component_library(LLVMFuzzMutate
316
IRMutator.cpp
417
OpDescriptor.cpp
518
Operations.cpp
619
RandomIRBuilder.cpp
20+
PARTIAL_SOURCES_INTENDED
721

822
ADDITIONAL_HEADER_DIRS
923
${LLVM_MAIN_INCLUDE_DIR}/llvm/FuzzMutate

llvm/tools/llvm-dlang-demangle-fuzzer/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
set(LLVM_LINK_COMPONENTS
22
Demangle
3-
FuzzMutate
3+
FuzzerCLI
44
Support
55
)
66

llvm/tools/llvm-isel-fuzzer/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ set(LLVM_LINK_COMPONENTS
99
BitWriter
1010
CodeGen
1111
Core
12+
FuzzerCLI
1213
FuzzMutate
1314
IRReader
1415
MC

llvm/tools/llvm-itanium-demangle-fuzzer/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
set(LLVM_LINK_COMPONENTS
22
Demangle
3-
FuzzMutate
3+
FuzzerCLI
44
Support
55
)
66

llvm/tools/llvm-microsoft-demangle-fuzzer/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
set(LLVM_LINK_COMPONENTS
22
Demangle
3-
FuzzMutate
3+
FuzzerCLI
44
Support
55
)
66

llvm/tools/llvm-opt-fuzzer/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ set(LLVM_LINK_COMPONENTS
1414
AggressiveInstCombine
1515
InstCombine
1616
Instrumentation
17+
FuzzerCLI
1718
FuzzMutate
1819
MC
1920
ObjCARCOpts

llvm/tools/llvm-rust-demangle-fuzzer/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
set(LLVM_LINK_COMPONENTS
22
Demangle
3-
FuzzMutate
3+
FuzzerCLI
44
Support
55
)
66

llvm/tools/llvm-special-case-list-fuzzer/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
set(LLVM_LINK_COMPONENTS
22
Support
3-
FuzzMutate
3+
FuzzerCLI
44
)
55

66
add_llvm_fuzzer(llvm-special-case-list-fuzzer

llvm/tools/llvm-yaml-numeric-parser-fuzzer/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
set(LLVM_LINK_COMPONENTS
22
Support
3-
FuzzMutate
3+
FuzzerCLI
44
)
55

66
add_llvm_fuzzer(llvm-yaml-numeric-parser-fuzzer

mlir/tools/mlir-parser-fuzzer/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
set(LLVM_LINK_COMPONENTS
2-
FuzzMutate
2+
FuzzerCLI
33
Support
44
)
55
add_llvm_fuzzer(mlir-parser-fuzzer

0 commit comments

Comments
 (0)