mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
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:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user