diff options
author | Kaelyn Uhrain <rikka@google.com> | 2012-01-24 19:45:35 +0000 |
---|---|---|
committer | Kaelyn Uhrain <rikka@google.com> | 2012-01-24 19:45:35 +0000 |
commit | a5ee6345b5af1c88262d02d248e76ad2423161a0 (patch) | |
tree | c47e9e31aeb7fe385b8f5fb8c7d1c421f34d3102 /lib/Sema/SemaDecl.cpp | |
parent | 98c16b8b4fe7bb26b17a479d6872e390816e57d4 (diff) |
Small code cleanup/simplification in Sema::ClassifyName.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148850 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaDecl.cpp')
-rw-r--r-- | lib/Sema/SemaDecl.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp index 980c59c4c9..a84612edfc 100644 --- a/lib/Sema/SemaDecl.cpp +++ b/lib/Sema/SemaDecl.cpp @@ -604,19 +604,19 @@ Corrected: // Update the name, so that the caller has the new name. Name = Corrected.getCorrectionAsIdentifierInfo(); + // Typo correction corrected to a keyword. + if (Corrected.isKeyword()) + return Corrected.getCorrectionAsIdentifierInfo(); + // Also update the LookupResult... // FIXME: This should probably go away at some point Result.clear(); Result.setLookupName(Corrected.getCorrection()); - if (FirstDecl) Result.addDecl(FirstDecl); - - // Typo correction corrected to a keyword. - if (Corrected.isKeyword()) - return Corrected.getCorrectionAsIdentifierInfo(); - - if (FirstDecl) + if (FirstDecl) { + Result.addDecl(FirstDecl); Diag(FirstDecl->getLocation(), diag::note_previous_decl) << CorrectedQuotedStr; + } // If we found an Objective-C instance variable, let // LookupInObjCMethod build the appropriate expression to |