ClangDataCollectorsEmitter.cpp 513 B

1234567891011121314151617
  1. #include "TableGenBackends.h"
  2. #include "llvm/TableGen/Record.h"
  3. #include "llvm/TableGen/TableGenBackend.h"
  4. using namespace llvm;
  5. void clang::EmitClangDataCollectors(RecordKeeper &RK, raw_ostream &OS) {
  6. const auto &Defs = RK.getClasses();
  7. for (const auto &Entry : Defs) {
  8. Record &R = *Entry.second;
  9. OS << "DEF_ADD_DATA(" << R.getName() << ", {\n";
  10. auto Code = R.getValue("Code")->getValue();
  11. OS << Code->getAsUnquotedString() << "}\n)";
  12. OS << "\n";
  13. }
  14. OS << "#undef DEF_ADD_DATA\n";
  15. }