Commit Graph

14 Commits

Author SHA1 Message Date
Chris Lattner 0b271eb7af Expose InsertText, fixing an oversight.
llvm-svn: 43643
2007-11-02 17:26:47 +00:00
Chris Lattner 88710ff5b8 simplify change.
llvm-svn: 43348
2007-10-25 17:18:59 +00:00
Chris Lattner 94a41ff6c1 Fix a bug steve noticed when handling nested rewrites. We now turn this:
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];

into:

    NSAutoreleasePool * pool = objc_msgSend(objc_msgSend(objc_getClass("NSAutoreleasePool"), sel_getUid("alloc")), sel_getUid("init"));

instead of:

    NSAutoreleasePool * pool = objc_msgSend(objc_msgSend(objc_getClass("NSAutoreleasePool"), sel_getUid("alloc")), sel_getUid("init"))utoreleasePool"), sel_getUid("alloc")) init];

llvm-svn: 43347
2007-10-25 17:17:34 +00:00
Chris Lattner c6d91c0f6d Add new API to rewrite one stmt/expr with another.
llvm-svn: 43101
2007-10-17 22:35:30 +00:00
Chris Lattner 42ebe5c1e6 The size returned by Rewriter::getRangeSize should include
the size of the last token.

llvm-svn: 43092
2007-10-17 21:23:07 +00:00
Chris Lattner 37390bed4d Fix location processing of @encode: the range should include the @ sign.
@selector probably gets this wrong also.

llvm-svn: 43048
2007-10-16 22:51:17 +00:00
Chris Lattner a7c19feca2 Add a new Rewriter::getRangeSize method.
Rename SourceRange::Begin()/End() to getBegin()/getEnd() for
consistency with other code.
Start building the rewriter towards handling @encode.

llvm-svn: 43047
2007-10-16 22:36:42 +00:00
Chris Lattner 0bd1c97293 Push the rewriter forward a bit more. Now it rewrites
#import to #include's as a test.

llvm-svn: 43041
2007-10-16 21:07:07 +00:00
Chris Lattner 6a91cc03ad haha, my devious plot is complete:
$ clang rewrite.c -rewrite-test
prints:

int foo() {
        b:      foo();
f:      foo();
    foo();
}

for:

int foo() {
	b:	foo();
f:	foo();
    foo();
}

amazing.

llvm-svn: 42944
2007-10-13 00:46:29 +00:00
Chris Lattner 2a8ab05f5f With this I can now insert stuff before tabs, woo.
llvm-svn: 42942
2007-10-13 00:21:23 +00:00
Chris Lattner 58bad341bc Woo, tab deletion now works. Next lets see if we can
insert stuff.

llvm-svn: 42941
2007-10-13 00:17:04 +00:00
Chris Lattner 2fcf1b83c1 another step forward in rewriter stuff. This still has
some incredibly subtle details that I'm working on getting
right.

llvm-svn: 42940
2007-10-13 00:11:23 +00:00
Chris Lattner 16a0de468f Push the rewriting APIs along. Build a trivial client that replaces tabs
with x's for now.  The APIs are all unimplemented, so it doesn't do 
anything yet! :)

llvm-svn: 42868
2007-10-11 18:38:32 +00:00
Chris Lattner e27d865e36 Initial checkin of rewriter interface. It is just stubbed out for now.
llvm-svn: 41990
2007-09-15 22:21:22 +00:00