File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -95,6 +95,8 @@ using namespace llvm;
9595
9696namespace {
9797
98+ // / Used the by the ReportedErrors class to guarantee only one error is reported
99+ // / at one time.
98100static ManagedStatic<sys::SmartMutex<true >> ReportedErrorsLock;
99101
100102struct 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;
You can’t perform that action at this time.
0 commit comments