From: Alexander Kornienko Date: Wed, 23 Mar 2016 14:28:52 +0000 (+0000) Subject: Use an enum instead of hardcoded indices. NFC. X-Git-Tag: llvmorg-3.9.0-rc1~11158 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3a520349f11fc6ba3afd9435a2ffbff4a1b267c9;p=platform%2Fupstream%2Fllvm.git Use an enum instead of hardcoded indices. NFC. llvm-svn: 264158 --- diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp index 65ca8dd..1abd7d0 100644 --- a/clang/lib/Sema/SemaDecl.cpp +++ b/clang/lib/Sema/SemaDecl.cpp @@ -6423,16 +6423,20 @@ void Sema::CheckShadow(Scope *S, VarDecl *D, const LookupResult& R) { } // Determine what kind of declaration we're shadowing. - unsigned Kind; + + // The order must be consistent with the %select in the warning message. + enum ShadowedDeclKind { Local, Global, StaticMember, Field }; + ShadowedDeclKind Kind; if (isa(OldDC)) { if (isa(ShadowedDecl)) - Kind = 3; // field + Kind = Field; else - Kind = 2; // static data member - } else if (OldDC->isFileContext()) - Kind = 1; // global - else - Kind = 0; // local + Kind = StaticMember; + } else if (OldDC->isFileContext()) { + Kind = Global; + } else { + Kind = Local; + } DeclarationName Name = R.getLookupName();