Reviewers: titzer,

Description:
[turbofan] Add STYLE document.

[email protected]

Please review this at https://codereview.chromium.org/865183002/

Base URL: https://chromium.googlesource.com/v8/v8.git@master

Affected files (+29, -0 lines):
  A src/compiler/STYLE


Index: src/compiler/STYLE
diff --git a/src/compiler/STYLE b/src/compiler/STYLE
new file mode 100644
index 0000000000000000000000000000000000000000..ae41e3f989feafa2e1d570eb8b4012c283722a08
--- /dev/null
+++ b/src/compiler/STYLE
@@ -0,0 +1,29 @@
+Compiler Coding Style
+=====================
+
+Coding style for the TurboFan compiler generally follows the Google C++ Style +Guide and the Chromium Coding Style. The notes below are usually just extensions
+beyond what the Google style guide already says. If this document doesn't
+mention a rule, follow the Google C++ style.
+
+
+TODOs
+-----
+We use the following convention for putting TODOs into the code:
+
+  * A TODO(turbofan) implies a performance improvement opportunity.
+  * A TODO(name) implies an incomplete implementation.
+
+
+Use of C++11 auto keyword
+-------------------------
+Use auto to avoid type names that are just clutter. Continue to use manifest +type declarations when it helps readability, and never use auto for anything +but local variables, in particular auto should only be used where it is obvious
+from context what the type is:
+
+  for (auto block : x->blocks())  // clearly a Block of some kind
+ for (auto instr : x->instructions()) // clearly an Instruction of some kind
+
+ for (auto b : x->predecessors()) // less clear, better to make it explicit
+  for (BasicBlock* b : x->predecessors()) // now clear


--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to