diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2011-10-25 00:29:44 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2011-10-25 00:29:44 +0000 |
commit | 8edffaa6111d1ebc82c870fd675e1ddd9dcfb641 (patch) | |
tree | 448ddae7ddbba0f833773d8be8be42e1925c7354 /clang/lib/Basic/SourceManager.cpp | |
parent | 0062e7496183921decc7dcaefc37063ff017ac8b (diff) | |
download | bcm5719-llvm-8edffaa6111d1ebc82c870fd675e1ddd9dcfb641.tar.gz bcm5719-llvm-8edffaa6111d1ebc82c870fd675e1ddd9dcfb641.zip |
Use assert(0) instead of duplicating the check, suggestion by Anna.
llvm-svn: 142886
Diffstat (limited to 'clang/lib/Basic/SourceManager.cpp')
-rw-r--r-- | clang/lib/Basic/SourceManager.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/clang/lib/Basic/SourceManager.cpp b/clang/lib/Basic/SourceManager.cpp index 364663ee326..ddb1f39d1d6 100644 --- a/clang/lib/Basic/SourceManager.cpp +++ b/clang/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. |