aboutsummaryrefslogtreecommitdiff
path: root/include/clang/Basic/SourceManager.h
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2009-12-06 09:19:25 +0000
committerDaniel Dunbar <daniel@zuster.org>2009-12-06 09:19:25 +0000
commit2ffb14f004affc363d86d6c7c63c356190db3679 (patch)
tree0f3e279dfc03a64500b21598d08df2ad0b3f73e1 /include/clang/Basic/SourceManager.h
parent63ceaa32a2371e38d1f912080fe471285e6b6e56 (diff)
Unbreak and add test case for r90276, a situation in which getBuffer is expected to fail.
Also, update SourceManager.h doxyments for getBuffer() to reflect reality. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90701 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Basic/SourceManager.h')
-rw-r--r--include/clang/Basic/SourceManager.h11
1 files changed, 5 insertions, 6 deletions
diff --git a/include/clang/Basic/SourceManager.h b/include/clang/Basic/SourceManager.h
index 3b170a6a74..b4cf959dc5 100644
--- a/include/clang/Basic/SourceManager.h
+++ b/include/clang/Basic/SourceManager.h
@@ -70,8 +70,8 @@ namespace SrcMgr {
unsigned NumLines;
/// getBuffer - Returns the memory buffer for the associated content. If
- /// there is an error opening this buffer the first time, this returns null
- /// and fills in the ErrorStr with a reason.
+ /// there is an error opening this buffer the first time, this manufactures
+ /// a temporary buffer and returns a non-empty error string.
const llvm::MemoryBuffer *getBuffer(std::string *ErrorStr = 0) const;
/// getSize - Returns the size of the content encapsulated by this
@@ -426,10 +426,9 @@ public:
// FileID manipulation methods.
//===--------------------------------------------------------------------===//
- /// getBuffer - Return the buffer for the specified FileID. If there is an
- /// error opening this buffer the first time, this returns null and fills in
- /// the ErrorStr with a reason.
- ///
+ /// getBuffer - Return the buffer for the specified FileID. If there is an
+ /// error opening this buffer the first time, this manufactures a temporary
+ /// buffer and returns a non-empty error string.
const llvm::MemoryBuffer *getBuffer(FileID FID, std::string *Error = 0) const{
return getSLocEntry(FID).getFile().getContentCache()->getBuffer(Error);
}