summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/ExprConstant.cpp
diff options
context:
space:
mode:
authorEric Fiselier <eric@efcs.ca>2018-12-14 21:11:28 +0000
committerEric Fiselier <eric@efcs.ca>2018-12-14 21:11:28 +0000
commit261875054e5ebbc7b7ec17b0febecdb5e8507b4c (patch)
tree4305141ff96d4eadc6bfeff0fbd351766f4e8e79 /clang/lib/AST/ExprConstant.cpp
parent8f06d102915d37db60792e9b2e8808a6834faea0 (diff)
downloadbcm5719-llvm-261875054e5ebbc7b7ec17b0febecdb5e8507b4c.tar.gz
bcm5719-llvm-261875054e5ebbc7b7ec17b0febecdb5e8507b4c.zip
[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 llvm-svn: 349195
Diffstat (limited to 'clang/lib/AST/ExprConstant.cpp')
-rw-r--r--clang/lib/AST/ExprConstant.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/AST/ExprConstant.cpp b/clang/lib/AST/ExprConstant.cpp
index 7b5b0a7d453..837dc9c2a8e 100644
--- a/clang/lib/AST/ExprConstant.cpp
+++ b/clang/lib/AST/ExprConstant.cpp
@@ -6112,7 +6112,8 @@ bool PointerExprEvaluator::VisitBuiltinCallExpr(const CallExpr *E,
return true;
}
-
+ case Builtin::BI__builtin_launder:
+ return evaluatePointer(E->getArg(0), Result);
case Builtin::BIstrchr:
case Builtin::BIwcschr:
case Builtin::BImemchr:
OpenPOWER on IntegriCloud