You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
18 lines
513 B
18 lines
513 B
4 months ago
|
#include "TableGenBackends.h"
|
||
|
#include "llvm/TableGen/Record.h"
|
||
|
#include "llvm/TableGen/TableGenBackend.h"
|
||
|
|
||
|
using namespace llvm;
|
||
|
|
||
|
void clang::EmitClangDataCollectors(RecordKeeper &RK, raw_ostream &OS) {
|
||
|
const auto &Defs = RK.getClasses();
|
||
|
for (const auto &Entry : Defs) {
|
||
|
Record &R = *Entry.second;
|
||
|
OS << "DEF_ADD_DATA(" << R.getName() << ", {\n";
|
||
|
auto Code = R.getValue("Code")->getValue();
|
||
|
OS << Code->getAsUnquotedString() << "}\n)";
|
||
|
OS << "\n";
|
||
|
}
|
||
|
OS << "#undef DEF_ADD_DATA\n";
|
||
|
}
|