From d395b9344d835eeb25156cfb7a6268ff92bd0e5c Mon Sep 17 00:00:00 2001 From: Peter Collingbourne Date: Thu, 30 Jun 2011 16:41:03 +0000 Subject: Replace an unreachable error path with an assert (SourceManager::createFileID cannot return an invalid file ID). Also update a comment to reflect this. llvm-svn: 134168 --- clang/lib/Lex/PPDirectives.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'clang/lib/Lex/PPDirectives.cpp') diff --git a/clang/lib/Lex/PPDirectives.cpp b/clang/lib/Lex/PPDirectives.cpp index b6925b70b70..f74aad3c816 100644 --- a/clang/lib/Lex/PPDirectives.cpp +++ b/clang/lib/Lex/PPDirectives.cpp @@ -1208,10 +1208,7 @@ void Preprocessor::HandleIncludeDirective(SourceLocation HashLoc, // Look up the file, create a File ID for it. FileID FID = SourceMgr.createFileID(File, FilenameTok.getLocation(), FileCharacter); - if (FID.isInvalid()) { - Diag(FilenameTok, diag::err_pp_file_not_found) << Filename; - return; - } + assert(!FID.isInvalid() && "Expected valid file ID"); // Finally, if all is good, enter the new file! EnterSourceFile(FID, CurDir, FilenameTok.getLocation()); -- cgit v1.2.3