From d4b8ca1ba2dda8b63bfc993347ba71315d5d68bc Mon Sep 17 00:00:00 2001 From: Reid Kleckner Date: Wed, 10 Feb 2016 19:09:15 +0000 Subject: [PATCH] Silence some MSVC false positive warnings about integer zexts and falling off the end of a covered switch git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@260411 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/MicrosoftCXXABI.cpp | 2 +- lib/Sema/CodeCompleteConsumer.cpp | 2 +- lib/Tooling/Core/QualTypeNames.cpp | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/CodeGen/MicrosoftCXXABI.cpp b/lib/CodeGen/MicrosoftCXXABI.cpp index f47b120a90..2567aa92f2 100644 --- a/lib/CodeGen/MicrosoftCXXABI.cpp +++ b/lib/CodeGen/MicrosoftCXXABI.cpp @@ -2311,7 +2311,7 @@ struct ResetGuardBit final : EHScopeStack::Cleanup { CGBuilderTy &Builder = CGF.Builder; llvm::LoadInst *LI = Builder.CreateLoad(Guard); llvm::ConstantInt *Mask = - llvm::ConstantInt::get(CGF.IntTy, ~(1U << GuardNum)); + llvm::ConstantInt::get(CGF.IntTy, ~(1ULL << GuardNum)); Builder.CreateStore(Builder.CreateAnd(LI, Mask), Guard); } }; diff --git a/lib/Sema/CodeCompleteConsumer.cpp b/lib/Sema/CodeCompleteConsumer.cpp index 18e9a59116..9a4f0d921b 100644 --- a/lib/Sema/CodeCompleteConsumer.cpp +++ b/lib/Sema/CodeCompleteConsumer.cpp @@ -309,7 +309,7 @@ StringRef CodeCompletionTUInfo::getParentName(const DeclContext *DC) { if (!Interface) { // Assign an empty StringRef but with non-null data to distinguish // between empty because we didn't process the DeclContext yet. - CachedParentName = StringRef((const char *)~0U, 0); + CachedParentName = StringRef((const char *)(uintptr_t)~0U, 0); return StringRef(); } diff --git a/lib/Tooling/Core/QualTypeNames.cpp b/lib/Tooling/Core/QualTypeNames.cpp index 6c3ff145cc..59fae3794c 100644 --- a/lib/Tooling/Core/QualTypeNames.cpp +++ b/lib/Tooling/Core/QualTypeNames.cpp @@ -243,6 +243,7 @@ static NestedNameSpecifier *getFullyQualifiedNestedNameSpecifier( return Scope; } } + llvm_unreachable("bad NNS kind"); } /// \brief Create a nested name specifier for the declaring context of -- 2.40.0