Commit 509e21a1 authored by Jonas Devlieghere's avatar Jonas Devlieghere
Browse files

[clang] Replace SmallStr.str().str() with std::string conversion operator.

Use the std::string conversion operator introduced in
d7049213.
parent b2924d99
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -856,7 +856,7 @@ std::string PredefinedExpr::ComputeName(IdentKind IK, const Decl *CurrentDecl) {

    Out << Proto;

    return Name.str().str();
    return std::string(Name);
  }
  if (const CapturedDecl *CD = dyn_cast<CapturedDecl>(CurrentDecl)) {
    for (const DeclContext *DC = CD->getParent(); DC; DC = DC->getParent())
@@ -887,7 +887,7 @@ std::string PredefinedExpr::ComputeName(IdentKind IK, const Decl *CurrentDecl) {
    MD->getSelector().print(Out);
    Out <<  ']';

    return Name.str().str();
    return std::string(Name);
  }
  if (isa<TranslationUnitDecl>(CurrentDecl) && IK == PrettyFunction) {
    // __PRETTY_FUNCTION__ -> "top level", the others produce an empty string.
+1 −1
Original line number Diff line number Diff line
@@ -1282,7 +1282,7 @@ std::string normalizeFilename(StringRef Filename) {
  llvm::SmallString<256> Path(Filename);
  llvm::sys::fs::make_absolute(Path);
  llvm::sys::path::remove_dots(Path, /*remove_dot_dot=*/true);
  return Path.str().str();
  return std::string(Path);
}

} // end anonymous namespace
+1 −1
Original line number Diff line number Diff line
@@ -149,7 +149,7 @@ parseCrossTUIndex(StringRef IndexPath, StringRef CrossTUDir) {
      StringRef FileName = LineRef.substr(Pos + 1);
      SmallString<256> FilePath = CrossTUDir;
      llvm::sys::path::append(FilePath, FileName);
      Result[LookupName] = FilePath.str().str();
      Result[LookupName] = std::string(FilePath);
    } else
      return llvm::make_error<IndexError>(
          index_error_code::invalid_index_format, IndexPath.str(), LineNo);
+1 −1
Original line number Diff line number Diff line
@@ -4650,7 +4650,7 @@ std::string Driver::GetFilePath(StringRef Name, const ToolChain &TC) const {
      SmallString<128> P(Dir[0] == '=' ? SysRoot + Dir.substr(1) : Dir);
      llvm::sys::path::append(P, Name);
      if (llvm::sys::fs::exists(Twine(P)))
        return P.str().str();
        return std::string(P);
    }
    return None;
  };
+1 −1
Original line number Diff line number Diff line
@@ -159,7 +159,7 @@ std::string HeaderSearch::getPrebuiltModuleFileName(StringRef ModuleName,
    llvm::sys::fs::make_absolute(Result);
    llvm::sys::path::append(Result, ModuleName + ".pcm");
    if (getFileMgr().getFile(Result.str()))
      return Result.str().str();
      return std::string(Result);
  }
  return {};
}
Loading