diff --git a/llvm/docs/ORCv2.rst b/llvm/docs/ORCv2.rst --- a/llvm/docs/ORCv2.rst +++ b/llvm/docs/ORCv2.rst @@ -124,7 +124,7 @@ return EntrySym.takeError(); // Cast the entry point address to a function pointer. - auto *Entry = (void(*)())EntrySym.getAddress(); + auto *Entry = EntrySym.getAddress().toPtr(); // Call into JIT'd code. Entry(); @@ -204,7 +204,7 @@ // Look up the JIT'd main, cast it to a function pointer, then call it. auto MainSym = ExitOnErr(ES.lookup({&MainJD}, "main")); - auto *Main = (int(*)(int, char*[]))MainSym.getAddress(); + auto *Main = MainSym.getAddress().toPtr(); int Result = Main(...); diff --git a/llvm/docs/tutorial/BuildingAJIT1.rst b/llvm/docs/tutorial/BuildingAJIT1.rst --- a/llvm/docs/tutorial/BuildingAJIT1.rst +++ b/llvm/docs/tutorial/BuildingAJIT1.rst @@ -77,7 +77,7 @@ JIT J; J.addModule(buildModule()); - auto *Main = (int(*)(int, char*[]))J.lookup("main").getAddress(); + auto *Main = J.lookup("main").getAddress().toPtr(); 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 --- a/llvm/docs/tutorial/MyFirstLanguageFrontend/LangImpl04.rst +++ b/llvm/docs/tutorial/MyFirstLanguageFrontend/LangImpl04.rst @@ -317,7 +317,7 @@ // 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(); fprintf(stderr, "Evaluated to %f\n", FP()); // Delete the anonymous expression module from the JIT.