diff options
Diffstat (limited to 'llvm/examples/Kaleidoscope/Chapter8')
-rw-r--r-- | llvm/examples/Kaleidoscope/Chapter8/CMakeLists.txt | 2 | ||||
-rw-r--r-- | llvm/examples/Kaleidoscope/Chapter8/toy.cpp | 4 |
2 files changed, 4 insertions, 2 deletions
diff --git a/llvm/examples/Kaleidoscope/Chapter8/CMakeLists.txt b/llvm/examples/Kaleidoscope/Chapter8/CMakeLists.txt index e335cb48ac7..d9b5cc421be 100644 --- a/llvm/examples/Kaleidoscope/Chapter8/CMakeLists.txt +++ b/llvm/examples/Kaleidoscope/Chapter8/CMakeLists.txt @@ -9,3 +9,5 @@ set(LLVM_LINK_COMPONENTS add_kaleidoscope_chapter(Kaleidoscope-Ch8 toy.cpp ) + +export_executable_symbols(Kaleidoscope-Ch8) diff --git a/llvm/examples/Kaleidoscope/Chapter8/toy.cpp b/llvm/examples/Kaleidoscope/Chapter8/toy.cpp index 7338c6ebc50..b78d901db2d 100644 --- a/llvm/examples/Kaleidoscope/Chapter8/toy.cpp +++ b/llvm/examples/Kaleidoscope/Chapter8/toy.cpp @@ -1384,13 +1384,13 @@ static void MainLoop() { /// putchard - putchar that takes a double and returns 0. extern "C" double putchard(double X) { - putchar((char)X); + fputc((char)X, stderr); return 0; } /// printd - printf that takes a double prints it as "%f\n", returning 0. extern "C" double printd(double X) { - printf("%f\n", X); + fprintf(stderr, "%f\n", X); return 0; } |