diff options
author | Dan Gohman <gohman@apple.com> | 2010-10-26 20:47:28 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2010-10-26 20:47:28 +0000 |
commit | 5d223dcb2f33c65163f5bf5abb3d1af50ed64752 (patch) | |
tree | 0123479882404e882904b8e02a7e05ce6bdfa035 /clang/lib/Basic/SourceManager.cpp | |
parent | b7050233fbb030d83377d0092a9bb940a2a2ea3b (diff) | |
download | bcm5719-llvm-5d223dcb2f33c65163f5bf5abb3d1af50ed64752.tar.gz bcm5719-llvm-5d223dcb2f33c65163f5bf5abb3d1af50ed64752.zip |
getOrCreateContentCache never returns null, so overrideFileContents
doesn't need its return value.
llvm-svn: 117393
Diffstat (limited to 'clang/lib/Basic/SourceManager.cpp')
-rw-r--r-- | clang/lib/Basic/SourceManager.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/clang/lib/Basic/SourceManager.cpp b/clang/lib/Basic/SourceManager.cpp index b8383c3e58a..8564a76feb1 100644 --- a/clang/lib/Basic/SourceManager.cpp +++ b/clang/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<SrcMgr::ContentCache *>(IR)->replaceBuffer(Buffer, DoNotFree); - return false; } llvm::StringRef SourceManager::getBufferData(FileID FID, bool *Invalid) const { |