aboutsummaryrefslogtreecommitdiff
path: root/llvm/docs/tutorial
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/docs/tutorial')
-rw-r--r--llvm/docs/tutorial/BuildingAJIT1.rst2
-rw-r--r--llvm/docs/tutorial/MyFirstLanguageFrontend/LangImpl04.rst2
2 files changed, 2 insertions, 2 deletions
diff --git a/llvm/docs/tutorial/BuildingAJIT1.rst b/llvm/docs/tutorial/BuildingAJIT1.rst
index 8c82dbe..8d79eb9 100644
--- a/llvm/docs/tutorial/BuildingAJIT1.rst
+++ b/llvm/docs/tutorial/BuildingAJIT1.rst
@@ -77,7 +77,7 @@ will look like:
JIT J;
J.addModule(buildModule());
- auto *Main = (int(*)(int, char*[]))J.lookup("main").getAddress();
+ auto *Main = J.lookup("main").getAddress().toPtr<int(*)(int, char *[])>();
int Result = Main();
The APIs that we build in these tutorials will all be variations on this simple
diff --git a/llvm/docs/tutorial/MyFirstLanguageFrontend/LangImpl04.rst b/llvm/docs/tutorial/MyFirstLanguageFrontend/LangImpl04.rst
index 32db7b5..79bb1f1 100644
--- a/llvm/docs/tutorial/MyFirstLanguageFrontend/LangImpl04.rst
+++ b/llvm/docs/tutorial/MyFirstLanguageFrontend/LangImpl04.rst
@@ -317,7 +317,7 @@ look like this:
// Get the symbol's address and cast it to the right type (takes no
// arguments, returns a double) so we can call it as a native function.
- double (*FP)() = (double (*)())(intptr_t)ExprSymbol.getAddress();
+ double (*FP)() = ExprSymbol.getAddress().toPtr<double (*)()>();
fprintf(stderr, "Evaluated to %f\n", FP());
// Delete the anonymous expression module from the JIT.