Skip to content

Commit 3d5fc04

Browse files
committed
add docs
1 parent b9ccb8b commit 3d5fc04

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

llvm/lib/CodeGen/MachineVerifier.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,8 @@ using namespace llvm;
9595

9696
namespace {
9797

98+
/// Used the by the ReportedErrors class to guarantee only one error is reported
99+
/// at one time.
98100
static ManagedStatic<sys::SmartMutex<true>> ReportedErrorsLock;
99101

100102
struct MachineVerifier {
@@ -239,12 +241,16 @@ struct MachineVerifier {
239241
LiveStacks *LiveStks = nullptr;
240242
SlotIndexes *Indexes = nullptr;
241243

244+
/// A class to track the number of reported error and to guarantee that only
245+
/// one error is reported at one time.
242246
class ReportedErrors {
243247
unsigned NumReported = 0;
244248
bool AbortOnError;
245249

246250
public:
251+
/// \param AbortOnError -- If set, abort after printing the first error.
247252
ReportedErrors(bool AbortOnError) : AbortOnError(AbortOnError) {}
253+
248254
~ReportedErrors() {
249255
if (!hasError())
250256
return;
@@ -268,6 +274,7 @@ struct MachineVerifier {
268274
return NumReported == 1;
269275
}
270276

277+
/// \returns true if an error was reported.
271278
bool hasError() { return NumReported; }
272279
};
273280
ReportedErrors ReportedErrs;

0 commit comments

Comments
 (0)