[PATCH] D40218: [Clang] Add __builtin_launder

Eric Fiselier via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sat Nov 18 15:03:53 PST 2017


EricWF created this revision.
Herald added a subscriber: Prazek.

This patch adds `__builtin_launder`, which is required to implement `std::launder`. Additionally GCC provides `__builtin_launder`, so thing brings Clang in-line with GCC.

I'm not exactly sure what magic `__builtin_launder` requires, but  based on previous discussions this patch applies a `@llvm.invariant.group.barrier`. As noted in previous discussions, this may not be enough to correctly handle vtables.


https://reviews.llvm.org/D40218

Files:
  include/clang/Basic/Builtins.def
  include/clang/Basic/DiagnosticSemaKinds.td
  lib/CodeGen/CGBuiltin.cpp
  lib/Sema/SemaChecking.cpp
  test/CodeGen/builtins.c
  test/Preprocessor/feature_tests.c
  test/Sema/builtins.c
  test/SemaCXX/builtins.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D40218.123482.patch
Type: text/x-patch
Size: 6044 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20171118/332b65bd/attachment.bin>


More information about the cfe-commits mailing list