forked from OSchip/llvm-project
[NFC] Avoid unnecessary duplication of code generating diagnostic.
The previous code unneccessarily duplicated the creation of a diagnostic where the only difference was the `AssignmentAction` being passed. rdar://88664722 Differential Revision: https://reviews.llvm.org/D124054
This commit is contained in:
parent
5e54a413de
commit
3d612a930d
|
@ -16932,10 +16932,12 @@ bool Sema::DiagnoseAssignmentResult(AssignConvertType ConvTy,
|
|||
}
|
||||
|
||||
PartialDiagnostic FDiag = PDiag(DiagKind);
|
||||
AssignmentAction ActionForDiag = Action;
|
||||
if (Action == AA_Passing_CFAudited)
|
||||
FDiag << FirstType << SecondType << AA_Passing << SrcExpr->getSourceRange();
|
||||
else
|
||||
FDiag << FirstType << SecondType << Action << SrcExpr->getSourceRange();
|
||||
ActionForDiag = AA_Passing;
|
||||
|
||||
FDiag << FirstType << SecondType << ActionForDiag
|
||||
<< SrcExpr->getSourceRange();
|
||||
|
||||
if (DiagKind == diag::ext_typecheck_convert_incompatible_pointer_sign ||
|
||||
DiagKind == diag::err_typecheck_convert_incompatible_pointer_sign) {
|
||||
|
|
Loading…
Reference in New Issue