diff options
author | Douglas Gregor <dgregor@apple.com> | 2010-03-16 20:01:30 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2010-03-16 20:01:30 +0000 |
commit | aae58b0c3efb5fa9f97a3e4b1c1a2d31077efe5b (patch) | |
tree | 7bb2509f9b232b68f5a3d23be712a7be2462d946 /lib/Basic/SourceLocation.cpp | |
parent | aa38c3d326de8f9292e188f0aeb8039254c8d683 (diff) |
Audit all getBuffer() callers (for both the FullSourceLoc and
SourceManager versions), updating those callers that need to recover
gracefully from failure.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98665 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Basic/SourceLocation.cpp')
-rw-r--r-- | lib/Basic/SourceLocation.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/Basic/SourceLocation.cpp b/lib/Basic/SourceLocation.cpp index 126d640364..85e5595dc2 100644 --- a/lib/Basic/SourceLocation.cpp +++ b/lib/Basic/SourceLocation.cpp @@ -110,13 +110,13 @@ const char *FullSourceLoc::getCharacterData() const { return SrcMgr->getCharacterData(*this); } -const llvm::MemoryBuffer* FullSourceLoc::getBuffer() const { +const llvm::MemoryBuffer* FullSourceLoc::getBuffer(bool *Invalid) const { assert(isValid()); - return SrcMgr->getBuffer(SrcMgr->getFileID(*this)); + return SrcMgr->getBuffer(SrcMgr->getFileID(*this), Invalid); } -llvm::StringRef FullSourceLoc::getBufferData() const { - return getBuffer()->getBuffer(); +llvm::StringRef FullSourceLoc::getBufferData(bool *Invalid) const { + return getBuffer(Invalid)->getBuffer(); } std::pair<FileID, unsigned> FullSourceLoc::getDecomposedLoc() const { |