summaryrefslogtreecommitdiffstats
path: root/llvm/examples/Kaleidoscope/Chapter8/toy.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/examples/Kaleidoscope/Chapter8/toy.cpp')
-rw-r--r--llvm/examples/Kaleidoscope/Chapter8/toy.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/llvm/examples/Kaleidoscope/Chapter8/toy.cpp b/llvm/examples/Kaleidoscope/Chapter8/toy.cpp
index 7338c6ebc50..5f97a157336 100644
--- a/llvm/examples/Kaleidoscope/Chapter8/toy.cpp
+++ b/llvm/examples/Kaleidoscope/Chapter8/toy.cpp
@@ -1383,14 +1383,14 @@ static void MainLoop() {
//===----------------------------------------------------------------------===//
/// putchard - putchar that takes a double and returns 0.
-extern "C" double putchard(double X) {
- putchar((char)X);
+__attribute__((used)) extern "C" double putchard(double 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);
+__attribute__((used)) extern "C" double printd(double X) {
+ fprintf(stderr, "%f\n", X);
return 0;
}
OpenPOWER on IntegriCloud