blob: 4079efc808231bf0bd4cdc4708ad3053d40ec03d [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;
Konstantin Zhuravlyov500c25e2017-09-08 16:17:16 +000011 OS << "DEF_ADD_DATA(" << R.getName() << ", {\n";
Johannes Altmanninger1509da02017-09-06 13:20:51 +000012 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