summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlp Toker <alp@nuanti.com>2014-06-25 00:41:15 +0000
committerAlp Toker <alp@nuanti.com>2014-06-25 00:41:15 +0000
commit7899d5049b0e96f18c27b18793c1891672ba080c (patch)
tree2f261fb54807167954d756d96557528bfc7cc89b
parent2bc7643d10e29f3133fc34ea256a3467e1716194 (diff)
downloadbcm5719-llvm-7899d5049b0e96f18c27b18793c1891672ba080c.tar.gz
bcm5719-llvm-7899d5049b0e96f18c27b18793c1891672ba080c.zip
Use SourceMgr::getMemoryBuffer() in a couple of places
Cleanup only. llvm-svn: 211656
-rw-r--r--llvm/lib/Support/SourceMgr.cpp4
-rw-r--r--llvm/utils/TableGen/CTagsEmitter.cpp2
2 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/Support/SourceMgr.cpp b/llvm/lib/Support/SourceMgr.cpp
index 4d00d3baa41..2401ce73772 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 71086790a3e..f518ad132a6 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<unsigned, unsigned> LineAndColumn = SrcMgr.getLineAndColumn(Loc);
OS << *Id << "\t" << BufferName << "\t" << LineAndColumn.first << "\n";
OpenPOWER on IntegriCloud