projects
/
oota-llvm.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Recommit r246175 - Add Kaleidoscope regression tests, with a fix to make sure
[oota-llvm.git]
/
examples
/
Kaleidoscope
/
Chapter7
/
toy.cpp
diff --git
a/examples/Kaleidoscope/Chapter7/toy.cpp
b/examples/Kaleidoscope/Chapter7/toy.cpp
index 4558522952ce26d405745f2c8c1f3e426d349ccd..d61d880e5403b529cc62ff5c4d4a5106caf18ed5 100644
(file)
--- a/
examples/Kaleidoscope/Chapter7/toy.cpp
+++ b/
examples/Kaleidoscope/Chapter7/toy.cpp
@@
-1189,14
+1189,14
@@
static void MainLoop() {
//===----------------------------------------------------------------------===//
/// putchard - putchar that takes a double and returns 0.
//===----------------------------------------------------------------------===//
/// 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.
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;
}
return 0;
}