r256319 - [Sema] Make an enum local to the only method that uses it. NFC

Craig Topper via cfe-commits cfe-commits at lists.llvm.org
Tue Dec 22 21:44:46 PST 2015


Author: ctopper
Date: Tue Dec 22 23:44:46 2015
New Revision: 256319

URL: http://llvm.org/viewvc/llvm-project?rev=256319&view=rev
Log:
[Sema] Make an enum local to the only method that uses it. NFC

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

Modified: cfe/trunk/lib/Sema/SemaChecking.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaChecking.cpp?rev=256319&r1=256318&r2=256319&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaChecking.cpp (original)
+++ cfe/trunk/lib/Sema/SemaChecking.cpp Tue Dec 22 23:44:46 2015
@@ -7570,12 +7570,6 @@ void AnalyzeImplicitConversions(Sema &S,
 
 } // end anonymous namespace
 
-enum {
-  AddressOf,
-  FunctionPointer,
-  ArrayPointer
-};
-
 // Helper function for Sema::DiagnoseAlwaysNonNullPointer.
 // Returns true when emitting a warning about taking the address of a reference.
 static bool CheckForReference(Sema &SemaRef, const Expr *E,
@@ -7757,7 +7751,11 @@ void Sema::DiagnoseAlwaysNonNullPointer(
 
   unsigned DiagID = IsCompare ? diag::warn_null_pointer_compare
                               : diag::warn_impcast_pointer_to_bool;
-  unsigned DiagType;
+  enum {
+    AddressOf,
+    FunctionPointer,
+    ArrayPointer
+  } DiagType;
   if (IsAddressOf)
     DiagType = AddressOf;
   else if (IsFunction)




More information about the cfe-commits mailing list