[clang] nonblocking/nonallocating attributes (was: nolock/noalloc) (PR #84983)

via cfe-commits cfe-commits at lists.llvm.org
Fri Apr 12 17:49:20 PDT 2024


================
@@ -3734,7 +3734,10 @@ void FunctionProtoType::Profile(llvm::FoldingSetNodeID &ID, QualType Result,
   // spec because of the leading 'bool' which unambiguously indicates
   // whether the following bool is the EH spec or part of the arguments.
 
+  // TODO: The effect set is variable-length, though prefaced with a size.
+  // Does this create potential ambiguity?
----------------
Sirraide wrote:

Just happened to take a look at this commit so I’ll comment on it: You should be fine so long as you *always* unconditionally include the size; we also do this in other places: if there is no effect set, the size will always be `0`, so any ID that has no effect set has `0` in that position; if the size is non-zero, then we know that the next size*`n` (where `n` is however many bytes it takes to profile an effect, assuming that that’s constant) bytes will be the effects. Basically, so long as they never ‘overlap’ w/ anything / so long as you can think of a way to ‘reverse’ the profiling (not that we ever do that), then it should be fine.

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


More information about the cfe-commits mailing list