[llvm] r285134 - [docs] Fix a missing code-block in the new Error docs.
Lang Hames via llvm-commits
llvm-commits at lists.llvm.org
Tue Oct 25 15:25:08 PDT 2016
Author: lhames
Date: Tue Oct 25 17:25:07 2016
New Revision: 285134
URL: http://llvm.org/viewvc/llvm-project?rev=285134&view=rev
Log:
[docs] Fix a missing code-block in the new Error docs.
Modified:
llvm/trunk/docs/ProgrammersManual.rst
Modified: llvm/trunk/docs/ProgrammersManual.rst
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/ProgrammersManual.rst?rev=285134&r1=285133&r2=285134&view=diff
==============================================================================
--- llvm/trunk/docs/ProgrammersManual.rst (original)
+++ llvm/trunk/docs/ProgrammersManual.rst Tue Oct 25 17:25:07 2016
@@ -614,14 +614,16 @@ preceded by a string âbannerâ
mapping can also be supplied from ``Error`` values to exit codes using the
``setExitCodeMapper`` method:
-int main(int argc, char *argv[]) {
- ExitOnErr.setBanner(std::string(argv[0]) + â error:â);
- ExitOnErr.setExitCodeMapper(
- [](const Error &Err) {
- if (Err.isA<BadFileFormat>())
- return 2;
- return 1;
- });
+.. code-block:: c++
+
+ int main(int argc, char *argv[]) {
+ ExitOnErr.setBanner(std::string(argv[0]) + â error:â);
+ ExitOnErr.setExitCodeMapper(
+ [](const Error &Err) {
+ if (Err.isA<BadFileFormat>())
+ return 2;
+ return 1;
+ });
Use ``ExitOnError`` in your tool code where possible as it can greatly improve
readability.
More information about the llvm-commits
mailing list