aboutsummaryrefslogtreecommitdiff
path: root/llvm/docs/tutorial/MyFirstLanguageFrontend
diff options
context:
space:
mode:
authorJim Lin <jim@andestech.com>2021-06-09 17:36:17 +0800
committerJim Lin <jim@andestech.com>2021-06-09 17:39:11 +0800
commit391f9ef1aa8b28ef8bad4486576477c0700e43e9 (patch)
tree70877b0004b91b64e3f8b708f689e351b637a9e2 /llvm/docs/tutorial/MyFirstLanguageFrontend
parent82f8aef3deb196ad323a3ef57c03276c6e93a246 (diff)
downloadllvm-391f9ef1aa8b28ef8bad4486576477c0700e43e9.zip
llvm-391f9ef1aa8b28ef8bad4486576477c0700e43e9.tar.gz
llvm-391f9ef1aa8b28ef8bad4486576477c0700e43e9.tar.bz2
[docs] Fix load instructions in chapter 7 of the tutorial
Loads in the first half of the chapter are missing the type argument. Patched By: klao (Mihaly Barasz) Reviewed By: Jim Differential Revision: https://reviews.llvm.org/D90326
Diffstat (limited to 'llvm/docs/tutorial/MyFirstLanguageFrontend')
-rw-r--r--llvm/docs/tutorial/MyFirstLanguageFrontend/LangImpl07.rst16
1 files changed, 8 insertions, 8 deletions
diff --git a/llvm/docs/tutorial/MyFirstLanguageFrontend/LangImpl07.rst b/llvm/docs/tutorial/MyFirstLanguageFrontend/LangImpl07.rst
index 9ae3972..a033dc2 100644
--- a/llvm/docs/tutorial/MyFirstLanguageFrontend/LangImpl07.rst
+++ b/llvm/docs/tutorial/MyFirstLanguageFrontend/LangImpl07.rst
@@ -63,11 +63,11 @@ two values. The LLVM IR that we want for this example looks like this:
br i1 %Condition, label %cond_true, label %cond_false
cond_true:
- %X.0 = load i32* @G
+ %X.0 = load i32, i32* @G
br label %cond_next
cond_false:
- %X.1 = load i32* @H
+ %X.1 = load i32, i32* @H
br label %cond_next
cond_next:
@@ -126,7 +126,7 @@ instruction <../../LangRef.html#alloca-instruction>`_:
entry:
%X = alloca i32 ; type of %X is i32*.
...
- %tmp = load i32* %X ; load the stack value %X from the stack.
+ %tmp = load i32, i32* %X ; load the stack value %X from the stack.
%tmp2 = add i32 %tmp, 1 ; increment it
store i32 %tmp2, i32* %X ; store it back
...
@@ -149,17 +149,17 @@ using a PHI node:
br i1 %Condition, label %cond_true, label %cond_false
cond_true:
- %X.0 = load i32* @G
+ %X.0 = load i32, i32* @G
store i32 %X.0, i32* %X ; Update X
br label %cond_next
cond_false:
- %X.1 = load i32* @H
+ %X.1 = load i32, i32* @H
store i32 %X.1, i32* %X ; Update X
br label %cond_next
cond_next:
- %X.2 = load i32* %X ; Read X
+ %X.2 = load i32, i32* %X ; Read X
ret i32 %X.2
}
@@ -191,11 +191,11 @@ example through the pass, for example, you'll get:
br i1 %Condition, label %cond_true, label %cond_false
cond_true:
- %X.0 = load i32* @G
+ %X.0 = load i32, i32* @G
br label %cond_next
cond_false:
- %X.1 = load i32* @H
+ %X.1 = load i32, i32* @H
br label %cond_next
cond_next: