add an assertion

llvm-svn: 51645
This commit is contained in:
Chris Lattner 2008-05-28 16:35:02 +00:00
parent e993b80ef5
commit c5c27f7bfe
1 changed files with 1 additions and 0 deletions

View File

@ -100,6 +100,7 @@ int Rewriter::getRangeSize(SourceRange Range) const {
unsigned Rewriter::getLocationOffsetAndFileID(SourceLocation Loc,
unsigned &FileID) const {
assert(Loc.isValid() && "Invalid location");
std::pair<unsigned,unsigned> V = SourceMgr->getDecomposedFileLoc(Loc);
FileID = V.first;
return V.second;