https://github.com/philnik777 updated https://github.com/llvm/llvm-project/pull/204994
>From 960c7f34d01a3834670264bc215dd1a7b293c2f6 Mon Sep 17 00:00:00 2001 From: Nikolas Klauser <[email protected]> Date: Sun, 21 Jun 2026 19:54:52 +0200 Subject: [PATCH 1/4] Remove unused variable throughout the monorepo --- clang-tools-extra/clangd/IncludeFixer.cpp | 7 ------- clang-tools-extra/modularize/PreprocessorTracker.cpp | 3 --- clang/lib/Driver/ToolChains/Hexagon.cpp | 1 - .../Checkers/StdLibraryFunctionsChecker.cpp | 4 ---- clang/unittests/AST/ASTImporterFixtures.cpp | 2 -- clang/unittests/Interpreter/CodeCompletionTest.cpp | 1 - clang/unittests/Tooling/HeaderIncludesTest.cpp | 1 - lldb/source/Commands/CommandObjectCommands.cpp | 3 --- lldb/source/Commands/CommandObjectHelp.cpp | 1 - lldb/source/Interpreter/CommandInterpreter.cpp | 3 --- .../Hexagon-DYLD/HexagonDYLDRendezvous.cpp | 2 -- .../DynamicLoader/POSIX-DYLD/DYLDRendezvous.cpp | 2 -- .../GDBRemoteCommunicationServerPlatform.cpp | 5 +---- lldb/source/Plugins/Protocol/MCP/ProtocolServerMCP.cpp | 2 -- lldb/source/Target/StackFrameList.cpp | 1 - lldb/tools/yaml2macho-core/yaml2macho.cpp | 2 -- .../Orc/TargetProcess/SimpleRemoteEPCServer.h | 1 - llvm/include/llvm/ExecutionEngine/Orc/TaskDispatch.h | 4 ++-- llvm/lib/DWARFCFIChecker/DWARFCFIState.cpp | 2 +- llvm/tools/llvm-libtool-darwin/llvm-libtool-darwin.cpp | 4 ---- llvm/tools/llvm-rc/ResourceScriptParser.cpp | 3 +-- llvm/tools/llvm-rc/ResourceScriptParser.h | 1 - llvm/tools/sancov/sancov.cpp | 1 - llvm/unittests/ADT/STLExtrasTest.cpp | 4 ++-- llvm/unittests/CodeGen/PassManagerTest.cpp | 1 - llvm/unittests/TextAPI/TextStubV3Tests.cpp | 10 +--------- llvm/unittests/TextAPI/TextStubV4Tests.cpp | 4 ---- .../Dialect/OpenMP/OpenMPToLLVMIRTranslation.cpp | 1 - mlir/tools/mlir-tblgen/OpDefinitionsGen.cpp | 1 - 29 files changed, 8 insertions(+), 69 deletions(-) diff --git a/clang-tools-extra/clangd/IncludeFixer.cpp b/clang-tools-extra/clangd/IncludeFixer.cpp index 3f3d7fbefd58e..5ecf853524a3f 100644 --- a/clang-tools-extra/clangd/IncludeFixer.cpp +++ b/clang-tools-extra/clangd/IncludeFixer.cpp @@ -613,13 +613,6 @@ IncludeFixer::lookupCached(const SymbolID &ID) const { Index.lookup(Req, [&](const Symbol &Sym) { Matches.insert(Sym); }); auto Syms = std::move(Matches).build(); - std::vector<Fix> Fixes; - if (!Syms.empty()) { - auto &Matched = *Syms.begin(); - if (!Matched.IncludeHeaders.empty() && Matched.Definition && - Matched.CanonicalDeclaration.FileURI == Matched.Definition.FileURI) - Fixes = fixesForSymbols(Syms); - } auto E = LookupCache.try_emplace(ID, std::move(Syms)); return &E.first->second; } diff --git a/clang-tools-extra/modularize/PreprocessorTracker.cpp b/clang-tools-extra/modularize/PreprocessorTracker.cpp index 04abb2733f5a7..6205b97a17176 100644 --- a/clang-tools-extra/modularize/PreprocessorTracker.cpp +++ b/clang-tools-extra/modularize/PreprocessorTracker.cpp @@ -1078,9 +1078,6 @@ class PreprocessorTrackerImpl : public PreprocessorTracker { auto I = ConditionalExpansions.find(InstanceKey); // If existing instance of condition not found, add one. if (I == ConditionalExpansions.end()) { - std::string InstanceSourceLine = - getSourceLocationString(PP, InstanceLoc) + ":\n" + - getSourceLine(PP, InstanceLoc) + "\n"; ConditionalExpansions[InstanceKey] = ConditionalTracker(DirectiveKind, ConditionValue, ConditionUnexpandedHandle, InclusionPathHandle); diff --git a/clang/lib/Driver/ToolChains/Hexagon.cpp b/clang/lib/Driver/ToolChains/Hexagon.cpp index ab207317667c6..b890431ef7f6c 100644 --- a/clang/lib/Driver/ToolChains/Hexagon.cpp +++ b/clang/lib/Driver/ToolChains/Hexagon.cpp @@ -534,7 +534,6 @@ void hexagon::Linker::ConstructJob(Compilation &C, const JobAction &JA, std::string HexagonToolChain::getHexagonTargetDir( const std::string &InstalledDir, const SmallVectorImpl<std::string> &PrefixDirs) const { - std::string InstallRelDir; const Driver &D = getDriver(); // Locate the rest of the toolchain ... diff --git a/clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp b/clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp index 50b34cb181ca5..4fe3e1f7623f6 100644 --- a/clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp +++ b/clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp @@ -2149,8 +2149,6 @@ void StdLibraryFunctionsChecker::initFunctionSummaries( ErrnoIrrelevant) .ArgConstraint(NotNull(ArgNo(0)))); } else { - const auto ReturnsZeroOrMinusOne = - ConstraintSet{ReturnValueCondition(WithinRange, Range(-1, 0))}; const auto ReturnsZero = ConstraintSet{ReturnValueCondition(WithinRange, SingleValue(0))}; const auto ReturnsMinusOne = @@ -2161,8 +2159,6 @@ void StdLibraryFunctionsChecker::initFunctionSummaries( ConstraintSet{ReturnValueCondition(WithinRange, Range(0, IntMax))}; const auto ReturnsNonZero = ConstraintSet{ReturnValueCondition(OutOfRange, SingleValue(0))}; - const auto ReturnsFileDescriptor = - ConstraintSet{ReturnValueCondition(WithinRange, Range(-1, IntMax))}; const auto &ReturnsValidFileDescriptor = ReturnsNonnegative; auto ValidFileDescriptorOrAtFdcwd = [&](ArgNo ArgN) { diff --git a/clang/unittests/AST/ASTImporterFixtures.cpp b/clang/unittests/AST/ASTImporterFixtures.cpp index e4e5a078262c3..48421fe90a431 100644 --- a/clang/unittests/AST/ASTImporterFixtures.cpp +++ b/clang/unittests/AST/ASTImporterFixtures.cpp @@ -142,7 +142,6 @@ std::tuple<Decl *, Decl *> ASTImporterTestBase::getImportedDecl( StringRef FromSrcCode, TestLanguage FromLang, StringRef ToSrcCode, TestLanguage ToLang, StringRef Identifier) { std::vector<std::string> FromArgs = getCommandLineArgsForLanguage(FromLang); - std::vector<std::string> ToArgs = getCommandLineArgsForLanguage(ToLang); FromTUs.emplace_back(FromSrcCode, InputFileName, FromArgs, Creator, ODRHandling); @@ -185,7 +184,6 @@ TranslationUnitDecl *ASTImporterTestBase::getTuDecl(StringRef SrcCode, TranslationUnitDecl *ASTImporterTestBase::getToTuDecl(StringRef ToSrcCode, TestLanguage ToLang) { - std::vector<std::string> ToArgs = getCommandLineArgsForLanguage(ToLang); assert(!ToAST); lazyInitToAST(ToLang, ToSrcCode, OutputFileName); return ToAST->getASTContext().getTranslationUnitDecl(); diff --git a/clang/unittests/Interpreter/CodeCompletionTest.cpp b/clang/unittests/Interpreter/CodeCompletionTest.cpp index ceb683497ac74..5c6047f294721 100644 --- a/clang/unittests/Interpreter/CodeCompletionTest.cpp +++ b/clang/unittests/Interpreter/CodeCompletionTest.cpp @@ -98,7 +98,6 @@ TEST_F(CodeCompletionTest, TwoDecls) { TEST_F(CodeCompletionTest, CompFunDeclsNoError) { auto Err = llvm::Error::success(); - auto comps = runComp("void app(", Err); EXPECT_EQ((bool)Err, false); } diff --git a/clang/unittests/Tooling/HeaderIncludesTest.cpp b/clang/unittests/Tooling/HeaderIncludesTest.cpp index 8259394cb30bc..95fb05885a0b9 100644 --- a/clang/unittests/Tooling/HeaderIncludesTest.cpp +++ b/clang/unittests/Tooling/HeaderIncludesTest.cpp @@ -678,7 +678,6 @@ int main() { std::vector<int> ints {}; })cpp"; - auto InsertedCode = insert(Code, "<vector>"); EXPECT_EQ(Expected, insert(Code, "<vector>")); } diff --git a/lldb/source/Commands/CommandObjectCommands.cpp b/lldb/source/Commands/CommandObjectCommands.cpp index 84e661ec01f53..8f006768ecc9a 100644 --- a/lldb/source/Commands/CommandObjectCommands.cpp +++ b/lldb/source/Commands/CommandObjectCommands.cpp @@ -627,7 +627,6 @@ class CommandObjectCommandsUnalias : public CommandObjectParsed { protected: void DoExecute(Args &args, CommandReturnObject &result) override { - CommandObject::CommandMap::iterator pos; CommandObject *cmd_obj; if (args.empty()) { @@ -702,8 +701,6 @@ class CommandObjectCommandsDelete : public CommandObjectParsed { protected: void DoExecute(Args &args, CommandReturnObject &result) override { - CommandObject::CommandMap::iterator pos; - if (args.empty()) { result.AppendErrorWithFormat("must call '%s' with one or more valid user " "defined regular expression command names", diff --git a/lldb/source/Commands/CommandObjectHelp.cpp b/lldb/source/Commands/CommandObjectHelp.cpp index a29ded846b100..c96c5158c06f6 100644 --- a/lldb/source/Commands/CommandObjectHelp.cpp +++ b/lldb/source/Commands/CommandObjectHelp.cpp @@ -64,7 +64,6 @@ CommandObjectHelp::CommandOptions::GetDefinitions() { } void CommandObjectHelp::DoExecute(Args &command, CommandReturnObject &result) { - CommandObject::CommandMap::iterator pos; CommandObject *cmd_obj; const size_t argc = command.GetArgumentCount(); diff --git a/lldb/source/Interpreter/CommandInterpreter.cpp b/lldb/source/Interpreter/CommandInterpreter.cpp index 0c5456c2c3b57..a35baa7fd6d27 100644 --- a/lldb/source/Interpreter/CommandInterpreter.cpp +++ b/lldb/source/Interpreter/CommandInterpreter.cpp @@ -2962,7 +2962,6 @@ void CommandInterpreter::HandleCommandsFromFile( auto input_file_up = FileSystem::Instance().Open(cmd_file, File::eOpenOptionReadOnly); if (!input_file_up) { - std::string error = llvm::toString(input_file_up.takeError()); result.AppendErrorWithFormatv( "error: an error occurred read file '{0}': {1}\n", cmd_file_path, llvm::fmt_consume(input_file_up.takeError())); @@ -3263,8 +3262,6 @@ void CommandInterpreter::FindCommandsForApropos(llvm::StringRef search_word, bool search_user_commands, bool search_alias_commands, bool search_user_mw_commands) { - CommandObject::CommandMap::const_iterator pos; - if (search_builtin_commands) FindCommandsForApropos(search_word, commands_found, commands_help, m_command_dict); diff --git a/lldb/source/Plugins/DynamicLoader/Hexagon-DYLD/HexagonDYLDRendezvous.cpp b/lldb/source/Plugins/DynamicLoader/Hexagon-DYLD/HexagonDYLDRendezvous.cpp index 62c0fb0ff4eb8..7b5bcc2567dda 100644 --- a/lldb/source/Plugins/DynamicLoader/Hexagon-DYLD/HexagonDYLDRendezvous.cpp +++ b/lldb/source/Plugins/DynamicLoader/Hexagon-DYLD/HexagonDYLDRendezvous.cpp @@ -148,7 +148,6 @@ bool HexagonDYLDRendezvous::UpdateSOEntries() { bool HexagonDYLDRendezvous::UpdateSOEntriesForAddition() { SOEntry entry; - iterator pos; assert(m_previous.state == eAdd); @@ -176,7 +175,6 @@ bool HexagonDYLDRendezvous::UpdateSOEntriesForAddition() { bool HexagonDYLDRendezvous::UpdateSOEntriesForDeletion() { SOEntryList entry_list; - iterator pos; assert(m_previous.state == eDelete); diff --git a/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DYLDRendezvous.cpp b/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DYLDRendezvous.cpp index c2084e0322c1f..2d0eef666f688 100644 --- a/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DYLDRendezvous.cpp +++ b/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DYLDRendezvous.cpp @@ -497,7 +497,6 @@ bool DYLDRendezvous::RemoveSOEntriesFromRemote( bool DYLDRendezvous::AddSOEntries() { SOEntry entry; - iterator pos; assert(m_previous.state == eAdd); @@ -525,7 +524,6 @@ bool DYLDRendezvous::AddSOEntries() { bool DYLDRendezvous::RemoveSOEntries() { SOEntryList entry_list; - iterator pos; assert(m_previous.state == eDelete); diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerPlatform.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerPlatform.cpp index 5876c3a9434a1..eaed4e6742824 100644 --- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerPlatform.cpp +++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerPlatform.cpp @@ -156,15 +156,12 @@ GDBRemoteCommunicationServerPlatform::Handle_qLaunchGDBServer( __FUNCTION__); ConnectionFileDescriptor file_conn; - std::string hostname; packet.SetFilePos(::strlen("qLaunchGDBServer;")); llvm::StringRef name; llvm::StringRef value; std::optional<uint16_t> port; while (packet.GetNameColonValue(name, value)) { - if (name == "host") - hostname = std::string(value); - else if (name == "port") { + if (name == "port") { // Make the Optional valid so we can use its value port = 0; value.getAsInteger(0, *port); diff --git a/lldb/source/Plugins/Protocol/MCP/ProtocolServerMCP.cpp b/lldb/source/Plugins/Protocol/MCP/ProtocolServerMCP.cpp index c92f80bc166b7..96d6910ce5ce5 100644 --- a/lldb/source/Plugins/Protocol/MCP/ProtocolServerMCP.cpp +++ b/lldb/source/Plugins/Protocol/MCP/ProtocolServerMCP.cpp @@ -98,8 +98,6 @@ llvm::Error ProtocolServerMCP::Start(ProtocolServer::Connection connection) { auto listening_uris = m_listener->GetListeningConnectionURI(); if (listening_uris.empty()) return createStringError("failed to get listening connections"); - std::string address = - llvm::join(m_listener->GetListeningConnectionURI(), ", "); ServerInfo info{listening_uris[0]}; llvm::Expected<ServerInfoHandle> server_info_handle = ServerInfo::Write(info); diff --git a/lldb/source/Target/StackFrameList.cpp b/lldb/source/Target/StackFrameList.cpp index f23261d50ed4b..01ce5870a6edb 100644 --- a/lldb/source/Target/StackFrameList.cpp +++ b/lldb/source/Target/StackFrameList.cpp @@ -1021,7 +1021,6 @@ size_t StackFrameList::GetStatus(Stream &strm, uint32_t first_frame, StackFrameSP selected_frame_sp = m_thread.GetSelectedFrame(DoNoSelectMostRelevantFrame); - std::string buffer; std::string marker; for (frame_idx = first_frame; frame_idx < last_frame; ++frame_idx) { frame_sp = GetFrameAtIndex(frame_idx); diff --git a/lldb/tools/yaml2macho-core/yaml2macho.cpp b/lldb/tools/yaml2macho-core/yaml2macho.cpp index c29ae282d8571..cd51d228ff062 100644 --- a/lldb/tools/yaml2macho-core/yaml2macho.cpp +++ b/lldb/tools/yaml2macho-core/yaml2macho.cpp @@ -176,7 +176,6 @@ int main(int argc, char **argv) { if (spec.binaries.size() > 0) for (const Binary &binary : spec.binaries) { std::vector<uint8_t> segment_command_bytes; - std::vector<uint8_t> payload_bytes; create_lc_note_binary_load_cmd(spec, segment_command_bytes, binary, lc_note_payload_bytes, payload_fileoff); payload_fileoff = @@ -185,7 +184,6 @@ int main(int argc, char **argv) { } if (spec.addressable_bits) { std::vector<uint8_t> segment_command_bytes; - std::vector<uint8_t> payload_bytes; create_lc_note_addressable_bits(spec, segment_command_bytes, *spec.addressable_bits, lc_note_payload_bytes, payload_fileoff); diff --git a/llvm/include/llvm/ExecutionEngine/Orc/TargetProcess/SimpleRemoteEPCServer.h b/llvm/include/llvm/ExecutionEngine/Orc/TargetProcess/SimpleRemoteEPCServer.h index e5d28345bb84e..0aa040bc00138 100644 --- a/llvm/include/llvm/ExecutionEngine/Orc/TargetProcess/SimpleRemoteEPCServer.h +++ b/llvm/include/llvm/ExecutionEngine/Orc/TargetProcess/SimpleRemoteEPCServer.h @@ -188,7 +188,6 @@ class LLVM_ABI SimpleRemoteEPCServer : public SimpleRemoteEPCTransportClient { uint64_t NextSeqNo = 0; PendingJITDispatchResultsMap PendingJITDispatchResults; - std::vector<sys::DynamicLibrary> Dylibs; }; } // end namespace orc diff --git a/llvm/include/llvm/ExecutionEngine/Orc/TaskDispatch.h b/llvm/include/llvm/ExecutionEngine/Orc/TaskDispatch.h index b73da194cd187..9836b7d26a871 100644 --- a/llvm/include/llvm/ExecutionEngine/Orc/TaskDispatch.h +++ b/llvm/include/llvm/ExecutionEngine/Orc/TaskDispatch.h @@ -59,9 +59,9 @@ class GenericNamedTask : public RTTIExtends<GenericNamedTask, Task> { /// Generic task implementation. template <typename FnT> class GenericNamedTaskImpl : public GenericNamedTask { public: - GenericNamedTaskImpl(FnT &&Fn, std::string DescBuffer) + GenericNamedTaskImpl(FnT &&Fn, std::string InDescBuffer) : Fn(std::forward<FnT>(Fn)), Desc(DescBuffer.c_str()), - DescBuffer(std::move(DescBuffer)) {} + DescBuffer(std::move(InDescBuffer)) {} GenericNamedTaskImpl(FnT &&Fn, const char *Desc) : Fn(std::forward<FnT>(Fn)), Desc(Desc) { assert(Desc && "Description cannot be null"); diff --git a/llvm/lib/DWARFCFIChecker/DWARFCFIState.cpp b/llvm/lib/DWARFCFIChecker/DWARFCFIState.cpp index 2c0eeac0089ae..606f5a520fd7d 100644 --- a/llvm/lib/DWARFCFIChecker/DWARFCFIState.cpp +++ b/llvm/lib/DWARFCFIChecker/DWARFCFIState.cpp @@ -36,7 +36,7 @@ void DWARFCFIState::update(const MCCFIInstruction &Directive) { // updated row and following the previous rows. These middle rows are stored // in `PrecedingRows`. For now, there is no need to store these rows in the // state, so they are ignored in the end. - dwarf::UnwindTable::RowContainer PrecedingRows; + // dwarf::UnwindTable::RowContainer PrecedingRows; // TODO: `.cfi_remember_state` and `.cfi_restore_state` directives are not // supported yet. The reason is that `parseRows` expects the stack of states diff --git a/llvm/tools/llvm-libtool-darwin/llvm-libtool-darwin.cpp b/llvm/tools/llvm-libtool-darwin/llvm-libtool-darwin.cpp index 4165274a6f8bd..d1c0022f71dcc 100644 --- a/llvm/tools/llvm-libtool-darwin/llvm-libtool-darwin.cpp +++ b/llvm/tools/llvm-libtool-darwin/llvm-libtool-darwin.cpp @@ -88,7 +88,6 @@ static std::string DependencyInfoPath; static bool VersionOption; static bool NoWarningForNoSymbols; static bool WarningsAsErrors; -static std::string IgnoredSyslibRoot; static const std::array<std::string, 3> StandardSearchDirs{ "/lib", @@ -659,9 +658,6 @@ static void parseRawArgs(int Argc, char **Argv) { if (const opt::Arg *A = Args.getLastArg(OPT_dependencyInfoPath)) DependencyInfoPath = A->getValue(); - if (const opt::Arg *A = Args.getLastArg(OPT_ignoredSyslibRoot)) - IgnoredSyslibRoot = A->getValue(); - LibraryOperation = Args.hasArg(OPT_static) ? Operation::Static : Operation::None; DeterministicOption = Args.hasArg(OPT_deterministicOption); diff --git a/llvm/tools/llvm-rc/ResourceScriptParser.cpp b/llvm/tools/llvm-rc/ResourceScriptParser.cpp index e4efc83c933b4..f28efb6de611e 100644 --- a/llvm/tools/llvm-rc/ResourceScriptParser.cpp +++ b/llvm/tools/llvm-rc/ResourceScriptParser.cpp @@ -33,8 +33,7 @@ namespace llvm { namespace rc { RCParser::ParserError::ParserError(const Twine &Expected, const LocIter CurLoc, - const LocIter End) - : ErrorLoc(CurLoc), FileEnd(End) { + const LocIter End) { CurMessage = "Error parsing file: expected " + Expected.str() + ", got " + (CurLoc == End ? "<EOF>" : CurLoc->value()).str(); } diff --git a/llvm/tools/llvm-rc/ResourceScriptParser.h b/llvm/tools/llvm-rc/ResourceScriptParser.h index 1e7618c84142e..ed7a09b16834e 100644 --- a/llvm/tools/llvm-rc/ResourceScriptParser.h +++ b/llvm/tools/llvm-rc/ResourceScriptParser.h @@ -48,7 +48,6 @@ class RCParser { private: std::string CurMessage; - LocIter ErrorLoc, FileEnd; }; explicit RCParser(std::vector<RCToken> TokenList); diff --git a/llvm/tools/sancov/sancov.cpp b/llvm/tools/sancov/sancov.cpp index 483e6d7d58d68..d6fdac2583d5d 100644 --- a/llvm/tools/sancov/sancov.cpp +++ b/llvm/tools/sancov/sancov.cpp @@ -987,7 +987,6 @@ computeNotCoveredFunctions(const SymbolizedCoverage &Coverage) { static std::set<FileFn> computeCoveredFunctions(const SymbolizedCoverage &Coverage) { - auto AllFns = computeFunctions(Coverage.Points); std::set<FileFn> Result; for (const auto &Point : Coverage.Points) { diff --git a/llvm/unittests/ADT/STLExtrasTest.cpp b/llvm/unittests/ADT/STLExtrasTest.cpp index 2f1e01d16e3c5..00c062ae1ca29 100644 --- a/llvm/unittests/ADT/STLExtrasTest.cpp +++ b/llvm/unittests/ADT/STLExtrasTest.cpp @@ -1170,7 +1170,7 @@ TEST(STLExtrasTest, getSingleElement) { } TEST(STLExtrasTest, hasNItems) { - const std::list<int> V0 = {}, V1 = {1}, V2 = {1, 2}; + const std::list<int> V0 = {}, V1 = {1}; const std::list<int> V3 = {1, 3, 5}; EXPECT_TRUE(hasNItems(V0, 0)); @@ -1191,7 +1191,7 @@ TEST(STLExtrasTest, hasNItems) { } TEST(STLExtras, hasNItemsOrMore) { - const std::list<int> V0 = {}, V1 = {1}, V2 = {1, 2}; + const std::list<int> V1 = {1}, V2 = {1, 2}; const std::list<int> V3 = {1, 3, 5}; EXPECT_TRUE(hasNItemsOrMore(V1, 1)); diff --git a/llvm/unittests/CodeGen/PassManagerTest.cpp b/llvm/unittests/CodeGen/PassManagerTest.cpp index dc83effd3c1e1..dc42b7a0854d3 100644 --- a/llvm/unittests/CodeGen/PassManagerTest.cpp +++ b/llvm/unittests/CodeGen/PassManagerTest.cpp @@ -218,7 +218,6 @@ TEST_F(PassManagerTest, Basic) { testing::internal::CaptureStderr(); MPM.run(*M, MAM); - std::string Output = testing::internal::GetCapturedStderr(); EXPECT_EQ((std::vector<int>{10, 16, 18, 20, 30, 36, 38, 40}), Counts); EXPECT_EQ(40, Count); diff --git a/llvm/unittests/TextAPI/TextStubV3Tests.cpp b/llvm/unittests/TextAPI/TextStubV3Tests.cpp index 3c822b2188a41..19624c9dc2abb 100644 --- a/llvm/unittests/TextAPI/TextStubV3Tests.cpp +++ b/llvm/unittests/TextAPI/TextStubV3Tests.cpp @@ -81,10 +81,6 @@ TEST(TBDv3, ReadFile) { for (auto &&arch : Archs) Targets.emplace_back(Target(arch, Platform)); EXPECT_EQ(Archs, File->getArchitectures()); - TargetToAttr Uuids = {{Target(AK_armv7, PLATFORM_UNKNOWN), - "00000000-0000-0000-0000-000000000000"}, - {Target(AK_arm64, PLATFORM_UNKNOWN), - "11111111-1111-1111-1111-111111111111"}}; EXPECT_EQ(File->getPlatforms().size(), 1U); EXPECT_EQ(Platform, *File->getPlatforms().begin()); EXPECT_EQ(std::string("Test.dylib"), File->getInstallName()); @@ -165,10 +161,6 @@ TEST(TBDv3, ReadMultipleDocuments) { for (auto &&arch : Archs) Targets.emplace_back(Target(arch, Platform)); EXPECT_EQ(Archs, File->getArchitectures()); - TargetToAttr Uuids = {{Target(AK_armv7, PLATFORM_UNKNOWN), - "00000000-0000-0000-0000-000000000000"}, - {Target(AK_arm64, PLATFORM_UNKNOWN), - "11111111-1111-1111-1111-111111111111"}}; EXPECT_EQ(File->getPlatforms().size(), 1U); EXPECT_EQ(Platform, *File->getPlatforms().begin()); EXPECT_EQ(std::string("Test.dylib"), File->getInstallName()); @@ -358,7 +350,7 @@ TEST(TBDv3, WriteMultipleDocuments) { Document.addSymbol(EncodeKind::GlobalSymbol, "_sym3", Targets); Document.addSymbol(EncodeKind::GlobalSymbol, "_sym4", Targets); File.addDocument(std::make_shared<InterfaceFile>(std::move(Document))); - + SmallString<4096> Buffer; raw_svector_ostream OS(Buffer); Error Result = TextAPIWriter::writeToStream(OS, File); diff --git a/llvm/unittests/TextAPI/TextStubV4Tests.cpp b/llvm/unittests/TextAPI/TextStubV4Tests.cpp index 3f9d8d9b7deaa..11c485198b704 100644 --- a/llvm/unittests/TextAPI/TextStubV4Tests.cpp +++ b/llvm/unittests/TextAPI/TextStubV4Tests.cpp @@ -394,8 +394,6 @@ TEST(TBDv4, WriteMultipleDocuments) { Target(AK_i386, Platform), Target(AK_x86_64, Platform), }; - TargetToAttr Uuids = {{Targets[0], "00000000-0000-0000-0000-000000000002"}, - {Targets[1], "11111111-1111-1111-1111-111111111112"}}; File.setInstallName("/System/Library/Frameworks/Umbrella.framework/Umbrella"); File.setFileType(FileType::TBD_V4); File.addTargets(Targets); @@ -409,8 +407,6 @@ TEST(TBDv4, WriteMultipleDocuments) { Targets[1]); // Write Second Document - Uuids = {{Targets[0], "00000000-0000-0000-0000-000000000000"}, - {Targets[1], "11111111-1111-1111-1111-111111111111"}}; InterfaceFile Document; Document.setInstallName("/System/Library/Frameworks/A.framework/A"); Document.setFileType(FileType::TBD_V4); diff --git a/mlir/lib/Target/LLVMIR/Dialect/OpenMP/OpenMPToLLVMIRTranslation.cpp b/mlir/lib/Target/LLVMIR/Dialect/OpenMP/OpenMPToLLVMIRTranslation.cpp index 703f72d1ab5bc..70f4703cc5386 100644 --- a/mlir/lib/Target/LLVMIR/Dialect/OpenMP/OpenMPToLLVMIRTranslation.cpp +++ b/mlir/lib/Target/LLVMIR/Dialect/OpenMP/OpenMPToLLVMIRTranslation.cpp @@ -6546,7 +6546,6 @@ calculateBoundsOffset(LLVM::ModuleTranslation &moduleTranslation, // to use or standardizing/canonicalizing the order of the bounds to compute // the offset may be useful in the future when there's other frontends with // different formats. - std::vector<llvm::Value *> dimensionIndexSizeOffset; for (int i = bounds.size() - 1; i >= 0; --i) { if (auto boundOp = dyn_cast_if_present<omp::MapBoundsOp>( bounds[i].getDefiningOp())) { diff --git a/mlir/tools/mlir-tblgen/OpDefinitionsGen.cpp b/mlir/tools/mlir-tblgen/OpDefinitionsGen.cpp index 90ada40302296..ee73c9841e240 100644 --- a/mlir/tools/mlir-tblgen/OpDefinitionsGen.cpp +++ b/mlir/tools/mlir-tblgen/OpDefinitionsGen.cpp @@ -3429,7 +3429,6 @@ void OpEmitter::genCodeForAddingArgAndRegionForBuilder( }); }; if (op.getTrait("::mlir::OpTrait::AttrSizedOperandSegments")) { - std::string sizes = op.getGetterName(operandSegmentAttrName); body << " ::llvm::copy(::llvm::ArrayRef<int32_t>({"; emitSegment(); body << "}), " << builderOpStateProperties >From a46950934266565b55ede9f4361a87a40d4923c0 Mon Sep 17 00:00:00 2001 From: Nikolas Klauser <[email protected]> Date: Tue, 23 Jun 2026 14:44:29 +0200 Subject: [PATCH 2/4] Address comment --- clang/unittests/Interpreter/CodeCompletionTest.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/clang/unittests/Interpreter/CodeCompletionTest.cpp b/clang/unittests/Interpreter/CodeCompletionTest.cpp index 5c6047f294721..fcabb28092811 100644 --- a/clang/unittests/Interpreter/CodeCompletionTest.cpp +++ b/clang/unittests/Interpreter/CodeCompletionTest.cpp @@ -98,6 +98,7 @@ TEST_F(CodeCompletionTest, TwoDecls) { TEST_F(CodeCompletionTest, CompFunDeclsNoError) { auto Err = llvm::Error::success(); + runComp("void app(", Err); EXPECT_EQ((bool)Err, false); } >From 2ddfd7eb73e9ed5b225aec961fbeb2679c4b67cb Mon Sep 17 00:00:00 2001 From: Nikolas Klauser <[email protected]> Date: Tue, 23 Jun 2026 16:20:04 +0200 Subject: [PATCH 3/4] Address comment --- llvm/include/llvm/ExecutionEngine/Orc/TaskDispatch.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/llvm/include/llvm/ExecutionEngine/Orc/TaskDispatch.h b/llvm/include/llvm/ExecutionEngine/Orc/TaskDispatch.h index 9836b7d26a871..643562616dd22 100644 --- a/llvm/include/llvm/ExecutionEngine/Orc/TaskDispatch.h +++ b/llvm/include/llvm/ExecutionEngine/Orc/TaskDispatch.h @@ -60,8 +60,8 @@ class GenericNamedTask : public RTTIExtends<GenericNamedTask, Task> { template <typename FnT> class GenericNamedTaskImpl : public GenericNamedTask { public: GenericNamedTaskImpl(FnT &&Fn, std::string InDescBuffer) - : Fn(std::forward<FnT>(Fn)), Desc(DescBuffer.c_str()), - DescBuffer(std::move(InDescBuffer)) {} + : Fn(std::forward<FnT>(Fn)), DescBuffer(std::move(InDescBuffer)), + Desc(DescBuffer.c_str()) {} GenericNamedTaskImpl(FnT &&Fn, const char *Desc) : Fn(std::forward<FnT>(Fn)), Desc(Desc) { assert(Desc && "Description cannot be null"); @@ -71,8 +71,8 @@ template <typename FnT> class GenericNamedTaskImpl : public GenericNamedTask { private: FnT Fn; - const char *Desc; std::string DescBuffer; + const char *Desc; }; /// Create a generic named task from a std::string description. >From 1e12db56a95b70a2c84b89b0fb6eb108ac70ed2d Mon Sep 17 00:00:00 2001 From: Nikolas Klauser <[email protected]> Date: Tue, 23 Jun 2026 16:24:19 +0200 Subject: [PATCH 4/4] Address comment --- llvm/unittests/CodeGen/PassManagerTest.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/llvm/unittests/CodeGen/PassManagerTest.cpp b/llvm/unittests/CodeGen/PassManagerTest.cpp index dc42b7a0854d3..f004d14b4aee4 100644 --- a/llvm/unittests/CodeGen/PassManagerTest.cpp +++ b/llvm/unittests/CodeGen/PassManagerTest.cpp @@ -218,6 +218,7 @@ TEST_F(PassManagerTest, Basic) { testing::internal::CaptureStderr(); MPM.run(*M, MAM); + testing::internal::GetCapturedStderr(); EXPECT_EQ((std::vector<int>{10, 16, 18, 20, 30, 36, 38, 40}), Counts); EXPECT_EQ(40, Count); _______________________________________________ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
