[PATCH] D86113: [ValueTracking] define/use max recursion depth in header

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 17 15:37:19 PDT 2020


craig.topper added a comment.

In D86113#2222710 <https://reviews.llvm.org/D86113#2222710>, @spatel wrote:

> In D86113#2222675 <https://reviews.llvm.org/D86113#2222675>, @lebedev.ri wrote:
>
>> Even though it is `constexpr`, you most likely want to also define it in `ValueTracking.cpp` TU,
>> i remember having pretty fun linking issues with cases like this.
>
> Ok - I was afraid of something like that. Is there an example of the recommended way to spell this already in LLVM somewhere?
> I saw that UndefMaskElem was done similarly to this (only in a header file), so that's why I figured it was worth a try.

You're probably ok. The linker error is likely only to happen if you do something that takes the address of the global. Like passing it to a function that takes a "unsigned &".


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D86113/new/

https://reviews.llvm.org/D86113



More information about the llvm-commits mailing list