diff options
author | Kazu Hirata <kazu@google.com> | 2021-01-12 21:43:46 -0800 |
---|---|---|
committer | Kazu Hirata <kazu@google.com> | 2021-01-12 21:43:46 -0800 |
commit | 12fc9ca3a4037a26d4bc0ac98213c846ad96e51b (patch) | |
tree | 3fe3f3a79b14f98f2e536d2d6d0d67a937399383 /llvm | |
parent | fba9805ba3491db03ad538ea2db2f225f57ff98e (diff) | |
download | llvm-12fc9ca3a4037a26d4bc0ac98213c846ad96e51b.zip llvm-12fc9ca3a4037a26d4bc0ac98213c846ad96e51b.tar.gz llvm-12fc9ca3a4037a26d4bc0ac98213c846ad96e51b.tar.bz2 |
[llvm] Remove redundant string initialization (NFC)
Identified with readability-redundant-string-init.
Diffstat (limited to 'llvm')
-rw-r--r-- | llvm/include/llvm/LTO/Config.h | 6 | ||||
-rw-r--r-- | llvm/lib/Analysis/CallPrinter.cpp | 2 | ||||
-rw-r--r-- | llvm/lib/Analysis/ConstraintSystem.cpp | 2 | ||||
-rw-r--r-- | llvm/lib/CodeGen/GlobalISel/InstructionSelect.cpp | 2 | ||||
-rw-r--r-- | llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp | 2 | ||||
-rw-r--r-- | llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldChecker.cpp | 4 | ||||
-rw-r--r-- | llvm/lib/Target/Mips/MipsRegisterBankInfo.h | 2 | ||||
-rw-r--r-- | llvm/lib/Transforms/IPO/Attributor.cpp | 2 | ||||
-rw-r--r-- | llvm/lib/Transforms/Scalar/LowerMatrixIntrinsics.cpp | 2 | ||||
-rw-r--r-- | llvm/tools/llvm-cov/SourceCoverageViewHTML.cpp | 4 | ||||
-rw-r--r-- | llvm/tools/llvm-ifs/llvm-ifs.cpp | 2 | ||||
-rw-r--r-- | llvm/tools/llvm-objdump/MachODump.cpp | 4 | ||||
-rw-r--r-- | llvm/utils/TableGen/CodeGenDAGPatterns.cpp | 2 | ||||
-rw-r--r-- | llvm/utils/TableGen/CodeGenInstruction.cpp | 2 | ||||
-rw-r--r-- | llvm/utils/TableGen/CodeGenMapTable.cpp | 2 | ||||
-rw-r--r-- | llvm/utils/TableGen/GlobalISelEmitter.cpp | 6 | ||||
-rw-r--r-- | llvm/utils/TableGen/RISCVCompressInstEmitter.cpp | 6 |
17 files changed, 26 insertions, 26 deletions
diff --git a/llvm/include/llvm/LTO/Config.h b/llvm/include/llvm/LTO/Config.h index c4bf370..1a7595d 100644 --- a/llvm/include/llvm/LTO/Config.h +++ b/llvm/include/llvm/LTO/Config.h @@ -114,10 +114,10 @@ struct Config { std::string SplitDwarfOutput; /// Optimization remarks file path. - std::string RemarksFilename = ""; + std::string RemarksFilename; /// Optimization remarks pass filter. - std::string RemarksPasses = ""; + std::string RemarksPasses; /// Whether to emit optimization remarks with hotness informations. bool RemarksWithHotness = false; @@ -138,7 +138,7 @@ struct Config { llvm::Optional<uint64_t> RemarksHotnessThreshold = 0; /// The format used for serializing remarks (default: YAML). - std::string RemarksFormat = ""; + std::string RemarksFormat; /// Whether to emit the pass manager debuggging informations. bool DebugPassManager = false; diff --git a/llvm/lib/Analysis/CallPrinter.cpp b/llvm/lib/Analysis/CallPrinter.cpp index c3922d5..872a91a 100644 --- a/llvm/lib/Analysis/CallPrinter.cpp +++ b/llvm/lib/Analysis/CallPrinter.cpp @@ -196,7 +196,7 @@ struct DOTGraphTraits<CallGraphDOTInfo *> : public DefaultDOTGraphTraits { Function *F = Node->getFunction(); if (F == nullptr) return ""; - std::string attrs = ""; + std::string attrs; if (ShowHeatColors) { uint64_t freq = CGInfo->getFreq(F); std::string color = getHeatColor(freq, CGInfo->getMaxFreq()); diff --git a/llvm/lib/Analysis/ConstraintSystem.cpp b/llvm/lib/Analysis/ConstraintSystem.cpp index 1d58280..9739c6a 100644 --- a/llvm/lib/Analysis/ConstraintSystem.cpp +++ b/llvm/lib/Analysis/ConstraintSystem.cpp @@ -116,7 +116,7 @@ void ConstraintSystem::dump(ArrayRef<std::string> Names) const { for (unsigned I = 1, S = Row.size(); I < S; ++I) { if (Row[I] == 0) continue; - std::string Coefficient = ""; + std::string Coefficient; if (Row[I] != 1) Coefficient = std::to_string(Row[I]) + " * "; Parts.push_back(Coefficient + Names[I - 1]); diff --git a/llvm/lib/CodeGen/GlobalISel/InstructionSelect.cpp b/llvm/lib/CodeGen/GlobalISel/InstructionSelect.cpp index f32278d..25fae54 100644 --- a/llvm/lib/CodeGen/GlobalISel/InstructionSelect.cpp +++ b/llvm/lib/CodeGen/GlobalISel/InstructionSelect.cpp @@ -41,7 +41,7 @@ static cl::opt<std::string> cl::desc("Record GlobalISel rule coverage files of this " "prefix if instrumentation was generated")); #else -static const std::string CoveragePrefix = ""; +static const std::string CoveragePrefix; #endif char InstructionSelect::ID = 0; diff --git a/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp b/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp index 7bc5c98..32e8393 100644 --- a/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp +++ b/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp @@ -917,7 +917,7 @@ MCSection *TargetLoweringObjectFileELF::getSectionForMachineBasicBlock( } unsigned Flags = ELF::SHF_ALLOC | ELF::SHF_EXECINSTR; - std::string GroupName = ""; + std::string GroupName; if (F.hasComdat()) { Flags |= ELF::SHF_GROUP; GroupName = F.getComdat()->getName().str(); diff --git a/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldChecker.cpp b/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldChecker.cpp index e5e5126..2fbe707 100644 --- a/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldChecker.cpp +++ b/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldChecker.cpp @@ -352,7 +352,7 @@ private: RemainingExpr = RemainingExpr.substr(1).ltrim(); uint64_t StubAddr; - std::string ErrorMsg = ""; + std::string ErrorMsg; std::tie(StubAddr, ErrorMsg) = Checker.getStubOrGOTAddrFor( StubContainerName, Symbol, PCtx.IsInsideLoad, IsStubAddr); @@ -389,7 +389,7 @@ private: RemainingExpr = RemainingExpr.substr(1).ltrim(); uint64_t StubAddr; - std::string ErrorMsg = ""; + std::string ErrorMsg; std::tie(StubAddr, ErrorMsg) = Checker.getSectionAddr( FileName, SectionName, PCtx.IsInsideLoad); diff --git a/llvm/lib/Target/Mips/MipsRegisterBankInfo.h b/llvm/lib/Target/Mips/MipsRegisterBankInfo.h index 55eeaf0..df51606 100644 --- a/llvm/lib/Target/Mips/MipsRegisterBankInfo.h +++ b/llvm/lib/Target/Mips/MipsRegisterBankInfo.h @@ -150,7 +150,7 @@ private: class TypeInfoForMF { /// MachineFunction name is used to recognise when MF changes. - std::string MFName = ""; + std::string MFName; /// <key, value> : value is vector of all MachineInstrs that are waiting for /// key to figure out type of some of its ambiguous operands. DenseMap<const MachineInstr *, SmallVector<const MachineInstr *, 2>> diff --git a/llvm/lib/Transforms/IPO/Attributor.cpp b/llvm/lib/Transforms/IPO/Attributor.cpp index ab4ad7c..03ad451 100644 --- a/llvm/lib/Transforms/IPO/Attributor.cpp +++ b/llvm/lib/Transforms/IPO/Attributor.cpp @@ -2459,7 +2459,7 @@ template <> struct DOTGraphTraits<AADepGraph *> : public DefaultDOTGraphTraits { static std::string getNodeLabel(const AADepGraphNode *Node, const AADepGraph *DG) { - std::string AAString = ""; + std::string AAString; raw_string_ostream O(AAString); Node->print(O); return AAString; diff --git a/llvm/lib/Transforms/Scalar/LowerMatrixIntrinsics.cpp b/llvm/lib/Transforms/Scalar/LowerMatrixIntrinsics.cpp index 1917397..9d856c8 100644 --- a/llvm/lib/Transforms/Scalar/LowerMatrixIntrinsics.cpp +++ b/llvm/lib/Transforms/Scalar/LowerMatrixIntrinsics.cpp @@ -1596,7 +1596,7 @@ public: write(StringRef(Intrinsic::getName(II->getIntrinsicID(), {})) .drop_front(StringRef("llvm.matrix.").size())); write("."); - std::string Tmp = ""; + std::string Tmp; raw_string_ostream SS(Tmp); switch (II->getIntrinsicID()) { diff --git a/llvm/tools/llvm-cov/SourceCoverageViewHTML.cpp b/llvm/tools/llvm-cov/SourceCoverageViewHTML.cpp index 4db5624..7ab1d66 100644 --- a/llvm/tools/llvm-cov/SourceCoverageViewHTML.cpp +++ b/llvm/tools/llvm-cov/SourceCoverageViewHTML.cpp @@ -248,7 +248,7 @@ const char *ReportTitleTag = "h2"; const char *CreatedTimeTag = "h4"; std::string getPathToStyle(StringRef ViewPath) { - std::string PathToStyle = ""; + std::string PathToStyle; std::string PathSep = std::string(sys::path::get_separator()); unsigned NumSeps = ViewPath.count(PathSep); for (unsigned I = 0, E = NumSeps; I < E; ++I) @@ -617,7 +617,7 @@ void SourceCoverageViewHTML::renderLine(raw_ostream &OS, LineRef L, void SourceCoverageViewHTML::renderLineCoverageColumn( raw_ostream &OS, const LineCoverageStats &Line) { - std::string Count = ""; + std::string Count; if (Line.isMapped()) Count = tag("pre", formatCount(Line.getExecutionCount())); std::string CoverageClass = diff --git a/llvm/tools/llvm-ifs/llvm-ifs.cpp b/llvm/tools/llvm-ifs/llvm-ifs.cpp index 8906300..4d9a5c3 100644 --- a/llvm/tools/llvm-ifs/llvm-ifs.cpp +++ b/llvm/tools/llvm-ifs/llvm-ifs.cpp @@ -384,7 +384,7 @@ int main(int argc, char *argv[]) { IFSStub Stub; std::map<std::string, IFSSymbol> SymbolMap; - std::string PreviousInputFilePath = ""; + std::string PreviousInputFilePath; for (const std::string &InputFilePath : InputFilenames) { Expected<std::unique_ptr<IFSStub>> StubOrErr = readInputFile(InputFilePath); if (!StubOrErr) { diff --git a/llvm/tools/llvm-objdump/MachODump.cpp b/llvm/tools/llvm-objdump/MachODump.cpp index 1fa9879..51212d5 100644 --- a/llvm/tools/llvm-objdump/MachODump.cpp +++ b/llvm/tools/llvm-objdump/MachODump.cpp @@ -2395,7 +2395,7 @@ void objdump::parseInputMachO(MachOUniversalBinary *UB) { ArchFound = true; Expected<std::unique_ptr<ObjectFile>> ObjOrErr = I->getAsObjectFile(); - std::string ArchitectureName = ""; + std::string ArchitectureName; if (ArchFlags.size() > 1) ArchitectureName = I->getArchFlagName(); if (ObjOrErr) { @@ -2511,7 +2511,7 @@ void objdump::parseInputMachO(MachOUniversalBinary *UB) { E = UB->end_objects(); I != E; ++I) { Expected<std::unique_ptr<ObjectFile>> ObjOrErr = I->getAsObjectFile(); - std::string ArchitectureName = ""; + std::string ArchitectureName; if (moreThanOneArch) ArchitectureName = I->getArchFlagName(); if (ObjOrErr) { diff --git a/llvm/utils/TableGen/CodeGenDAGPatterns.cpp b/llvm/utils/TableGen/CodeGenDAGPatterns.cpp index 857d7f5..1ca4a68 100644 --- a/llvm/utils/TableGen/CodeGenDAGPatterns.cpp +++ b/llvm/utils/TableGen/CodeGenDAGPatterns.cpp @@ -873,7 +873,7 @@ bool TreePredicateFn::hasPredCode() const { } std::string TreePredicateFn::getPredCode() const { - std::string Code = ""; + std::string Code; if (!isLoad() && !isStore() && !isAtomic()) { Record *MemoryVT = getMemoryVT(); diff --git a/llvm/utils/TableGen/CodeGenInstruction.cpp b/llvm/utils/TableGen/CodeGenInstruction.cpp index 1df5902..960fe08 100644 --- a/llvm/utils/TableGen/CodeGenInstruction.cpp +++ b/llvm/utils/TableGen/CodeGenInstruction.cpp @@ -472,7 +472,7 @@ HasOneImplicitDefWithKnownVT(const CodeGenTarget &TargetInfo) const { /// include text from the specified variant, returning the new string. std::string CodeGenInstruction:: FlattenAsmStringVariants(StringRef Cur, unsigned Variant) { - std::string Res = ""; + std::string Res; for (;;) { // Find the start of the next variant string. diff --git a/llvm/utils/TableGen/CodeGenMapTable.cpp b/llvm/utils/TableGen/CodeGenMapTable.cpp index ea53a2d..289a20a 100644 --- a/llvm/utils/TableGen/CodeGenMapTable.cpp +++ b/llvm/utils/TableGen/CodeGenMapTable.cpp @@ -374,7 +374,7 @@ unsigned MapTableEmitter::emitBinSearchTable(raw_ostream &OS) { for (unsigned i = 0; i < TotalNumInstr; i++) { Record *CurInstr = NumberedInstructions[i]->TheDef; std::vector<Record*> ColInstrs = MapTable[CurInstr]; - std::string OutStr(""); + std::string OutStr; unsigned RelExists = 0; if (!ColInstrs.empty()) { for (unsigned j = 0; j < NumCol; j++) { diff --git a/llvm/utils/TableGen/GlobalISelEmitter.cpp b/llvm/utils/TableGen/GlobalISelEmitter.cpp index 4be5393..b238573 100644 --- a/llvm/utils/TableGen/GlobalISelEmitter.cpp +++ b/llvm/utils/TableGen/GlobalISelEmitter.cpp @@ -201,7 +201,7 @@ static Optional<LLTCodeGen> MVTToLLT(MVT::SimpleValueType SVT) { } static std::string explainPredicates(const TreePatternNode *N) { - std::string Explanation = ""; + std::string Explanation; StringRef Separator = ""; for (const TreePredicateCall &Call : N->getPredicateCalls()) { const TreePredicateFn &P = Call.Fn; @@ -305,8 +305,8 @@ static Error failedImport(const Twine &Reason) { } static Error isTrivialOperatorNode(const TreePatternNode *N) { - std::string Explanation = ""; - std::string Separator = ""; + std::string Explanation; + std::string Separator; bool HasUnsupportedPredicate = false; for (const TreePredicateCall &Call : N->getPredicateCalls()) { diff --git a/llvm/utils/TableGen/RISCVCompressInstEmitter.cpp b/llvm/utils/TableGen/RISCVCompressInstEmitter.cpp index dcca207..70f5181 100644 --- a/llvm/utils/TableGen/RISCVCompressInstEmitter.cpp +++ b/llvm/utils/TableGen/RISCVCompressInstEmitter.cpp @@ -635,10 +635,10 @@ void RISCVCompressInstEmitter::emitCompressInstEmitter(raw_ostream &o, return; } - std::string CaseString(""); + std::string CaseString; raw_string_ostream CaseStream(CaseString); - std::string PrevOp(""); - std::string CurOp(""); + std::string PrevOp; + std::string CurOp; CaseStream << " switch (MI.getOpcode()) {\n"; CaseStream << " default: return false;\n"; |