aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/Support/ErrorHandling.cpp5
-rw-r--r--lib/Support/Windows/Path.inc2
2 files changed, 5 insertions, 2 deletions
diff --git a/lib/Support/ErrorHandling.cpp b/lib/Support/ErrorHandling.cpp
index f4b591e..9425445 100644
--- a/lib/Support/ErrorHandling.cpp
+++ b/lib/Support/ErrorHandling.cpp
@@ -96,4 +96,9 @@ void llvm::llvm_unreachable_internal(const char *msg, const char *file,
dbgs() << " at " << file << ":" << line;
dbgs() << "!\n";
abort();
+#ifdef LLVM_BUILTIN_UNREACHABLE
+ // Windows systems and possibly others don't declare abort() to be noreturn,
+ // so use the unreachable builtin to avoid a Clang self-host warning.
+ LLVM_BUILTIN_UNREACHABLE;
+#endif
}
diff --git a/lib/Support/Windows/Path.inc b/lib/Support/Windows/Path.inc
index 5787636..5a62a60 100644
--- a/lib/Support/Windows/Path.inc
+++ b/lib/Support/Windows/Path.inc
@@ -756,7 +756,6 @@ error_code mapped_file_region::init(int FD, bool CloseFD, uint64_t Offset) {
case readonly: flprotect = PAGE_READONLY; break;
case readwrite: flprotect = PAGE_READWRITE; break;
case priv: flprotect = PAGE_WRITECOPY; break;
- default: llvm_unreachable("invalid mapping mode");
}
FileMappingHandle = ::CreateFileMapping(FileHandle,
@@ -780,7 +779,6 @@ error_code mapped_file_region::init(int FD, bool CloseFD, uint64_t Offset) {
case readonly: dwDesiredAccess = FILE_MAP_READ; break;
case readwrite: dwDesiredAccess = FILE_MAP_WRITE; break;
case priv: dwDesiredAccess = FILE_MAP_COPY; break;
- default: llvm_unreachable("invalid mapping mode");
}
Mapping = ::MapViewOfFile(FileMappingHandle,
dwDesiredAccess,