mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-25 04:02:41 +01:00
eff7a5bc7b
This patch reimplements command line option parsing in dsymutil with Tablegen and libOption. The main motivation for this change is to prevent clashes with other cl::opt options defined in llvm. Although it's a bit more heavyweight, it has some nice advantages such as no global static initializers and better separation between the code and the option definitions. I also used this opportunity to improve how dsymutil deals with incompatible options. Instead of having checks spread across the code, everything is now grouped together in verifyOptions. The fact that the options are no longer global means that we need to pass them around a bit more, but I think it's worth the trade-off. Differential revision: https://reviews.llvm.org/D68361 llvm-svn: 373622
41 lines
713 B
CMake
41 lines
713 B
CMake
set(LLVM_TARGET_DEFINITIONS Options.td)
|
|
tablegen(LLVM Options.inc -gen-opt-parser-defs)
|
|
add_public_tablegen_target(DsymutilTableGen)
|
|
|
|
set(LLVM_LINK_COMPONENTS
|
|
AllTargetsAsmPrinters
|
|
AllTargetsCodeGens
|
|
AllTargetsDescs
|
|
AllTargetsInfos
|
|
AsmPrinter
|
|
DebugInfoDWARF
|
|
MC
|
|
Object
|
|
Option
|
|
Support
|
|
Target
|
|
)
|
|
|
|
add_llvm_tool(dsymutil
|
|
dsymutil.cpp
|
|
BinaryHolder.cpp
|
|
CFBundle.cpp
|
|
CompileUnit.cpp
|
|
DebugMap.cpp
|
|
DeclContext.cpp
|
|
DwarfLinker.cpp
|
|
DwarfStreamer.cpp
|
|
MachODebugMapParser.cpp
|
|
MachOUtils.cpp
|
|
NonRelocatableStringpool.cpp
|
|
SymbolMap.cpp
|
|
|
|
DEPENDS
|
|
intrinsics_gen
|
|
${tablegen_deps}
|
|
)
|
|
|
|
if(APPLE)
|
|
target_link_libraries(dsymutil PRIVATE "-framework CoreFoundation")
|
|
endif(APPLE)
|