[llvm] r285138 - [docs] Use consistent style for "do more stuff" in Error docs examples.
Lang Hames via llvm-commits
llvm-commits at lists.llvm.org
Tue Oct 25 15:41:54 PDT 2016
Author: lhames
Date: Tue Oct 25 17:41:54 2016
New Revision: 285138
URL: http://llvm.org/viewvc/llvm-project?rev=285138&view=rev
Log:
[docs] Use consistent style for "do more stuff" in Error docs examples.
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=285138&r1=285137&r2=285138&view=diff
==============================================================================
--- llvm/trunk/docs/ProgrammersManual.rst (original)
+++ llvm/trunk/docs/ProgrammersManual.rst Tue Oct 25 17:41:54 2016
@@ -398,7 +398,7 @@ operator. If failure, the ``Error`` valu
if (auto FileOrErr = openFormattedFile(Path)) {
// On success, grab a reference to the file and continue.
auto &File = *FileOrErr;
- // ...
+ ...
} else
// On error, extract the Error value and return it.
return FileOrErr.takeError();
@@ -418,7 +418,7 @@ rewritten as:
return Err;
// On success, grab a reference to the file and continue.
auto &File = *FileOrErr;
- // ...
+ ...
}
This second form is often more readable for functions that involve multiple
@@ -695,7 +695,8 @@ type inspection method, ``isA``, and the
return Err;
}
auto &Child = *ChildOrErr;
- // do work
+ // Use Child
+ ...
}
return Error::success();
}
@@ -719,7 +720,8 @@ completing the walk over the archive the
else
return Err;
auto &Child = *ChildOrErr;
- // do work
+ // Use Child
+ ...
}
return DeferredErrs;
}
@@ -751,7 +753,8 @@ class) the result is much cleaner iterat
Error Err;
for (auto &Child : Ar->children(Err)) {
- // Use Child - we only enter the loop when itâs valid.
+ // Use Child - we only enter the loop when itâs valid
+ ...
}
// Check Err after the loop to ensure it didnât break due to an error.
if (Err)
More information about the llvm-commits
mailing list