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

@ -109,7 +109,7 @@ void printVersion(llvm::raw_ostream &OS) {
#endif
#endif
OS << " Default target: " << llvm::sys::getDefaultTargetTriple() << "\n";
std::string CPU = llvm::sys::getHostCPUName();
std::string CPU(llvm::sys::getHostCPUName());
if (CPU == "generic" || env::has("SOURCE_DATE_EPOCH")) {
// Env variable SOURCE_DATE_EPOCH indicates that a reproducible build is
// wanted. Don't print the actual host CPU in such an environment to aid
@ -564,7 +564,7 @@ void fixupUClibcEnv() {
llvm::Triple triple(mTargetTriple);
if (triple.getEnvironmentName().find("uclibc") != 0)
return;
std::string envName = triple.getEnvironmentName();
std::string envName(triple.getEnvironmentName());
envName.replace(0, 6, "gnu");
triple.setEnvironmentName(envName);
mTargetTriple = triple.normalize();