diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2017-07-29 21:28:13 +0000 |
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2017-07-29 21:28:13 +0000 |
| commit | 104a02fb6c96111ce06b53e282adfb2b4a59eeb6 (patch) | |
| tree | 02be8e837f8c68bc892007a15f04412ab0f17d60 /lib/AST | |
| parent | de51d671486b6ac9a2ad9ee5fcfdb1a23cc59238 (diff) | |
Notes
Diffstat (limited to 'lib/AST')
| -rw-r--r-- | lib/AST/StmtProfile.cpp | 15 | ||||
| -rw-r--r-- | lib/AST/Type.cpp | 9 |
2 files changed, 24 insertions, 0 deletions
diff --git a/lib/AST/StmtProfile.cpp b/lib/AST/StmtProfile.cpp index e06386018d68..7ec0d1d5e017 100644 --- a/lib/AST/StmtProfile.cpp +++ b/lib/AST/StmtProfile.cpp @@ -1388,6 +1388,15 @@ static Stmt::StmtClass DecodeOperatorCall(const CXXOperatorCallExpr *S, llvm_unreachable("Invalid overloaded operator expression"); } +#if defined(_MSC_VER) +#if _MSC_VER == 1911 +// Work around https://developercommunity.visualstudio.com/content/problem/84002/clang-cl-when-built-with-vc-2017-crashes-cause-vc.html +// MSVC 2017 update 3 miscompiles this function, and a clang built with it +// will crash in stage 2 of a bootstrap build. +#pragma optimize("", off) +#endif +#endif + void StmtProfiler::VisitCXXOperatorCallExpr(const CXXOperatorCallExpr *S) { if (S->isTypeDependent()) { // Type-dependent operator calls are profiled like their underlying @@ -1420,6 +1429,12 @@ void StmtProfiler::VisitCXXOperatorCallExpr(const CXXOperatorCallExpr *S) { ID.AddInteger(S->getOperator()); } +#if defined(_MSC_VER) +#if _MSC_VER == 1911 +#pragma optimize("", on) +#endif +#endif + void StmtProfiler::VisitCXXMemberCallExpr(const CXXMemberCallExpr *S) { VisitCallExpr(S); } diff --git a/lib/AST/Type.cpp b/lib/AST/Type.cpp index eac02c0102bc..d21781dc3899 100644 --- a/lib/AST/Type.cpp +++ b/lib/AST/Type.cpp @@ -2313,6 +2313,15 @@ bool Type::isAlignValT() const { return false; } +bool Type::isStdByteType() const { + if (auto *ET = getAs<EnumType>()) { + auto *II = ET->getDecl()->getIdentifier(); + if (II && II->isStr("byte") && ET->getDecl()->isInStdNamespace()) + return true; + } + return false; +} + bool Type::isPromotableIntegerType() const { if (const BuiltinType *BT = getAs<BuiltinType>()) switch (BT->getKind()) { |
