Skip to content

Commit

Permalink
[BOLT] Remove redundaunt string initialization (NFC)
Browse files Browse the repository at this point in the history
Identified with readability-redundant-string-init.
  • Loading branch information
kazutakahirata committed Jul 31, 2022
1 parent f24ddf6 commit ce3b687
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion bolt/lib/Profile/YAMLProfileWriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 = ",";
Expand Down
8 changes: 4 additions & 4 deletions bolt/lib/Rewrite/DWARFRewriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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", "",
Expand All @@ -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);
Expand Down

0 comments on commit ce3b687

Please sign in to comment.