BPF: Add LLVMAnalysis in CMakefile LINK_COMPONENTS
authorYonghong Song <yhs@fb.com>
Thu, 11 Feb 2021 18:00:32 +0000 (10:00 -0800)
committerYonghong Song <yhs@fb.com>
Thu, 11 Feb 2021 18:24:22 +0000 (10:24 -0800)
commit74975d35b47631da0c7911561f16d3ffd1af142a
tree243b5b8c21abd502307e776961e6d3b117934dee
parent606aa622b23855784c5db5b48b1c4800467fd851
BPF: Add LLVMAnalysis in CMakefile LINK_COMPONENTS

buildbot reported a build error like below:
  BPFTargetMachine.cpp:(.text._ZN4llvm19TargetTransformInfo5ModelINS_10BPFTTIImplEED2Ev
    [_ZN4llvm19TargetTransformInfo5ModelINS_10BPFTTIImplEED2Ev]+0x14):
    undefined reference to `llvm::TargetTransformInfo::Concept::~Concept()'
  lib/Target/BPF/CMakeFiles/LLVMBPFCodeGen.dir/BPFTargetMachine.cpp.o:
    In function `llvm::TargetTransformInfo::Model<llvm::BPFTTIImpl>::~Model()':

Commit a260ae716030 ("BPF: Implement TTI.IntImmCost() properly")
added TargetTransformInfo to BPF, which requires LLVMAnalysis
dependence. In certain cmake configurations, lacking explicit
LLVMAnalysis dependency may cause compilation error.
Similar to other targets, this patch added LLVMAnalysis
in CMakefile LINK_COMPONENTS explicitly.
llvm/lib/Target/BPF/CMakeLists.txt