Skip to content

Commit dacf110

Browse files
committed
Fix compiler namespace warnings and deprecated getValues
Fix warnings by using an anonymous namespace instead of `static` and by replacing deprecated `getValues` with `getElements`.
1 parent c0609a6 commit dacf110

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

lib/TableGen/Common.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,12 @@
2828
using namespace llvm_dialects;
2929
using namespace llvm;
3030

31-
static cl::opt<bool>
31+
namespace {
32+
cl::opt<bool>
3233
g_emitComments("emit-comments",
3334
cl::desc("emit debug comments in generated source files"),
3435
cl::Hidden, cl::init(false));
36+
} // namespace
3537

3638
void llvm_dialects::emitHeader(raw_ostream& out) {
3739
out << "// DO NOT EDIT! This file is automatically generated by llvm-dialects-tblgen.\n\n";

lib/TableGen/Operations.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ void OperationBase::parseValueTraits(raw_ostream &errs, RecordTy *record,
322322
}
323323

324324
const ListInit *List = record->getValueAsListInit("value_traits");
325-
for (const Init *I : List->getValues()) {
325+
for (const Init *I : List->getElements()) {
326326
if (const DagInit *DI = dyn_cast<DagInit>(I)) {
327327
if (DI->getNumArgs() != 1) {
328328
errs << "value_traits " << *DI << " is missing argument name";

0 commit comments

Comments
 (0)