| 1294 | } |
| 1295 | |
| 1296 | bool BfPassInstance::WantsRangeRecorded(BfSourceData* bfSource, int srcIdx, int srcLen, bool isWarning, bool isDeferred) |
| 1297 | { |
| 1298 | if ((!mFilterErrorsTo.IsEmpty()) && (!mFilterErrorsTo.Contains(bfSource))) |
| 1299 | return false; |
| 1300 | |
| 1301 | if (bfSource == NULL) |
| 1302 | return true; |
| 1303 | |
| 1304 | //TODO: Was this useful, or does 'var' resolution do this better? |
| 1305 | // if (!mErrors.IsEmpty()) |
| 1306 | // { |
| 1307 | // // If the last error had a range that was a subset of this one, then just keep the first error |
| 1308 | // // This helps reduce cascading errors to their root cause |
| 1309 | // auto lastError = mErrors.back(); |
| 1310 | // if ((lastError->mSource == bfSource) && (isWarning == lastError->mIsWarning) && (isDeferred == lastError->mIsDeferred) && |
| 1311 | // (lastError->mSrcStart >= srcIdx) && (lastError->mSrcEnd <= srcIdx + srcLen)) |
| 1312 | // return false; |
| 1313 | // } |
| 1314 | |
| 1315 | // Don't record errors that have already occurred at this location |
| 1316 | BfErrorBase checkError; |
| 1317 | checkError.mIsWarning = isWarning; |
| 1318 | checkError.mIsDeferred = isDeferred; |
| 1319 | checkError.mSource = bfSource; |
| 1320 | checkError.mSrcStart = srcIdx; |
| 1321 | checkError.mSrcEnd = srcIdx + srcLen; |
| 1322 | if (mErrorSet.Contains(BfErrorEntry(&checkError))) |
| 1323 | return false; |
| 1324 | |
| 1325 | int prevCount = (int)mErrors.size(); |
| 1326 | if (!isWarning) |
| 1327 | prevCount -= mWarningCount; |
| 1328 | if (!isDeferred) |
| 1329 | prevCount -= mDeferredErrorCount; |
| 1330 | if (prevCount > sMaxErrors) |
| 1331 | return false; |
| 1332 | |
| 1333 | return true; |
| 1334 | } |
| 1335 | |
| 1336 | bool BfPassInstance::WantsRangeDisplayed(BfSourceData* bfSource, int srcIdx, int srcLen, bool isWarning, bool isDeferred) |
| 1337 | { |
nothing calls this directly
no test coverage detected