blob: c65c7a7a91acf808ab47c6a28fc30fc22ae90a09 [file] [log] [blame]
Johannes Altmanninger1509da02017-09-06 13:20:51 +00001#include "llvm/TableGen/Record.h"
2#include "llvm/TableGen/TableGenBackend.h"
3
4using namespace llvm;
5
6namespace clang {
7void EmitClangDataCollectors(RecordKeeper &RK, raw_ostream &OS) {
8 const auto &Defs = RK.getClasses();
9 for (const auto &Entry : Defs) {
10 Record &R = *Entry.second;
11 OS << "DEF_ADD_DATA(" << R.getName() << ", {";
12 auto Code = R.getValue("Code")->getValue();
13 OS << Code->getAsUnquotedString() << "}\n)";
14 OS << "\n";
15 }
16 OS << "#undef DEF_ADD_DATA\n";
17}
18} // end namespace clang