From d8f8ede5ebebf56201d30ac9fe287ac5b8902637 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Tue, 25 Jun 2002 18:03:17 +0000 Subject: [PATCH] Minor tuning and fleshing out of the language reference. llvm-svn: 2781 --- llvm/docs/LangRef.html | 137 ++++++++++++++++++++++++++--------------- 1 file changed, 88 insertions(+), 49 deletions(-) diff --git a/llvm/docs/LangRef.html b/llvm/docs/LangRef.html index 926d8dca3467..0e56ffd0dc59 100644 --- a/llvm/docs/LangRef.html +++ b/llvm/docs/LangRef.html @@ -91,10 +91,11 @@
- This document describes the LLVM assembly language. LLVM is an SSA based - representation that is a useful midlevel IR, providing type safety, low level - operations, flexibility, and the capability of representing 'all' high level - languages cleanly. + This document is a reference manual for the LLVM assembly language. LLVM is + an SSA based representation that provides type safety, low level operations, + flexibility, and the capability of representing 'all' high level languages + cleanly. It is the common code representation used throughout all phases of + the LLVM compilation strategy.
@@ -138,15 +139,14 @@ syntactically okay, but not well formed:

%x = add int 1, %x -...because only a phi node may refer to itself. -The LLVM api provides a verification pass (created by the -createVerifierPass function) that may be used to verify that an LLVM -module is well formed. This pass is automatically run by the parser after +...because the definition of %x does not dominate all of its uses. The LLVM +infrastructure provides a verification pass that may be used to verify that an +LLVM module is well formed. This pass is automatically run by the parser after parsing input assembly, and by the optimizer before it outputs bytecode. The violations pointed out by the verifier pass indicate bugs in transformation passes or input to the parser.

-Describe the typesetting conventions here. + @@ -193,8 +193,8 @@ After strength reduction: And the hard way:

-  add uint %X, %X           ; yields {int}:%0
-  add uint %0, %0           ; yields {int}:%1
+  add uint %X, %X           ; yields {uint}:%0
+  add uint %0, %0           ; yields {uint}:%1
   %result = add uint %1, %1
 
@@ -238,9 +238,9 @@ before the transformation. A strong type system makes it easier to read the generated code and enables novel analyses and transformations that are not feasible to perform on normal three address code representations.

-The written form for the type system was heavily influenced by the syntactic -problems with types in the C language1.

+ @@ -392,8 +392,9 @@ LLVM.

Overview:
The structure type is used to represent a collection of data members together in -memory. Although the runtime is allowed to lay out the data members any way -that it would like, they are guaranteed to be "close" to each other.

+memory. The packing of the field types is defined to match the ABI of the +underlying processor. The elements of a structure may be any type that has a +size.

Structures are accessed using 'load and 'store' by getting a pointer to a field with the 'getelementptr' instruction.

{ int, int, int }: a triple of three int values -{ float, int (int *) * }: A pair, where the first +{ float, int (int) * }: A pair, where the first element is a float and the second element is a pointer to a function that takes an int, returning an int. @@ -505,14 +506,14 @@ In general, a module is made up of a list of global values, where both functions and global variables are global values. Global values are represented by a pointer to a memory location (in this case, a pointer to an array of char, and a pointer to a function), and can be either "internal" or externally accessible -(which corresponds to the static keyword in C, when used at function scope).

+(which corresponds to the static keyword in C, when used at global scope).

For example, since the ".LC0" variable is defined to be internal, if another module defined a ".LC0" variable and was linked with this one, one of the two would be renamed, preventing a collision. Since "main" -and "puts" are external (lacking "internal" declarations), -they are accessible outside of the current module. It is illegal for a function -declaration to be "internal".

+and "puts" are external (i.e., lacking "internal" +declarations), they are accessible outside of the current module. It is illegal +for a function declaration to be "internal".

@@ -522,15 +523,15 @@ declaration to be "internal".