From 0d06e998910934e5ef070f53f4c272e7c6b846c6 Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Tue, 26 Oct 2010 20:47:28 +0000 Subject: getOrCreateContentCache never returns null, so overrideFileContents doesn't need its return value. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117393 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Basic/SourceManager.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'lib/Basic/SourceManager.cpp') diff --git a/lib/Basic/SourceManager.cpp b/lib/Basic/SourceManager.cpp index b8383c3e58..8564a76feb 100644 --- a/lib/Basic/SourceManager.cpp +++ b/lib/Basic/SourceManager.cpp @@ -525,15 +525,13 @@ SourceManager::getMemoryBufferForFile(const FileEntry *File, return IR->getBuffer(Diag, *this, SourceLocation(), Invalid); } -bool SourceManager::overrideFileContents(const FileEntry *SourceFile, +void SourceManager::overrideFileContents(const FileEntry *SourceFile, const llvm::MemoryBuffer *Buffer, bool DoNotFree) { const SrcMgr::ContentCache *IR = getOrCreateContentCache(SourceFile); - if (IR == 0) - return true; + assert(IR && "getOrCreateContentCache() cannot return NULL"); const_cast(IR)->replaceBuffer(Buffer, DoNotFree); - return false; } llvm::StringRef SourceManager::getBufferData(FileID FID, bool *Invalid) const { -- cgit v1.2.3-18-g5258