[PATCH] D83788: Removed unused variable in clang

2020-07-14 Thread Nadav Rotem via Phabricator via cfe-commits
nadav updated this revision to Diff 278031.

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D83788/new/

https://reviews.llvm.org/D83788

Files:
  clang/lib/Sema/SemaExpr.cpp


Index: clang/lib/Sema/SemaExpr.cpp
===
--- clang/lib/Sema/SemaExpr.cpp
+++ clang/lib/Sema/SemaExpr.cpp
@@ -15543,7 +15543,6 @@
   bool CheckInferredResultType = false;
   bool isInvalid = false;
   unsigned DiagKind = 0;
-  FixItHint Hint;
   ConversionFixItGenerator ConvHints;
   bool MayHaveConvFixit = false;
   bool MayHaveFunctionDiff = false;
@@ -15596,10 +15595,9 @@
 }
 CheckInferredResultType = DstType->isObjCObjectPointerType() &&
   SrcType->isObjCObjectPointerType();
-if (Hint.isNull() && !CheckInferredResultType) {
+if (!CheckInferredResultType) {
   ConvHints.tryToFixConversion(SrcExpr, SrcType, DstType, *this);
-}
-else if (CheckInferredResultType) {
+} else if (CheckInferredResultType) {
   SrcType = SrcType.getUnqualifiedType();
   DstType = DstType.getUnqualifiedType();
 }
@@ -15768,13 +15766,11 @@
 FDiag << FirstType << SecondType << Action << SrcExpr->getSourceRange();
 
   // If we can fix the conversion, suggest the FixIts.
-  assert(ConvHints.isNull() || Hint.isNull());
   if (!ConvHints.isNull()) {
 for (FixItHint &H : ConvHints.Hints)
   FDiag << H;
-  } else {
-FDiag << Hint;
   }
+
   if (MayHaveConvFixit) { FDiag << (unsigned) (ConvHints.Kind); }
 
   if (MayHaveFunctionDiff)


Index: clang/lib/Sema/SemaExpr.cpp
===
--- clang/lib/Sema/SemaExpr.cpp
+++ clang/lib/Sema/SemaExpr.cpp
@@ -15543,7 +15543,6 @@
   bool CheckInferredResultType = false;
   bool isInvalid = false;
   unsigned DiagKind = 0;
-  FixItHint Hint;
   ConversionFixItGenerator ConvHints;
   bool MayHaveConvFixit = false;
   bool MayHaveFunctionDiff = false;
@@ -15596,10 +15595,9 @@
 }
 CheckInferredResultType = DstType->isObjCObjectPointerType() &&
   SrcType->isObjCObjectPointerType();
-if (Hint.isNull() && !CheckInferredResultType) {
+if (!CheckInferredResultType) {
   ConvHints.tryToFixConversion(SrcExpr, SrcType, DstType, *this);
-}
-else if (CheckInferredResultType) {
+} else if (CheckInferredResultType) {
   SrcType = SrcType.getUnqualifiedType();
   DstType = DstType.getUnqualifiedType();
 }
@@ -15768,13 +15766,11 @@
 FDiag << FirstType << SecondType << Action << SrcExpr->getSourceRange();
 
   // If we can fix the conversion, suggest the FixIts.
-  assert(ConvHints.isNull() || Hint.isNull());
   if (!ConvHints.isNull()) {
 for (FixItHint &H : ConvHints.Hints)
   FDiag << H;
-  } else {
-FDiag << Hint;
   }
+
   if (MayHaveConvFixit) { FDiag << (unsigned) (ConvHints.Kind); }
 
   if (MayHaveFunctionDiff)
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D83788: Removed unused variable in clang

2020-07-14 Thread Nadav Rotem via Phabricator via cfe-commits
nadav added a comment.

@modocache Thank you for the review. I updated the permissions of the diff. 
Sorry, for the trouble.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D83788/new/

https://reviews.llvm.org/D83788



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits