[llvm] [CMake] Move common target dependencies into ${TARGET_LIBRARIES} (PR #141271)

via llvm-commits llvm-commits at lists.llvm.org
Tue May 27 13:12:07 PDT 2025


CBSears wrote:

> > adding a call from an STI reference to an Analysis function would result in a build error coming from one of them, even if you're not working on that particular backend.
> 
> just want to make sure: I guess you mean adding a call to Analysis into a STI function that is used by backends that are not currently linking Analysis, right?

Hi Min,

I added a call to isNoAlias() for something I'm working on which I wanted to be overridable by backends. So I put its implementation in TargetSubtargetInfo.h. However, this caused link errors for AVR, MSP430, Sparc and Xtensa. These are backends I definitely wasn't touching and it took me awhile to figure out exactly what was happening.

All of the other backends already include Analysis in the library list of their CMakelist.txt files except for those 4. For example, RISCV includes Analysis despite not including AliasAnalysis.h in any of its source files. (I haven't checked but I don't think Analysis gets called transitively.)

What I want to do is oversolve the problem so that the next developer doesn't have to solve the build problems I had to. FWIW, I think this qualifies as NFC.

https://github.com/llvm/llvm-project/pull/141271


More information about the llvm-commits mailing list