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

@@ -46,8 +46,7 @@ static llvm::error_code findModule(ASTContext &ctx, AccessPathElem moduleID,
// First, search in the directory corresponding to the import location.
// FIXME: This screams for a proper FileManager abstraction.
llvm::SMLoc rawLoc = moduleID.second.Value;
int currentBufferID = ctx.SourceMgr->FindBufferContainingLoc(rawLoc);
int currentBufferID = ctx.SourceMgr.findBufferContainingLoc(moduleID.second);
if (currentBufferID >= 0) {
const llvm::MemoryBuffer *importingBuffer
= ctx.SourceMgr->getBufferInfo(currentBufferID).Buffer;
@@ -100,9 +99,8 @@ static Module *makeTU(ASTContext &ctx, AccessPathElem moduleID,
// Transfer ownership of the MemoryBuffer to the SourceMgr.
// FIXME: include location
llvm::SMLoc rawLoc = moduleID.second.Value;
BufferIDs.push_back(ctx.SourceMgr->AddNewSourceBuffer(InputFile.take(),
rawLoc));
BufferIDs.push_back(ctx.SourceMgr.addNewSourceBuffer(InputFile.take(),
moduleID.second));
}
for (auto &BufferID : BufferIDs) {