From 7899d5049b0e96f18c27b18793c1891672ba080c Mon Sep 17 00:00:00 2001 From: Alp Toker Date: Wed, 25 Jun 2014 00:41:15 +0000 Subject: [PATCH] Use SourceMgr::getMemoryBuffer() in a couple of places Cleanup only. llvm-svn: 211656 --- llvm/lib/Support/SourceMgr.cpp | 4 ++-- llvm/utils/TableGen/CTagsEmitter.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/llvm/lib/Support/SourceMgr.cpp b/llvm/lib/Support/SourceMgr.cpp index 4d00d3b..2401ce7 100644 --- a/llvm/lib/Support/SourceMgr.cpp +++ b/llvm/lib/Support/SourceMgr.cpp @@ -83,7 +83,7 @@ SourceMgr::getLineAndColumn(SMLoc Loc, int BufferID) const { if (BufferID == -1) BufferID = FindBufferContainingLoc(Loc); assert(BufferID != -1 && "Invalid Location!"); - MemoryBuffer *Buff = getBufferInfo(BufferID).Buffer; + const MemoryBuffer *Buff = getMemoryBuffer(BufferID); // Count the number of \n's between the start of the file and the specified // location. @@ -152,7 +152,7 @@ SMDiagnostic SourceMgr::GetMessage(SMLoc Loc, SourceMgr::DiagKind Kind, int CurBuf = FindBufferContainingLoc(Loc); assert(CurBuf != -1 && "Invalid or unspecified location!"); - MemoryBuffer *CurMB = getBufferInfo(CurBuf).Buffer; + const MemoryBuffer *CurMB = getMemoryBuffer(CurBuf); BufferID = CurMB->getBufferIdentifier(); // Scan backward to find the start of the line. diff --git a/llvm/utils/TableGen/CTagsEmitter.cpp b/llvm/utils/TableGen/CTagsEmitter.cpp index 7108679..f518ad1 100644 --- a/llvm/utils/TableGen/CTagsEmitter.cpp +++ b/llvm/utils/TableGen/CTagsEmitter.cpp @@ -38,7 +38,7 @@ public: int operator<(const Tag &B) const { return *Id < *B.Id; } void emit(raw_ostream &OS) const { int BufferID = SrcMgr.FindBufferContainingLoc(Loc); - MemoryBuffer *CurMB = SrcMgr.getBufferInfo(BufferID).Buffer; + const MemoryBuffer *CurMB = SrcMgr.getMemoryBuffer(BufferID); const char *BufferName = CurMB->getBufferIdentifier(); std::pair LineAndColumn = SrcMgr.getLineAndColumn(Loc); OS << *Id << "\t" << BufferName << "\t" << LineAndColumn.first << "\n"; -- 2.7.4