Summary: Error handling in liblldCore and the Darwin toolchain prints to an output stream. A TODO in the project explained that a diagnostics interface resembling Clang's should be added. For now, the simple diagnostics interface defined in liblldCommon seems like an improvement. It prints colors when they're available, uses locks for thread-safety, and abstracts away the `"error: "` and newline literal strings that litter the Darwin toolchain code. To use the liblldCommon error handler, a link dependency is added to the liblldDriver library. Test Plan: 1. check-lld 2. Invoke `ld64.lld -r` in a terminal that supports color output. Confirm that "ld64.lld: error: -arch not specified and could not be inferred" is output, and that the "error:" is colored red! Reviewers: ruiu, smeenai Reviewed By: ruiu Subscribers: mgorny, llvm-commits Differential Revision: https://reviews.llvm.org/D47998 llvm-svn: 334466
24 lines
441 B
CMake
24 lines
441 B
CMake
set(LLVM_TARGET_DEFINITIONS DarwinLdOptions.td)
|
|
tablegen(LLVM DarwinLdOptions.inc -gen-opt-parser-defs)
|
|
add_public_tablegen_target(DriverOptionsTableGen)
|
|
|
|
add_lld_library(lldDriver
|
|
DarwinLdDriver.cpp
|
|
|
|
ADDITIONAL_HEADER_DIRS
|
|
${LLD_INCLUDE_DIR}/lld/Driver
|
|
|
|
LINK_COMPONENTS
|
|
Option
|
|
Support
|
|
|
|
LINK_LIBS
|
|
lldCommon
|
|
lldCore
|
|
lldMachO
|
|
lldReaderWriter
|
|
lldYAML
|
|
)
|
|
|
|
add_dependencies(lldDriver DriverOptionsTableGen)
|