Add a stub of __context__ builtin from kernel's sparse#208
Add a stub of __context__ builtin from kernel's sparse#208jprotopopov-ut wants to merge 1 commit intogoblint:developfrom
Conversation
| else if isSparseBuiltin then | ||
| let one = Const(CInt(cilint_of_int 1, IInt, None)) in | ||
| (empty, one, intType) |
There was a problem hiding this comment.
Is it really necessary to replace it with an arbitrary constant 1?
Why does it need to be handled in CIL? Couldn't it just remain as a normal function call that's added to Goblint's LibraryFunctions?
Or alternatively, wouldn't it be enough to introduce initSparseBuiltins like
Line 2903 in e21285a
Most builtins are not specifically handled here, only the ones that really have to do something at compile time. But this
__context__ doesn't seem to require anything like this.
|
If I remember correctly, this built-in appeared in rather inconvenient places (e.g. function declarations), but at the moment I cannot find suitable examples. Once the other pull requests are dealt with, I will try to convert it into a library function to see whether it suffices. For now, converting into a draft. |
From what I gathered, there's two flavors of this (https://elixir.bootlin.com/linux/v6.19-rc5/source/include/linux/compiler_types.h#L55-L61):
|
Adds a stub for
__context__builtin of Linux kernel Sparse semantic checker.https://sparse.docs.kernel.org/en/latest/annotations.html#context-ctxt-entry-exit