llvm-dwarutil.cpp unnecessarily call to InitializeAllAsmParsers.
That call might be removed as well as dependency on ${LLVM_TARGETS_TO_BUILD}
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Unit Tests
Event Timeline
Thanks! I'm not an expert in this area, so the below might be silly questions. Apologies in advance :)
llvm/tools/llvm-dwarfutil/CMakeLists.txt | ||
---|---|---|
6 | Given that you call InitializeAllTargets(), shouldn't you keep this one and instead remove the 3 AllTargetsFoo at the bottom instead? (InitializeAllTargets calls LLVMInitialize.*Target\b and that's in llvm/lib/Target/Foo/FooTargetMachine.cpp) | |
llvm/tools/llvm-dwarfutil/llvm-dwarfutil.cpp | ||
484 | It's not obvious to me why this call is redundant, can you elaborate? |
llvm/tools/llvm-dwarfutil/CMakeLists.txt | ||
---|---|---|
6 | ${LLVM_TARGETS_TO_BUILD} includes wider set of dependencies. If 3 AllTargetsFoo would be removed and ${LLVM_TARGETS_TO_BUILD} will be left then dependency on AllTargetsDisassemblers and others would be added. | |
llvm/tools/llvm-dwarfutil/llvm-dwarfutil.cpp | ||
484 | AsmParser functionality is not used by this tool. Thus we do not need to initialize them. |
I meant "redundantly calls" -> "unnecessarily calls".
In the title it should be "Remove unnecessary dependency", without "-ly" :)
Given that you call InitializeAllTargets(), shouldn't you keep this one and instead remove the 3 AllTargetsFoo at the bottom instead?
(InitializeAllTargets calls LLVMInitialize.*Target\b and that's in llvm/lib/Target/Foo/FooTargetMachine.cpp)