[cfe-commits] r157953 - /cfe/trunk/docs/InternalsManual.html

Nico Weber nicolasweber at gmx.de
Mon Jun 4 14:56:14 PDT 2012


Author: nico
Date: Mon Jun  4 16:56:14 2012
New Revision: 157953

URL: http://llvm.org/viewvc/llvm-project?rev=157953&view=rev
Log:
Document how fixits on errors and warnings must behave.

Review and wording tweaks by Richard.


Modified:
    cfe/trunk/docs/InternalsManual.html

Modified: cfe/trunk/docs/InternalsManual.html
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/docs/InternalsManual.html?rev=157953&r1=157952&r2=157953&view=diff
==============================================================================
--- cfe/trunk/docs/InternalsManual.html (original)
+++ cfe/trunk/docs/InternalsManual.html Mon Jun  4 16:56:14 2012
@@ -441,6 +441,19 @@
 to render the code differently (e.g., as markup inline) or even give
 the user the ability to automatically fix the problem.</p>
 
+<p>Fix-it hints on errors and warnings need to obey these rules:</p>
+
+<ul>
+<li>Since they are automatically applied if <code>-Xclang -fixit</code>
+is passed to the driver, they should only be used when it's very likely they
+match the user's intent.</li>
+<li>Clang must recover from the error or warning as if the fix-it had been
+applied.</li>
+</ul>
+
+<p>If a fix-it can't obey these rules, put the fix-it on a note. Fix-its on
+notes are not applied automatically.</p>
+
 <p>All fix-it hints are described by the <code>FixItHint</code> class,
 instances of which should be attached to the diagnostic using the
 << operator in the same way that highlighted source ranges and





More information about the cfe-commits mailing list