aboutsummaryrefslogtreecommitdiff
path: root/include/clang/Basic/SourceManager.h
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2010-10-26 20:47:28 +0000
committerDan Gohman <gohman@apple.com>2010-10-26 20:47:28 +0000
commit0d06e998910934e5ef070f53f4c272e7c6b846c6 (patch)
tree4b9538947ad2e97a1a6c4a2fdb9687e4deac77ee /include/clang/Basic/SourceManager.h
parent30af47fde154f04b3ac0c4cd9576e39e942689f8 (diff)
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
Diffstat (limited to 'include/clang/Basic/SourceManager.h')
-rw-r--r--include/clang/Basic/SourceManager.h6
1 files changed, 2 insertions, 4 deletions
diff --git a/include/clang/Basic/SourceManager.h b/include/clang/Basic/SourceManager.h
index fd4f3f4f7a..2098698400 100644
--- a/include/clang/Basic/SourceManager.h
+++ b/include/clang/Basic/SourceManager.h
@@ -466,7 +466,7 @@ public:
unsigned PreallocatedID = 0,
unsigned Offset = 0) {
const SrcMgr::ContentCache *IR = getOrCreateContentCache(SourceFile);
- if (IR == 0) return FileID(); // Error opening file?
+ assert(IR && "getOrCreateContentCache() cannot return NULL");
return createFileID(IR, IncludePos, FileCharacter, PreallocatedID, Offset);
}
@@ -516,9 +516,7 @@ public:
///
/// \param DoNotFree If true, then the buffer will not be freed when the
/// source manager is destroyed.
- ///
- /// \returns true if an error occurred, false otherwise.
- bool overrideFileContents(const FileEntry *SourceFile,
+ void overrideFileContents(const FileEntry *SourceFile,
const llvm::MemoryBuffer *Buffer,
bool DoNotFree = false);