[PATCH 64/79] Fix SourceContinued translation and clang-format/tidy warnings
authorMaksimova, Viktoria <viktoria.maksimova@intel.com>
Mon, 19 Jun 2023 16:35:45 +0000 (09:35 -0700)
committerAndreas Beckmann <anbe@debian.org>
Thu, 8 Feb 2024 21:48:18 +0000 (22:48 +0100)
Gbp-Pq: Name 0064-Fix-SourceContinued-translation-and-clang-format-tid.patch

lib/SPIRV/SPIRVReader.cpp
lib/SPIRV/SPIRVToLLVMDbgTran.cpp
lib/SPIRV/SPIRVToLLVMDbgTran.h

index a3e7c946df29b6ff2ed679a7610ba8fd1b56ab21..d28f109011d705f10a843828170f8903284b0034 100644 (file)
@@ -3337,7 +3337,7 @@ bool SPIRVToLLVM::translate() {
   }
 
   for (unsigned I = 0, E = BM->getNumVariables(); I != E; ++I) {
-    auto BV = BM->getVariable(I);
+    auto *BV = BM->getVariable(I);
     if (BV->getStorageClass() != StorageClassFunction)
       transValue(BV, nullptr, nullptr);
     else
index a50b42266ebda23b6cca0e6e9edb360cc3f5d884..6cba6b39513c7e8edb2c03a4862ffa905fa3e64f 100644 (file)
@@ -141,11 +141,11 @@ const std::string &SPIRVToLLVMDbgTran::getString(const SPIRVId Id) {
   return String->getStr();
 }
 
-const std::string
+Optional<std::string>
 SPIRVToLLVMDbgTran::getStringSourceContinued(const SPIRVId Id,
                                              SPIRVExtInst *DebugInst) {
   if (!isValidId(Id) || getDbgInst<SPIRVDebug::DebugInfoNone>(Id))
-    return "";
+    return {};
   std::string Str = BM->get<SPIRVString>(Id)->getStr();
   using namespace SPIRVDebug::Operand::SourceContinued;
   for (auto *I : DebugInst->getContinuedInstructions()) {
index b166abc95f496778f11adad57ed3328a063c2c76..86cf6da791a22a1b5965ad227a8b5a024121817b 100644 (file)
@@ -90,10 +90,9 @@ public:
 private:
   DIFile *getFile(const SPIRVId SourceId);
 
-  DIFile *
-  getDIFile(const std::string &FileName,
-            Optional<DIFile::ChecksumInfo<StringRef>> CS = None,
-            Optional<std::string> Source = None);
+  DIFile *getDIFile(const std::string &FileName,
+                    Optional<DIFile::ChecksumInfo<StringRef>> CS = None,
+                    Optional<std::string> Source = None);
   DIFile *getDIFile(const SPIRVEntry *E);
   unsigned getLineNo(const SPIRVEntry *E);
 
@@ -206,8 +205,8 @@ private:
     return nullptr;
   }
   const std::string &getString(const SPIRVId Id);
-  const std::string getStringSourceContinued(const SPIRVId Id,
-                                             SPIRVExtInst *DebugInst);
+  Optional<std::string> getStringSourceContinued(const SPIRVId Id,
+                                                 SPIRVExtInst *DebugInst);
   SPIRVWord getConstantValueOrLiteral(const std::vector<SPIRVWord> &,
                                       const SPIRVWord,
                                       const SPIRVExtInstSetKind);