Update uses of llvm::MemoryBuffer::getFile() for r193429.

getFile() now takes a Twine. SmallStrings need to be wrapped in StringRefs
to be Twine-compatible.

Swift SVN r9684
This commit is contained in:
Jordan Rose
2013-10-25 22:43:12 +00:00
parent fc88c5dae6
commit 13cbf2d55c
2 changed files with 10 additions and 6 deletions

View File

@@ -61,14 +61,16 @@ static llvm::error_code findModule(ASTContext &ctx, AccessPathElem moduleID,
if (!currentDirectory.empty()) {
inputFilename = currentDirectory;
llvm::sys::path::append(inputFilename, moduleFilename.str());
llvm::error_code err = llvm::MemoryBuffer::getFile(inputFilename, buffer);
llvm::error_code err = llvm::MemoryBuffer::getFile(inputFilename.str(),
buffer);
if (!err)
return err;
}
}
// Second, search in the current directory.
llvm::error_code err = llvm::MemoryBuffer::getFile(moduleFilename, buffer);
llvm::error_code err = llvm::MemoryBuffer::getFile(moduleFilename.str(),
buffer);
if (!err)
return err;
@@ -76,7 +78,7 @@ static llvm::error_code findModule(ASTContext &ctx, AccessPathElem moduleID,
for (auto Path : ctx.ImportSearchPaths) {
inputFilename = Path;
llvm::sys::path::append(inputFilename, moduleFilename.str());
err = llvm::MemoryBuffer::getFile(inputFilename, buffer);
err = llvm::MemoryBuffer::getFile(inputFilename.str(), buffer);
if (!err)
return err;
}