================ @@ -1562,6 +1563,60 @@ void clang::EmitClangDiagsCompatIDs(const llvm::RecordKeeper &Records, OS << "DIAG_COMPAT_IDS_END()\n"; } +/// ClangDiagsIntefaceEmitter - Emit the diagnostics interface header for +/// a Clang component. +void clang::EmitClangDiagsInterface(llvm::raw_ostream &OS, + const std::string &Component) { + if (Component.empty()) + PrintFatalError("'-gen-clang-diags-iface' requires a component name"); + + std::string ComponentUpper = StringRef(Component).upper(); + const char *Comp = Component.c_str(); + const char *Upper = ComponentUpper.c_str(); + + OS << llvm::format(R"c++( +namespace clang { ---------------- erichkeane wrote:
These are all so common (differing only by the one name change) that I wonder if tablegen is the right place for this, instead of just a predefined file. BUT I can't htink of a way to do that which doesn't require preprocessor string-replacement inside of a `#include` or `define` identifier, which, IIRC is UB? SO I guess this is ok and the only way we can reasonably do this? https://github.com/llvm/llvm-project/pull/134777 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits