[llvm] Remove redundant string initialization (NFC)
authorKazu Hirata <kazu@google.com>
Sun, 16 Apr 2023 16:42:34 +0000 (09:42 -0700)
committerKazu Hirata <kazu@google.com>
Sun, 16 Apr 2023 16:42:34 +0000 (09:42 -0700)
Identified with readability-redundant-string-init.

llvm/include/llvm/Frontend/OpenMP/OMPIRBuilder.h
llvm/lib/DebugInfo/LogicalView/Core/LVLocation.cpp
llvm/unittests/Target/WebAssembly/WebAssemblyExceptionInfoTest.cpp

index acf91a2..f9ccad0 100644 (file)
@@ -170,8 +170,7 @@ struct TargetRegionEntryInfo {
   unsigned Line;
   unsigned Count;
 
-  TargetRegionEntryInfo()
-      : ParentName(""), DeviceID(0), FileID(0), Line(0), Count(0) {}
+  TargetRegionEntryInfo() : DeviceID(0), FileID(0), Line(0), Count(0) {}
   TargetRegionEntryInfo(StringRef ParentName, unsigned DeviceID,
                         unsigned FileID, unsigned Line, unsigned Count = 0)
       : ParentName(ParentName), DeviceID(DeviceID), FileID(FileID), Line(Line),
index e11e56c..954ac04 100644 (file)
@@ -659,7 +659,7 @@ void LVLocationSymbol::printExtra(raw_ostream &OS, bool Full) const {
   if (Full && Entries) {
     bool CodeViewLocation = getParentSymbol()->getHasCodeViewLocation();
     std::stringstream Stream;
-    std::string Leading = "";
+    std::string Leading;
     for (LVOperation *Operation : *Entries) {
       Stream << Leading
              << (CodeViewLocation ? Operation->getOperandsCodeViewInfo()
index 617ff7b..eec1cc2 100644 (file)
@@ -23,8 +23,8 @@ namespace {
 
 std::unique_ptr<LLVMTargetMachine> createTargetMachine() {
   auto TT(Triple::normalize("wasm32-unknown-unknown"));
-  std::string CPU("");
-  std::string FS("");
+  std::string CPU;
+  std::string FS;
 
   LLVMInitializeWebAssemblyTargetInfo();
   LLVMInitializeWebAssemblyTarget();