summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaDecl.cpp
diff options
context:
space:
mode:
authorKaelyn Uhrain <rikka@google.com>2012-01-24 19:45:35 +0000
committerKaelyn Uhrain <rikka@google.com>2012-01-24 19:45:35 +0000
commit9ce58bd7578b494aab0abbef8e015722f720f6f2 (patch)
treea3f3eb1e53abd6ca3fed116e3c6a93a6adc473d5 /clang/lib/Sema/SemaDecl.cpp
parent88297ef6656f304a61fae58b518a5d94faf0aae2 (diff)
downloadbcm5719-llvm-9ce58bd7578b494aab0abbef8e015722f720f6f2.tar.gz
bcm5719-llvm-9ce58bd7578b494aab0abbef8e015722f720f6f2.zip
Small code cleanup/simplification in Sema::ClassifyName.
llvm-svn: 148850
Diffstat (limited to 'clang/lib/Sema/SemaDecl.cpp')
-rw-r--r--clang/lib/Sema/SemaDecl.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp
index 980c59c4c94..a84612edfc0 100644
--- a/clang/lib/Sema/SemaDecl.cpp
+++ b/clang/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
OpenPOWER on IntegriCloud