aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Basic/SourceLocation.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2010-03-16 20:01:30 +0000
committerDouglas Gregor <dgregor@apple.com>2010-03-16 20:01:30 +0000
commit4fb7fbef3b3ff9233d8163a40eefafd8b36e9fd1 (patch)
treebecb455ac4bd68fee869e1cf68500ecbffdba37f /clang/lib/Basic/SourceLocation.cpp
parent26266da3c35d5a47770a9b165d5b5c74e714898b (diff)
downloadllvm-4fb7fbef3b3ff9233d8163a40eefafd8b36e9fd1.zip
llvm-4fb7fbef3b3ff9233d8163a40eefafd8b36e9fd1.tar.gz
llvm-4fb7fbef3b3ff9233d8163a40eefafd8b36e9fd1.tar.bz2
Audit all getBuffer() callers (for both the FullSourceLoc and
SourceManager versions), updating those callers that need to recover gracefully from failure. llvm-svn: 98665
Diffstat (limited to 'clang/lib/Basic/SourceLocation.cpp')
-rw-r--r--clang/lib/Basic/SourceLocation.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/clang/lib/Basic/SourceLocation.cpp b/clang/lib/Basic/SourceLocation.cpp
index 126d640..85e5595 100644
--- a/clang/lib/Basic/SourceLocation.cpp
+++ b/clang/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 {