summaryrefslogtreecommitdiff
path: root/lib/Basic/SourceManager.cpp
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2011-10-25 00:29:44 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2011-10-25 00:29:44 +0000
commit82ccbe759b716f1747e03f54a4cd6eb164bb3427 (patch)
tree59ca62bec07006779a6d7acd3dafb3dbfcc12a3b /lib/Basic/SourceManager.cpp
parent58f6f1e37ab32fdd0c8bab6771d8e09bc139e9ed (diff)
downloadclang-82ccbe759b716f1747e03f54a4cd6eb164bb3427.tar.gz
Use assert(0) instead of duplicating the check, suggestion by Anna.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142886 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Basic/SourceManager.cpp')
-rw-r--r--lib/Basic/SourceManager.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/Basic/SourceManager.cpp b/lib/Basic/SourceManager.cpp
index 364663ee32..ddb1f39d1d 100644
--- a/lib/Basic/SourceManager.cpp
+++ b/lib/Basic/SourceManager.cpp
@@ -730,11 +730,11 @@ FileID SourceManager::getFileIDLocal(unsigned SLocOffset) const {
/// 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.