<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Hi Daniel,<br>
<br>
This patch is the continuation of r191820. The purpose is to
properly reformat whitespace surrounding line removals in
clang-format-diff.py without reformatting unrelated code as was
happening before.<br>
<br>
For example, the input:<br>
<br>
<pre>diff --git a/lib/Sema/SemaDeclAttr.cpp b/lib/Sema/SemaDeclAttr.cpp</pre>
<pre>index a71d3c0..a75d66f 100644</pre>
<pre>--- a/lib/Sema/SemaDeclAttr.cpp</pre>
<pre>+++ b/lib/Sema/SemaDeclAttr.cpp</pre>
<pre>@@ -1681,10 +1681,10 @@ static void handleAliasAttr(Sema &S, Decl *D, const AttributeList &Attr) {</pre>
<pre> return;</pre>
<pre> }</pre>
<pre> </pre>
<pre>- // FIXME: check if target symbol exists in current file</pre>
<pre> </pre>
<pre> D->addAttr(::new (S.Context) AliasAttr(Attr.getRange(), S.Context, Str,</pre>
<pre> Attr.getAttributeSpellingListIndex()));</pre>
<pre>+ S.Aliases.push_back(D);</pre>
<pre> }</pre>
<pre> </pre>
<pre> static void handleMinSizeAttr(Sema &S, Decl *D, const AttributeList &Attr) {</pre>
<br>
Now yields:<br>
<br>
<pre>--- lib/Sema/SemaDeclAttr.cpp (before formatting)</pre>
<pre>+++ lib/Sema/SemaDeclAttr.cpp (after formatting)</pre>
<pre>@@ -1680,7 +1680,6 @@</pre>
<pre> S.Diag(Attr.getLoc(), diag::err_alias_not_supported_on_darwin);</pre>
<pre> return;</pre>
<pre> }</pre>
<pre>-</pre>
<pre> </pre>
<pre> D->addAttr(::new (S.Context) AliasAttr(Attr.getRange(), S.Context, Str,</pre>
<pre> Attr.getAttributeSpellingListIndex()));</pre>
<br>
Even though we're not yet testing the scripts, I'm aware this needs
a test added to test/Format/line-ranges.cpp. Unfortunately I'm
struggling to write one and found the existing tests hard to read.
Could you give me a hand with that?<br>
<br>
I wonder if we could move towards multiple input files for a single
test -- just trying to wrap my head around line-ranges.cpp,
FileCheck doesn't feel like the right tool for this. I wonder if GNU
diffutils has a better format for tests that we could adopt to start
testing clang-format-diff.py.<br>
<br>
Alp.<br>
<br>
<pre class="moz-signature" cols="72">--
<a class="moz-txt-link-freetext" href="http://www.nuanti.com">http://www.nuanti.com</a>
the browser experts
</pre>
</body>
</html>