From dacf110f4f61bb9122ec663751f13b65ec33f6a0 Mon Sep 17 00:00:00 2001 From: Sebastian Neubauer Date: Mon, 23 Jun 2025 16:58:21 +0200 Subject: [PATCH] Fix compiler namespace warnings and deprecated getValues Fix warnings by using an anonymous namespace instead of `static` and by replacing deprecated `getValues` with `getElements`. --- lib/TableGen/Common.cpp | 4 +++- lib/TableGen/Operations.cpp | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/TableGen/Common.cpp b/lib/TableGen/Common.cpp index c033aba..45ceb09 100644 --- a/lib/TableGen/Common.cpp +++ b/lib/TableGen/Common.cpp @@ -28,10 +28,12 @@ using namespace llvm_dialects; using namespace llvm; -static cl::opt +namespace { +cl::opt g_emitComments("emit-comments", cl::desc("emit debug comments in generated source files"), cl::Hidden, cl::init(false)); +} // namespace void llvm_dialects::emitHeader(raw_ostream& out) { out << "// DO NOT EDIT! This file is automatically generated by llvm-dialects-tblgen.\n\n"; diff --git a/lib/TableGen/Operations.cpp b/lib/TableGen/Operations.cpp index 0350219..ce8c886 100644 --- a/lib/TableGen/Operations.cpp +++ b/lib/TableGen/Operations.cpp @@ -322,7 +322,7 @@ void OperationBase::parseValueTraits(raw_ostream &errs, RecordTy *record, } const ListInit *List = record->getValueAsListInit("value_traits"); - for (const Init *I : List->getValues()) { + for (const Init *I : List->getElements()) { if (const DagInit *DI = dyn_cast(I)) { if (DI->getNumArgs() != 1) { errs << "value_traits " << *DI << " is missing argument name";