From: Maksimova, Viktoria Date: Mon, 19 Jun 2023 16:35:45 +0000 (-0700) Subject: [PATCH 64/79] Fix SourceContinued translation and clang-format/tidy warnings X-Git-Tag: archive/raspbian/15.0.0-6+rpi1^2~17 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=45e639d3c75ca295f38526b9093e90e5bbd4e8ee;p=spirv-llvm-translator-15.git [PATCH 64/79] Fix SourceContinued translation and clang-format/tidy warnings Gbp-Pq: Name 0064-Fix-SourceContinued-translation-and-clang-format-tid.patch --- diff --git a/lib/SPIRV/SPIRVReader.cpp b/lib/SPIRV/SPIRVReader.cpp index a3e7c94..d28f109 100644 --- a/lib/SPIRV/SPIRVReader.cpp +++ b/lib/SPIRV/SPIRVReader.cpp @@ -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 diff --git a/lib/SPIRV/SPIRVToLLVMDbgTran.cpp b/lib/SPIRV/SPIRVToLLVMDbgTran.cpp index a50b422..6cba6b3 100644 --- a/lib/SPIRV/SPIRVToLLVMDbgTran.cpp +++ b/lib/SPIRV/SPIRVToLLVMDbgTran.cpp @@ -141,11 +141,11 @@ const std::string &SPIRVToLLVMDbgTran::getString(const SPIRVId Id) { return String->getStr(); } -const std::string +Optional SPIRVToLLVMDbgTran::getStringSourceContinued(const SPIRVId Id, SPIRVExtInst *DebugInst) { if (!isValidId(Id) || getDbgInst(Id)) - return ""; + return {}; std::string Str = BM->get(Id)->getStr(); using namespace SPIRVDebug::Operand::SourceContinued; for (auto *I : DebugInst->getContinuedInstructions()) { diff --git a/lib/SPIRV/SPIRVToLLVMDbgTran.h b/lib/SPIRV/SPIRVToLLVMDbgTran.h index b166abc..86cf6da 100644 --- a/lib/SPIRV/SPIRVToLLVMDbgTran.h +++ b/lib/SPIRV/SPIRVToLLVMDbgTran.h @@ -90,10 +90,9 @@ public: private: DIFile *getFile(const SPIRVId SourceId); - DIFile * - getDIFile(const std::string &FileName, - Optional> CS = None, - Optional Source = None); + DIFile *getDIFile(const std::string &FileName, + Optional> CS = None, + Optional 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 getStringSourceContinued(const SPIRVId Id, + SPIRVExtInst *DebugInst); SPIRVWord getConstantValueOrLiteral(const std::vector &, const SPIRVWord, const SPIRVExtInstSetKind);