]> granicus.if.org Git - clang/commit
[Clang] Add __builtin_launder
authorEric Fiselier <eric@efcs.ca>
Fri, 14 Dec 2018 21:11:28 +0000 (21:11 +0000)
committerEric Fiselier <eric@efcs.ca>
Fri, 14 Dec 2018 21:11:28 +0000 (21:11 +0000)
commit5e6ad21ed04379e510f72b14b9325a3ebf27a9a6
treebdfd8d51152afa5b20113e9736c118f49bd673f6
parente98c891a878808bd78a7947557e53b035d2336d8
[Clang] Add __builtin_launder

Summary:
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.

Reviewers: rnk, majnemer, rsmith

Reviewed By: rsmith

Subscribers: kristina, Romain-Geissler-1A, erichkeane, amharc, jroelofs, cfe-commits, Prazek

Differential Revision: https://reviews.llvm.org/D40218

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@349195 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang/Basic/Builtins.def
include/clang/Basic/DiagnosticSemaKinds.td
lib/AST/ExprConstant.cpp
lib/CodeGen/CGBuiltin.cpp
lib/Sema/SemaChecking.cpp
test/CodeGen/builtins.c
test/CodeGenCXX/builtin-launder.cpp [new file with mode: 0644]
test/Preprocessor/feature_tests.c
test/Sema/builtins.c
test/SemaCXX/builtins.cpp