Граф коммитов

9 Коммитов

Автор SHA1 Сообщение Дата
Nick Lewycky d4a97a18ea Teach -fixit to modify all of its inputs instead of just the main file, unless
-fixit-at specified a particular fixit to fix, or the -o flag was used.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101359 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-15 06:46:58 +00:00
Douglas Gregor aaf87162c5 Teach typo correction about various language keywords. We can't
generally recover from typos in keywords (since we would effectively
have to mangle the token stream). However, there are still benefits to
typo-correcting with keywords:
  - We don't make stupid suggestions when the user typed something
  that is similar to a keyword. 
  - We can suggest the keyword in a diagnostic (did you mean
  "static_cast"?), even if we can't recover and therefore don't have
  a fix-it.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101274 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-14 20:04:41 +00:00
Douglas Gregor 47bd54392a Implement typo correction for Objective-C message sends when the
receiver is a mis-typed class name. Previously, we would give a non-specific
typo-correction diagnostic from the expression-parsing code, but there
was no fix-it because it was too late to recover. Now, we give a nice
diagnostic

honk.m:6:4: error: unknown receiver 'Hnk'; did you mean 'Honk'?
  [Hnk method];
   ^~~
   Honk
honk.m:1:1: note: 'Honk' declared here
@interface Honk
^

which includes a fix-it.

We still need to recover better from mis-typing "super".


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101211 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-14 02:46:37 +00:00
Douglas Gregor 6202119003 Fix a crash with ill-formed code within a method in an ill-formed
category implementation, which showed up during (attempted) typo
correction. Fixes <rdar://problem/7605289>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95334 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-04 23:42:48 +00:00
Fariborz Jahanian 3ac1edaab9 Patch to implement required warnings for unimplemented
properties imported frfom protocol. Fixes radar 7544809.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93965 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-20 01:51:55 +00:00
Douglas Gregor 67dd1d4df1 Whenever we emit a typo-correction diagnostic, also emit a note
pointing to the declaration that we found that has that name (if it is
unique).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92877 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-07 00:17:44 +00:00
Douglas Gregor f06cdae9c6 Implement typo correction for a variety of Objective-C-specific
constructs:

  - Instance variable lookup ("foo->ivar" and, in instance methods, "ivar")
  - Property name lookup ("foo.prop")
  - Superclasses
  - Various places where a class name is required
  - Protocol names (e.g., id<proto>)

This seems to cover many of the common places where typos could occur.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92449 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-03 18:01:57 +00:00
Douglas Gregor 736fc1b588 Fix typo test RUN lines
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92396 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-01 17:23:17 +00:00
Douglas Gregor d203a16296 When typo correction for an id-expression finds a type (or Objective-C
class), provide a suggestion for the type or class found. However,
since we can't recover properly in this case, don't provide a fix-it
hint. Example:

test/FixIt/typo.m:8:3: error: use of undeclared identifier 'NSstring';
did you
      mean 'NSString'?
  NSstring *str = @"A string";
  ...
  ^
1 diagnostic generated.




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92379 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-01 00:15:04 +00:00