forked from OSchip/llvm-project
Use assert(0) instead of duplicating the check, suggestion by Anna.
llvm-svn: 142886
This commit is contained in:
parent
0062e74961
commit
8edffaa611
|
@ -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.
|
||||
|
|
Loading…
Reference in New Issue