Commit Graph

4 Commits

Author SHA1 Message Date
Alp Toker a3c494f0db Revert "clang/test/Driver/crash-report.c: This requires rewriter for -frewrite-includes. [PR20321]"
We've decided to make the core rewriter class and PP rewriters mandatory.
They're only a few hundred lines of code in total and not worth supporting as a
distinct build configuration, especially since doing so disables key compiler
features.

This reverts commit r213150.

Revert "clang/test: Introduce the feature "rewriter" for --enable-clang-rewriter."

This reverts commit r213148.

Revert "Move clang/test/Frontend/rewrite-*.c to clang/test/Frontend/Rewriter/"

This reverts commit r213146.

llvm-svn: 213159
2014-07-16 15:12:48 +00:00
NAKAMURA Takumi 692d6bb544 clang/test: Introduce the feature "rewriter" for --enable-clang-rewriter.
llvm-svn: 213148
2014-07-16 13:36:39 +00:00
Daniel Dunbar 8fbe78f6fc Update tests to use %clang_cc1 instead of 'clang-cc' or 'clang -cc1'.
- This is designed to make it obvious that %clang_cc1 is a "test variable"
   which is substituted. It is '%clang_cc1' instead of '%clang -cc1' because it
   can be useful to redefine what gets run as 'clang -cc1' (for example, to set
   a default target).

llvm-svn: 91446
2009-12-15 20:14:24 +00:00
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