[BOLT] Remove redundaunt string initialization (NFC)

Identified with readability-redundant-string-init.
This commit is contained in:
Kazu Hirata 2022-07-31 15:17:05 -07:00
parent f24ddf6d41
commit ce3b687b88
2 changed files with 5 additions and 5 deletions

View File

@ -160,7 +160,7 @@ std::error_code YAMLProfileWriter::writeProfile(const RewriteInstance &RI) {
StringSet<> EventNames = RI.getProfileReader()->getEventNames();
if (!EventNames.empty()) {
std::string Sep = "";
std::string Sep;
for (const StringMapEntry<NoneType> &EventEntry : EventNames) {
BP.Header.EventNames += Sep + EventEntry.first().str();
Sep = ",";

View File

@ -235,7 +235,7 @@ void DWARFRewriter::updateDebugInfo() {
(void)AttrInfoVal;
assert(AttrInfoVal && "Skeleton CU doesn't have dwo_name.");
std::string ObjectName = "";
std::string ObjectName;
{
std::lock_guard<std::mutex> Lock(AccessMutex);
@ -1436,7 +1436,7 @@ void DWARFRewriter::writeDWP(
TUContributionVector TUContributionsToCU;
for (const SectionRef &Section : DWOFile->sections()) {
std::string DWOTUSection;
std::string Storage = "";
std::string Storage;
std::unique_ptr<DebugBufferVector> OutputData;
StringRef SectionName = getSectionName(Section);
Expected<StringRef> ContentsExp = Section.getContents();
@ -1593,7 +1593,7 @@ void DWARFRewriter::writeDWOFiles(
// Handling .debug_rnglists.dwo seperatly. The original .o/.dwo might not
// have .debug_rnglists so won't be part of the loop below.
if (!RangeListssWriter->empty()) {
std::string Storage = "";
std::string Storage;
std::unique_ptr<DebugBufferVector> OutputData;
if (Optional<StringRef> OutData = updateDebugData(
(*DWOCU)->getContext(), Storage, "debug_rnglists.dwo", "",
@ -1605,7 +1605,7 @@ void DWARFRewriter::writeDWOFiles(
TUContributionVector TUContributionsToCU;
for (const SectionRef &Section : File->sections()) {
std::string Storage = "";
std::string Storage;
std::string DWOTUSection;
std::unique_ptr<DebugBufferVector> OutputData;
StringRef SectionName = getSectionName(Section);