[llvm-commits] [llvm] r76751 - /llvm/trunk/docs/CodingStandards.html

Chris Lattner sabre at nondot.org
Wed Jul 22 09:54:14 PDT 2009


Author: lattner
Date: Wed Jul 22 11:54:14 2009
New Revision: 76751

URL: http://llvm.org/viewvc/llvm-project?rev=76751&view=rev
Log:
fix some wording problems Daniel pointed out, make a example actually real.

Modified:
    llvm/trunk/docs/CodingStandards.html

Modified: llvm/trunk/docs/CodingStandards.html
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/CodingStandards.html?rev=76751&r1=76750&r2=76751&view=diff

==============================================================================
--- llvm/trunk/docs/CodingStandards.html (original)
+++ llvm/trunk/docs/CodingStandards.html Wed Jul 22 11:54:14 2009
@@ -631,7 +631,7 @@
 
 <div class="doc_text">
 
-<p>It is very common to write inline functions that just compute a boolean
+<p>It is very common to write small loops that just compute a boolean
    value.  There are a number of ways that people commonly write these, but an
    example of this sort of thing is:</p>
    
@@ -653,8 +653,8 @@
 <p>This sort of code is awkward to write, and is almost always a bad sign.
 Instead of this sort of loop, we strongly prefer to use a predicate function
 (which may be <a href="#micro_anonns">static</a>) that uses
-<a href="#hl_earlyexit">early exits</a> to compute the predicate.  Code like
-this would be preferred:
+<a href="#hl_earlyexit">early exits</a> to compute the predicate.  We prefer
+the code to be structured like this:
 </p>
 
 
@@ -1050,21 +1050,27 @@
 
 <div class="doc_code">
 <pre>
-/// SomeCrazyThing - This namespace contains flags for ...
-namespace SomeCrazyThing {
-  enum foo {
-    /// X - This is the X flag, which is ...
-    X = 1, 
-    
-    /// Y - This is the Y flag, which is ...
-    Y = 2,
-    
-    /// Z - This is the Z flag, which is ...
-    Z = 4,
-    
-    /// ALL_FLAGS - This is the union of all flags.
-    ALL_FLAGS = 7
-  };
+namespace llvm {
+  namespace X86 {
+    /// RelocationType - An enum for the x86 relocation codes. Note that
+    /// the terminology here doesn't follow x86 convention - word means
+    /// 32-bit and dword means 64-bit.
+    enum RelocationType {
+      /// reloc_pcrel_word - PC relative relocation, add the relocated value to
+      /// the value already in memory, after we adjust it for where the PC is.
+      reloc_pcrel_word = 0,
+
+      /// reloc_picrel_word - PIC base relative relocation, add the relocated
+      /// value to the value already in memory, after we adjust it for where the
+      /// PIC base is.
+      reloc_picrel_word = 1,
+      
+      /// reloc_absolute_word, reloc_absolute_dword - Absolute relocation, just
+      /// add the relocated value to the value already in memory.
+      reloc_absolute_word = 2,
+      reloc_absolute_dword = 3
+    };
+  }
 }
 </pre>
 </div>
@@ -1114,7 +1120,8 @@
 
 <div class="doc_text">
 
-<p>A common topic after talking about namespaces is anonymous namespaces.
+<p>After talking about namespaces in general, you may be wondering about
+anonymous namespaces in particular.
 Anonymous namespaces are a great language feature that tells the C++ compiler
 that the contents of the namespace are only visible within the current
 translation unit, allowing more aggressive optimization and eliminating the
@@ -1186,7 +1193,7 @@
 of a large C++ file, that you have no immediate way to tell if it is local to
 the file.  When it is marked static explicitly, this is immediately obvious.
 Also, there is no reason to enclose the definition of "operator<" in the
-namespace since it was declared there.
+namespace just because it was declared there.
 </p>
 
 </div>





More information about the llvm-commits mailing list