Fix StringRef conversion for LLVM 11 (777180a32b61070a10dd330b4f038bf24e916af1) (#3305)

This commit is contained in:
Fangrui Song 2020-01-31 17:52:35 -08:00 committed by GitHub
parent 97e0d978ee
commit 0a007a55f8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 31 additions and 28 deletions

View file

@ -250,7 +250,7 @@ void appendFullLibPathCandidates(std::vector<std::string> &paths,
for (const char *dir : ConfigFile::instance.libDirs()) {
llvm::SmallString<128> candidate(dir);
llvm::sys::path::append(candidate, filename);
paths.push_back(candidate.str());
paths.emplace_back(candidate.data(), candidate.size());
}
// for backwards compatibility
@ -310,7 +310,7 @@ void ArgsBuilder::addASanLinkFlags(const llvm::Triple &triple) {
// Add the path to the resource dir to rpath to support using the shared
// lib from the default location without copying.
args.push_back("-rpath");
args.push_back(llvm::sys::path::parent_path(filepath));
args.push_back(std::string(llvm::sys::path::parent_path(filepath)));
}
return;
@ -508,7 +508,7 @@ void ArgsBuilder::build(llvm::StringRef outputPath,
}
args.push_back("-o");
args.push_back(outputPath);
args.push_back(std::string(outputPath));
addSanitizers(*global.params.targetTriple);