Add a section in the DeveloperGuide about avoiding unsigned integer
authorMehdi Amini <aminim@google.com>
Sat, 4 May 2019 01:43:55 +0000 (18:43 -0700)
committerMehdi Amini <joker.eph@gmail.com>
Mon, 6 May 2019 15:28:01 +0000 (08:28 -0700)
--

PiperOrigin-RevId: 246610168

mlir/g3doc/DeveloperGuide.md

index 03a4d3f..c100335 100644 (file)
@@ -10,6 +10,12 @@ MLIR follows the [LLVM style](https://llvm.org/docs/CodingStandards.html) guide
 except:
 
 *   Adopts [camelBack](https://llvm.org/docs/Proposals/VariableNames.html);
+*   Prefer `int` when possible and use unsigned only for bitmask and when you
+    intend to rely on wrapping behavior. For the rational about this, see
+    [unsigned: A Guideline for Better
+    Code](https://www.youtube.com/watch?v=wvtFGa6XJDU) and [Garbage In,
+    Garbage Out: Arguing about Undefined
+    Behavior...](https://www.youtube.com/watch?v=yG1OZ69H_-o)
 
 ## Pass name and other command line options