mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-03 13:31:05 +00:00
Use SourceMgr::getMemoryBuffer() in a couple of places
Cleanup only. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211656 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
1a7e8c4973
commit
f36a43dbba
@ -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.
|
||||
|
@ -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";
|
||||
|
Loading…
Reference in New Issue
Block a user