[PATCH] D46740: [Clang Tablegen][RFC] Allow Early Textual Substitutions in `Diagnostic` messages.

John McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri May 11 10:41:50 PDT 2018


rjmccall accepted this revision.
rjmccall added a comment.
This revision is now accepted and ready to land.

This seems like a good idea to me.  I wonder if it would be better to take advantage of this to shrink the string tables by preserving the substitution structure until runtime, but that really doesn't need to be part of this first try.



================
Comment at: utils/TableGen/ClangDiagnosticsEmitter.cpp:514
+  std::vector<Record *> Diags = Records.getAllDerivedDefinitions("Diagnostic");
+  llvm::for_each(Diags, [&](Record *R) { substituteDiagText(R, SubsMap); });
 
----------------
I see why this has to be done separately, I think, but it should at least go in a helper function.

Also, please check for substitution-name conflicts.


https://reviews.llvm.org/D46740





More information about the cfe-commits mailing list