Nick Lewycky
0a7de38a22
Switch this to new API.
...
llvm-svn: 102280
2010-04-24 22:31:36 +00:00
Nick Lewycky
784fad7a41
Teach clang -fixit to modify files in-place, or -fixit=suffix to create new
...
files with the additional suffix in the middle.
llvm-svn: 102230
2010-04-24 01:30:46 +00:00
Nick Lewycky
40884c0520
Add a write(raw_ostream&) method to RewriteBuffer. This uses an inefficient
...
implementation today but is the right place if we want to make it faster some
day.
llvm-svn: 101521
2010-04-16 18:49:45 +00:00
Nick Lewycky
a1e20de908
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.
llvm-svn: 101359
2010-04-15 06:46:58 +00:00
Douglas Gregor
a771f46c82
Reinstate my CodeModificationHint -> FixItHint renaming patch, without
...
the C-only "optimization".
llvm-svn: 100022
2010-03-31 17:46:05 +00:00
Douglas Gregor
30e631862f
Revert r100008, which inexplicably breaks the clang-i686-darwin10 builder
...
llvm-svn: 100018
2010-03-31 17:25:35 +00:00
Douglas Gregor
3baad0d4f7
Rename CodeModificationHint to FixItHint, since we've been using the
...
term "fix-it" everywhere and even *I* get tired of long names
sometimes. No functionality change.
llvm-svn: 100008
2010-03-31 15:31:50 +00:00
Douglas Gregor
10f1e4dda8
When suggesting a typo correction for an @implementation without a
...
corresponding @interface, provide a note showing which interface we're
referring to. This note has the fix-it hint on it.
Also, don't automatically apply fix-it hints for notes. They're meant
to express fix-its that would change semantics.
llvm-svn: 92870
2010-01-06 23:44:25 +00:00
Daniel Dunbar
f680e7d855
Kill a few more random stderr uses.
...
llvm-svn: 90441
2009-12-03 09:14:02 +00:00
Mike Stump
11289f4280
Remove tabs, and whitespace cleanups.
...
llvm-svn: 81346
2009-09-09 15:08:12 +00:00
Dan Gohman
a98e0e73de
Update clang for raw_fd_ostream no longer requiring F_Force.
...
llvm-svn: 79991
2009-08-25 15:36:09 +00:00
Torok Edwin
db7149246f
Fix build of clang with gcc-4.4: #include <cstdio> was missing.
...
llvm-svn: 79916
2009-08-24 13:25:12 +00:00
Chris Lattner
3441b4f77e
API changes to match llvm ToT.
...
llvm-svn: 79868
2009-08-23 22:45:33 +00:00
Benjamin Kramer
89b422c118
Replace cerr with errs().
...
llvm-svn: 79854
2009-08-23 12:08:50 +00:00
Chris Lattner
84cffc22d4
adjust for raw_fd_ostream api change.
...
llvm-svn: 79809
2009-08-23 02:59:41 +00:00
Daniel Dunbar
62c850fb8f
Remove now unnecessary helper methods.
...
llvm-svn: 79460
2009-08-19 20:32:38 +00:00
Daniel Dunbar
dec484abfb
Convert parts of Rewriter to StringRef based API.
...
- Please accept my sincere apologies for the gratuitous elimination of code
duplication, manual string length counting, unnecessary strlen calls, etc.
llvm-svn: 79448
2009-08-19 19:10:30 +00:00
Dan Gohman
74e3eb49ea
Update for raw_fd_ostream API changes. raw_fd_ostream now has a
...
Force flag to control whether the case of opening an existing
file is considered an error.
llvm-svn: 75802
2009-07-15 17:32:18 +00:00
Chris Lattner
184e65d363
Change Lexer::MeasureTokenLength to take a LangOptions reference.
...
This allows it to accurately measure tokens, so that we get:
t.cpp:8:13: error: unknown type name 'X'
static foo::X P;
~~~~~^
instead of the woefully inferior:
t.cpp:8:13: error: unknown type name 'X'
static foo::X P;
~~~~ ^
Most of this is just plumbing to push the reference around.
llvm-svn: 69099
2009-04-14 23:22:57 +00:00
Douglas Gregor
9c0d38a7a0
Add a new command-line option "-fixit-at=file:line:column" that only
...
applies fix-its to error messages that occur at that specific location
in the program.
llvm-svn: 68342
2009-04-02 19:05:20 +00:00
Douglas Gregor
a42bd8433d
Provide FIX-IT notes to describe what fix-it is doing behind the
...
scenes, using the underlying diagnostic client to format the
messages.
llvm-svn: 68324
2009-04-02 17:13:00 +00:00
Douglas Gregor
068913eb7a
Some cleanups to the fix-it rewriter. Thanks, Chris
...
llvm-svn: 68322
2009-04-02 16:34:42 +00:00
Douglas Gregor
862ffb11d5
Clean up -fixit output slightly
...
llvm-svn: 68278
2009-04-02 03:14:12 +00:00
Douglas Gregor
578dae57ca
Introduce a "-fixit" mode to clang-cc that applies code-modification hints.
...
llvm-svn: 68268
2009-04-02 01:08:08 +00:00