[PATCH] D108123: [MemoryBuiltins] Mark user defined delete as nobuiltin

Bryan Chan via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 19 05:59:32 PDT 2021


bryanpkc added a comment.

> Wasn't there some command-line argument to specify that a certain builtin isn't a builtin?

Yes, the option is `-fno-builtin`. This turns off all instruction combining on calls to recognized library calls. Adding this option does solve the problem, by changing the attributes on the `tail call void @_ZdlPv(i8* undef) #6` instruction to `attributes #6 = { builtin nobuiltin nounwind "no-builtins" }`.

Clang also happily accepts `-fno-builtin-delete`, but it is ineffective; the IR produced by the frontend is the same as if it ran without `-fno-builtin-delete`. If `-fno-builtin-delete` (and `-fno-builtin-new`, etc.) is supported properly, it could be the correct solution for this problem. The programmer needs to tell Clang that `delete` is overloaded in some translation unit, and this option is the way to do so.


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

https://reviews.llvm.org/D108123



More information about the llvm-commits mailing list