Skip to content

Commit ce3b687

Browse files
[BOLT] Remove redundaunt string initialization (NFC)
Identified with readability-redundant-string-init.
1 parent f24ddf6 commit ce3b687

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

bolt/lib/Profile/YAMLProfileWriter.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ std::error_code YAMLProfileWriter::writeProfile(const RewriteInstance &RI) {
160160

161161
StringSet<> EventNames = RI.getProfileReader()->getEventNames();
162162
if (!EventNames.empty()) {
163-
std::string Sep = "";
163+
std::string Sep;
164164
for (const StringMapEntry<NoneType> &EventEntry : EventNames) {
165165
BP.Header.EventNames += Sep + EventEntry.first().str();
166166
Sep = ",";

bolt/lib/Rewrite/DWARFRewriter.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ void DWARFRewriter::updateDebugInfo() {
235235
(void)AttrInfoVal;
236236
assert(AttrInfoVal && "Skeleton CU doesn't have dwo_name.");
237237

238-
std::string ObjectName = "";
238+
std::string ObjectName;
239239

240240
{
241241
std::lock_guard<std::mutex> Lock(AccessMutex);
@@ -1436,7 +1436,7 @@ void DWARFRewriter::writeDWP(
14361436
TUContributionVector TUContributionsToCU;
14371437
for (const SectionRef &Section : DWOFile->sections()) {
14381438
std::string DWOTUSection;
1439-
std::string Storage = "";
1439+
std::string Storage;
14401440
std::unique_ptr<DebugBufferVector> OutputData;
14411441
StringRef SectionName = getSectionName(Section);
14421442
Expected<StringRef> ContentsExp = Section.getContents();
@@ -1593,7 +1593,7 @@ void DWARFRewriter::writeDWOFiles(
15931593
// Handling .debug_rnglists.dwo seperatly. The original .o/.dwo might not
15941594
// have .debug_rnglists so won't be part of the loop below.
15951595
if (!RangeListssWriter->empty()) {
1596-
std::string Storage = "";
1596+
std::string Storage;
15971597
std::unique_ptr<DebugBufferVector> OutputData;
15981598
if (Optional<StringRef> OutData = updateDebugData(
15991599
(*DWOCU)->getContext(), Storage, "debug_rnglists.dwo", "",
@@ -1605,7 +1605,7 @@ void DWARFRewriter::writeDWOFiles(
16051605

16061606
TUContributionVector TUContributionsToCU;
16071607
for (const SectionRef &Section : File->sections()) {
1608-
std::string Storage = "";
1608+
std::string Storage;
16091609
std::string DWOTUSection;
16101610
std::unique_ptr<DebugBufferVector> OutputData;
16111611
StringRef SectionName = getSectionName(Section);

0 commit comments

Comments
 (0)