llvm-project/clang/test/Misc
Eli Friedman e6eb2edb50 Fix for PR2386: distinguish between insertion and replacements in the
delta tree.

The issue is roughly a conflict in ReplaceText between two kinds of 
uses. One, it should be possible to replace a replacement: for example, the
ObjC rewriter calls ReplaceStmt for an expression, then replaces the resulting
expression with another expression.  Two, it should be possible to 
replace text that already has text inserted before it: for example, the 
HTML rewriter inserts a bunch of tags at the beginning of the line, then 
tries to escape the first character on the line.  This patch 
distinguishes the two cases by storing the deltas separately; 
essentially, replacements and insertions no longer interfere with 
each other.

Another possibility would be to add some sort of flag to ReplaceText, but
this seems a bit more intuitive and flexible.

There are a few downsides to the current solution: one is that there isn't
any way to remove/replace an insertion without touching additional
surrounding text; if such an operation turns out to be useful, an
additional method or flag can be added.  Another is that an insertion 
and replacing a string of length zero are distinct operations; I'm not 
sure how to resolve this, or whether it will be confusing in practice.

This is relatively sensitive code, so please test and tell me if 
anything breaks.

llvm-svn: 72000
2009-05-18 13:56:52 +00:00
..
caret-diags-macros.c adjust this to bourne shell syntax 2009-05-06 06:00:28 +00:00
caret-diags-scratch-buffer.c rename test 2009-05-05 21:52:01 +00:00
diag-checker.c Rename clang to clang-cc. 2009-03-24 02:24:46 +00:00
diag-mapping.c add another sanity check for -Werror=xx 2009-04-15 07:05:12 +00:00
diag-mapping2.c arrange for -Wno-error=foo warnings to be immune to -Werror as 2009-04-16 04:32:54 +00:00
emit-html-insert.c Fix for PR2386: distinguish between insertion and replacements in the 2009-05-18 13:56:52 +00:00
emit-html.c Rename clang to clang-cc. 2009-03-24 02:24:46 +00:00
message-length.c When word-wrapping, be more defensive about a ridiculously small number of columns. Fixes <rdar://problem/6892178> 2009-05-15 18:05:24 +00:00
predefines.c Fix rdar://6814950 - stdint.h isn't "-pedantic -std=c89" clean, 2009-04-22 03:42:19 +00:00