r175807 - Remove superfluous null pointer check. The pointer is used prior to this check.

Ted Kremenek kremenek at apple.com
Thu Feb 21 14:10:49 PST 2013


Author: kremenek
Date: Thu Feb 21 16:10:49 2013
New Revision: 175807

URL: http://llvm.org/viewvc/llvm-project?rev=175807&view=rev
Log:
Remove superfluous null pointer check.  The pointer is used prior to this check.

Modified:
    cfe/trunk/lib/Sema/SemaExpr.cpp

Modified: cfe/trunk/lib/Sema/SemaExpr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaExpr.cpp?rev=175807&r1=175806&r2=175807&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaExpr.cpp (original)
+++ cfe/trunk/lib/Sema/SemaExpr.cpp Thu Feb 21 16:10:49 2013
@@ -1672,14 +1672,13 @@ bool Sema::DiagnoseEmptyLookup(Scope *S,
             << SS.getRange()
             << FixItHint::CreateReplacement(Corrected.getCorrectionRange(),
                                             CorrectedStr);
-        if (ND) {
-          unsigned diag = isa<ImplicitParamDecl>(ND)
-            ? diag::note_implicit_param_decl
-            : diag::note_previous_decl;
 
-          Diag(ND->getLocation(), diag)
-            << CorrectedQuotedStr;
-        }
+        unsigned diag = isa<ImplicitParamDecl>(ND)
+          ? diag::note_implicit_param_decl
+          : diag::note_previous_decl;
+
+        Diag(ND->getLocation(), diag)
+          << CorrectedQuotedStr;
 
         // Tell the callee to try to recover.
         return false;





More information about the cfe-commits mailing list