================ @@ -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 { ---------------- Sirraide wrote:
> 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? Yeah, I think the preprocessor directives are the main problem, e.g. the `#define ASTSTART`; there isn’t really a way to do this just in the preprocessor unfortunately... 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