hanchenye-llvm-project/clang/docs
Eric Fiselier b87be18d8e [Clang Tablegen][RFC] Allow Early Textual Substitutions in `Diagnostic` messages.
Summary:
There are cases where the same string or select is repeated verbatim in a lot of diagnostics. This can be a pain to maintain and update. Tablegen provides no way stash the common text somewhere and reuse it in the diagnostics, until now!

This patch allows diagnostic texts to contain `%sub{<definition-name>}`, where `<definition-name>` names a Tablegen record of type `TextSubstitution`. These substitutions are done early, before the diagnostic string is otherwise processed. All `%sub` modifiers will be replaced before the diagnostic definitions are emitted.

The substitution must specify all arguments used by the substitution, and modifier indexes in the substitution are re-numbered accordingly. For example:

```
def select_ovl_candidate : TextSubstitution<"%select{function|constructor}0%select{| template| %2}1">;
```
when used as
```
"candidate `%sub{select_ovl_candidate}3,2,1 not viable"
```
will act as if we wrote:
```
"candidate %select{function|constructor}3%select{| template| %1}2 not viable"
```

Reviewers: rsmith, rjmccall, aaron.ballman, a.sidorin

Reviewed By: rjmccall

Subscribers: cfe-commits

Differential Revision: https://reviews.llvm.org/D46740

llvm-svn: 332799
2018-05-19 03:12:04 +00:00
..
CommandGuide [diagtool] Add diagtool to install target. 2018-05-16 10:23:25 +00:00
analyzer Fix typos in clang 2018-04-06 15:14:32 +00:00
tools [ASTMatchers] Support generating docs for single-line matchers 2018-01-17 23:14:49 +00:00
AddressSanitizer.rst
AttributeReference.rst
AutomaticReferenceCounting.rst
Block-ABI-Apple.rst
Block-ABI-Apple.txt
BlockLanguageSpec.rst
CMakeLists.txt
ClangCheck.rst
ClangCommandLineReference.rst This patch aims to match the changes introduced 2018-05-18 11:56:21 +00:00
ClangFormat.rst
ClangFormatStyleOptions.rst clang-format: Allow optimizer to break template declaration. 2018-05-16 08:25:03 +00:00
ClangPlugins.rst
ClangTools.rst
ControlFlowIntegrity.rst Fix doc typo 2018-04-12 19:35:39 +00:00
ControlFlowIntegrityDesign.rst
CrossCompilation.rst
DataFlowSanitizer.rst
DataFlowSanitizerDesign.rst
DiagnosticsReference.rst Fix malformed table introduced by r330174 2018-04-17 05:48:36 +00:00
DriverArchitecture.png
DriverInternals.rst
ExternalClangExamples.rst
FAQ.rst
HardwareAssistedAddressSanitizerDesign.rst [HWASan] Update HWASan assembly snippet in the docs 2018-04-24 17:41:48 +00:00
HowToSetupToolingForLLVM.rst Allow the creation of human-friendly ASTDumper to arbitrary output stream 2018-04-06 13:01:12 +00:00
InternalsManual.rst [Clang Tablegen][RFC] Allow Early Textual Substitutions in `Diagnostic` messages. 2018-05-19 03:12:04 +00:00
IntroductionToTheClangAST.rst
ItaniumMangleAbiTags.rst
JSONCompilationDatabase.rst
LTOVisibility.rst
LanguageExtensions.rst Added atomic_fetch_min, max, umin, umax intrinsics to clang. 2018-05-13 07:45:58 +00:00
LeakSanitizer.rst
LibASTMatchers.rst
LibASTMatchersReference.html [ASTMatchers] Introduce a blockDecl matcher for matching block declarations 2018-05-16 22:47:03 +00:00
LibASTMatchersTutorial.rst Add missing newlines to cl::extrahelp uses 2018-05-08 19:46:29 +00:00
LibFormat.rst Remove \brief commands from doxygen comments. 2018-05-09 01:00:01 +00:00
LibTooling.rst Add missing newlines to cl::extrahelp uses 2018-05-08 19:46:29 +00:00
MSVCCompatibility.rst
Makefile.sphinx
MemorySanitizer.rst
Modules.rst [Modules] Add more language features to be used with requires-declaration 2018-02-14 19:01:03 +00:00
ObjectiveCLiterals.rst
OpenMPSupport.rst [DOCS] Mention OpenMP Tools Interface in runtime library 2018-01-22 15:27:45 +00:00
PCHInternals.rst
PCHLayout.graffle
PCHLayout.png
PTHInternals.rst
RAVFrontendAction.rst Revert "[Tooling] [0/1] Refactor FrontendActionFactory::create() to return std::unique_ptr<>" 2018-02-27 15:54:55 +00:00
README.txt
RefactoringEngine.rst
ReleaseNotes.rst [diagtool] Add diagtool to install target. 2018-05-16 10:23:25 +00:00
SafeStack.rst
SanitizerCoverage.rst
SanitizerSpecialCaseList.rst
SanitizerStats.rst
ShadowCallStack.rst [ShadowCallStack] fix the docs 2018-05-01 00:15:56 +00:00
SourceBasedCodeCoverage.rst
ThinLTO.rst [NFC] fix trivial typo in document 2018-01-16 13:19:31 +00:00
ThreadSafetyAnalysis.rst
ThreadSanitizer.rst
Toolchain.rst [Docs] Fix typo in toolchain documentation 2018-01-12 02:57:02 +00:00
Tooling.rst
UndefinedBehaviorSanitizer.rst [ubsan] Diagnose noreturn functions which return 2017-12-21 00:10:25 +00:00
UsersManual.rst [docs] Fix typos in the Clang User's Manual. 2018-05-07 16:23:46 +00:00
conf.py Update docs version and clear release notes for 7.0.0 2018-01-03 15:49:39 +00:00
doxygen-mainpage.dox
doxygen.cfg.in Remove \brief commands from doxygen comments. 2018-05-09 01:00:01 +00:00
index.rst Add the -fsanitize=shadow-call-stack flag 2018-04-03 22:33:53 +00:00
make.bat

README.txt

See llvm/docs/README.txt