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

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 18 04:51:38 PDT 2020


spatel added a comment.

In D86113#2222729 <https://reviews.llvm.org/D86113#2222729>, @craig.topper wrote:

> 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 &".

Thanks. If there's some way to enforce that constraint, let me know. Otherwise, this is ok as-is?


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

https://reviews.llvm.org/D86113



More information about the llvm-commits mailing list