@@ -33,24 +33,23 @@ cl::opt<bool> EmitLongStrLiterals(
33
33
cl::Hidden, cl::init(true ));
34
34
} // end namespace llvm
35
35
36
- namespace {
36
+ static cl::OptionCategory PrintEnumsCat (" Options for -print-enums" );
37
+ static cl::opt<std::string> Class (" class" ,
38
+ cl::desc (" Print Enum list for this class" ),
39
+ cl::value_desc(" class name" ),
40
+ cl::cat(PrintEnumsCat));
37
41
38
- cl::OptionCategory PrintEnumsCat (" Options for -print-enums" );
39
- cl::opt<std::string> Class (" class" , cl::desc(" Print Enum list for this class" ),
40
- cl::value_desc(" class name" ),
41
- cl::cat(PrintEnumsCat));
42
-
43
- void PrintRecords (RecordKeeper &Records, raw_ostream &OS) {
42
+ static void PrintRecords (RecordKeeper &Records, raw_ostream &OS) {
44
43
OS << Records; // No argument, dump all contents
45
44
}
46
45
47
- void PrintEnums (RecordKeeper &Records, raw_ostream &OS) {
46
+ static void PrintEnums (RecordKeeper &Records, raw_ostream &OS) {
48
47
for (Record *Rec : Records.getAllDerivedDefinitions (Class))
49
48
OS << Rec->getName () << " , " ;
50
49
OS << " \n " ;
51
50
}
52
51
53
- void PrintSets (RecordKeeper &Records, raw_ostream &OS) {
52
+ static void PrintSets (RecordKeeper &Records, raw_ostream &OS) {
54
53
SetTheory Sets;
55
54
Sets.addFieldExpander (" Set" , " Elements" );
56
55
for (Record *Rec : Records.getAllDerivedDefinitions (" Set" )) {
@@ -63,7 +62,7 @@ void PrintSets(RecordKeeper &Records, raw_ostream &OS) {
63
62
}
64
63
}
65
64
66
- TableGen::Emitter::Opt X[] = {
65
+ static TableGen::Emitter::Opt X[] = {
67
66
{" print-records" , PrintRecords, " Print all records to stdout (default)" ,
68
67
true },
69
68
{" print-detailed-records" , EmitDetailedRecords,
@@ -75,8 +74,6 @@ TableGen::Emitter::Opt X[] = {
75
74
{" print-sets" , PrintSets, " Print expanded sets for testing DAG exprs" },
76
75
};
77
76
78
- } // namespace
79
-
80
77
int main (int argc, char **argv) {
81
78
InitLLVM X (argc, argv);
82
79
cl::ParseCommandLineOptions (argc, argv);
0 commit comments