diff options
author | Eric Christopher <echristo@apple.com> | 2010-06-14 06:03:16 +0000 |
---|---|---|
committer | Eric Christopher <echristo@apple.com> | 2010-06-14 06:03:16 +0000 |
commit | 95f5652e2d14b1d2a32c25c6791598dee12d901c (patch) | |
tree | e291f4be6195255de9e58e21e16f3216ef9378e1 /llvm/examples/Kaleidoscope/Chapter4/toy.cpp | |
parent | 2d7b10cc97cd48f410669cbaa3cefe8d0dbc8ce8 (diff) | |
download | bcm5719-llvm-95f5652e2d14b1d2a32c25c6791598dee12d901c.tar.gz bcm5719-llvm-95f5652e2d14b1d2a32c25c6791598dee12d901c.zip |
Make kaleidoscope use fp add/sub/mul.
Patch by Patrick Flannery!
llvm-svn: 105932
Diffstat (limited to 'llvm/examples/Kaleidoscope/Chapter4/toy.cpp')
-rw-r--r-- | llvm/examples/Kaleidoscope/Chapter4/toy.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/examples/Kaleidoscope/Chapter4/toy.cpp b/llvm/examples/Kaleidoscope/Chapter4/toy.cpp index a2ddda2e916..c88a76f4229 100644 --- a/llvm/examples/Kaleidoscope/Chapter4/toy.cpp +++ b/llvm/examples/Kaleidoscope/Chapter4/toy.cpp @@ -374,9 +374,9 @@ Value *BinaryExprAST::Codegen() { if (L == 0 || R == 0) return 0; switch (Op) { - case '+': return Builder.CreateAdd(L, R, "addtmp"); - case '-': return Builder.CreateSub(L, R, "subtmp"); - case '*': return Builder.CreateMul(L, R, "multmp"); + case '+': return Builder.CreateFAdd(L, R, "addtmp"); + case '-': return Builder.CreateFSub(L, R, "subtmp"); + case '*': return Builder.CreateFMul(L, R, "multmp"); case '<': L = Builder.CreateFCmpULT(L, R, "cmptmp"); // Convert bool 0/1 to double 0.0 or 1.0 |