summaryrefslogtreecommitdiffstats
path: root/clang/lib/Basic
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/Basic')
-rw-r--r--clang/lib/Basic/SourceLocation.cpp2
-rw-r--r--clang/lib/Basic/SourceManager.cpp2
2 files changed, 2 insertions, 2 deletions
diff --git a/clang/lib/Basic/SourceLocation.cpp b/clang/lib/Basic/SourceLocation.cpp
index dcfd547eec4..1f5804ff9ca 100644
--- a/clang/lib/Basic/SourceLocation.cpp
+++ b/clang/lib/Basic/SourceLocation.cpp
@@ -111,7 +111,7 @@ const char *FullSourceLoc::getCharacterData() const {
const llvm::MemoryBuffer* FullSourceLoc::getBuffer() const {
assert(isValid());
- return SrcMgr->getBuffer(*this);
+ return SrcMgr->getBuffer(SrcMgr->getCanonicalFileID(*this));
}
void FullSourceLoc::dump() const {
diff --git a/clang/lib/Basic/SourceManager.cpp b/clang/lib/Basic/SourceManager.cpp
index f793c978ccb..b053b160e1c 100644
--- a/clang/lib/Basic/SourceManager.cpp
+++ b/clang/lib/Basic/SourceManager.cpp
@@ -184,7 +184,7 @@ SourceLocation SourceManager::getInstantiationLoc(SourceLocation SpellingLoc,
/// data for the specified location.
std::pair<const char*, const char*>
SourceManager::getBufferData(SourceLocation Loc) const {
- const llvm::MemoryBuffer *Buf = getBuffer(Loc);
+ const llvm::MemoryBuffer *Buf = getBuffer(getCanonicalFileID(Loc));
return std::make_pair(Buf->getBufferStart(), Buf->getBufferEnd());
}
OpenPOWER on IntegriCloud