Wrap a few functions from LLVM SourceMgr in preparation of making

SourceLoc::Value private


Swift SVN r7114
This commit is contained in:
Dmitri Hrybenko
2013-08-09 23:15:59 +00:00
parent aa11e4be55
commit 8f7a437d44
8 changed files with 38 additions and 27 deletions

View File

@@ -90,6 +90,14 @@ public:
rangeContainsTokenLoc(Enclosing, Inner.End);
}
int findBufferContainingLoc(SourceLoc Loc) const {
return LLVMSourceMgr.FindBufferContainingLoc(Loc.Value);
}
size_t addNewSourceBuffer(llvm::MemoryBuffer *Buffer, SourceLoc IncludeLoc) {
return LLVMSourceMgr.AddNewSourceBuffer(Buffer, IncludeLoc.Value);
}
/// \brief Returns the SourceLoc for the beginning of the specified buffer
/// (at offset zero).
///
@@ -101,6 +109,11 @@ public:
unsigned getLocOffsetInBuffer(SourceLoc Loc, unsigned BufferID) const;
DecomposedLoc decompose(SourceLoc Loc) const;
std::pair<unsigned, unsigned> getLineAndColumn(SourceLoc Loc,
int BufferID = -1) const {
return LLVMSourceMgr.getLineAndColumn(Loc.Value, BufferID);
}
};
} // namespace swift