Use assert(0) instead of duplicating the check, suggestion by Anna.
llvm-svn: 142886
diff --git a/clang/lib/Basic/SourceManager.cpp b/clang/lib/Basic/SourceManager.cpp
index 364663ee..ddb1f39 100644
--- a/clang/lib/Basic/SourceManager.cpp
+++ b/clang/lib/Basic/SourceManager.cpp
@@ -730,11 +730,11 @@
/// This function knows that the SourceLocation is in a loaded buffer, not a
/// local one.
FileID SourceManager::getFileIDLoaded(unsigned SLocOffset) const {
- assert(SLocOffset >= CurrentLoadedOffset && "Bad function choice");
-
// Sanity checking, otherwise a bug may lead to hanging in release build.
- if (SLocOffset < CurrentLoadedOffset)
+ if (SLocOffset < CurrentLoadedOffset) {
+ assert(0 && "Invalid SLocOffset or bad function choice");
return FileID();
+ }
// Essentially the same as the local case, but the loaded array is sorted
// in the other direction.