From 4cc2be672f5ac66c53389bcf5e7dc8ad45c5fd88 Mon Sep 17 00:00:00 2001 From: Bill Wendling Date: Wed, 14 Mar 2012 08:07:43 +0000 Subject: [PATCH] Update the "hello world" example to resemble what we currently output. Also do some minor reformatting. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152707 91177308-0d34-0410-b5e6-96231b3b80d8 --- docs/LangRef.html | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/docs/LangRef.html b/docs/LangRef.html index 008ae6a67f7..6ff0f5e7be2 100644 --- a/docs/LangRef.html +++ b/docs/LangRef.html @@ -490,43 +490,43 @@
-

LLVM programs are composed of "Module"s, each of which is a translation unit - of the input programs. Each module consists of functions, global variables, - and symbol table entries. Modules may be combined together with the LLVM - linker, which merges function (and global variable) definitions, resolves - forward declarations, and merges symbol table entries. Here is an example of - the "hello world" module:

+

LLVM programs are composed of Modules, each of which is a + translation unit of the input programs. Each module consists of functions, + global variables, and symbol table entries. Modules may be combined together + with the LLVM linker, which merges function (and global variable) + definitions, resolves forward declarations, and merges symbol table + entries. Here is an example of the "hello world" module:

 ; Declare the string constant as a global constant. 
-@.LC0 = internal constant [13 x i8] c"hello world\0A\00"      ; [13 x i8]* 
+@.str = private unnamed_addr constant [13 x i8] c"hello world\0A\00" 
 
 ; External declaration of the puts function 
-declare i32 @puts(i8*)                                      ; i32 (i8*)*  
+declare i32 @puts(i8* nocapture) nounwind 
 
 ; Definition of main function
 define i32 @main() {   ; i32()*  
   ; Convert [13 x i8]* to i8  *... 
-  %cast210 = getelementptr [13 x i8]* @.LC0, i64 0, i64 0   ; i8* 
+  %cast210 = getelementptr [13 x i8]* @.str, i64 0, i64 0
 
   ; Call puts function to write out the string to stdout. 
-  call i32 @puts(i8* %cast210)           ; i32 
+  call i32 @puts(i8* %cast210)
   ret i32 0 
 }
 
 ; Named metadata
-!1 = metadata !{i32 41}
+!1 = metadata !{i32 42}
 !foo = !{!1, null}
 

This example is made up of a global variable named - ".LC0", an external declaration of the "puts" function, + ".str", an external declaration of the "puts" function, a function definition for "main" and named metadata - "foo".

+ "foo".

-

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 +

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 have one of the following linkage types.