Sirraide wrote:

> Well, there was some head-scratching before debugging revealed that Clang was 
> treating `malloc()` as a built-in.

Yeah, we have a class of ‘builtins’ that are marked as a `LibBuiltin` in 
`clang/Basic/Builtins.td`, and iirc that’s basically literally every function 
in the C standard library (and a few from the C++ standard library like 
`std::move`, `std::forward`, etc.). It’s what allows us to e.g. optimise 
`printf("foo\n")` → `puts("foo")`. If you only want *actual* builtin functions, 
you’ll have to exclude those, but I’m not sure all the builtins are nonblocking 
because I don’t know every single builtin off the top of my head...

If need be, it should be possible to add additional information to 
`Builtins.td` to signify what builtins are blocking etc., but I’d probably only 
recommend doing that if it turns out that that applies to a large number of 
them.

https://github.com/llvm/llvm-project/pull/99656
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to