[llvm-dev] [RFC] Create llvm/Support/InternalLimits.h

Johannes Doerfert via llvm-dev llvm-dev at lists.llvm.org
Fri Mar 5 09:04:50 PST 2021


On 3/5/21 10:04 AM, Roman Lebedev wrote:
> I think this is a good solution.
>
> On Fri, Mar 5, 2021 at 6:44 PM Johannes Doerfert via llvm-dev
> <llvm-dev at lists.llvm.org> wrote:
>> Sounds good to me.
>> Depending on the "limits" we might want to put it in
>> llvm/IR/ though.
> ... which will put us back into square 1, because this comes up
> precisely because we can't include IR headers in clang sema.

I didn't realize we can't include those headers if they are self contained.

I would prefer llvm/Frontend/InternalLimits.h over Support but both seem OK.

~ Johannes


>> Eventually we might want to have multiple (and all included form
>> Frontend/InternalLimits.h) but let's see.
>>
>> ~ Johannes
> Roman
>
>> On 3/5/21 8:05 AM, David Zarzycki via llvm-dev wrote:
>>> Hello,
>>>
>>> There are internal limits within LLVM that are fundamental to how LLVM operates but are defined in awkward places when it comes to library layering. I'd like to propose that we fix that with a simple "InternalLimits.h" file that contains a few essential constants.
>>>
>>> For example, the maximum alignment supported by LLVM is defined by CodeGen but clang's Sema needs to know that value to enforce that users stay within bounds. That being said, clang's Sema doesn't need or want to depend on CodeGen for various good reasons.
>>>
>>> If we create llvm/Support/InternalLimits.h and define the alignment limit there, then LLVM's CodeGen and clang's Sema can both include that file without Sema creating a dependency on CodeGen.
>>>
>>> Thoughts?
>>> Dave
>>> _______________________________________________
>>> LLVM Developers mailing list
>>> llvm-dev at lists.llvm.org
>>> https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
>> _______________________________________________
>> LLVM Developers mailing list
>> llvm-dev at lists.llvm.org
>> https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev


More information about the llvm-dev mailing list