Permalink
Browse files

added creatFNeg for DoubleType negation, removed call to browser

  • Loading branch information...
1 parent ce21294 commit a3cad790a74af765df9f8df1bc1cd1266607966b @vsbuffalo committed Apr 4, 2012
Showing with 20 additions and 1 deletion.
  1. +1 −0 NAMESPACE
  2. +8 −0 R/IRBuilder.R
  3. +0 −1 R/value.R
  4. +11 −0 src/IRBuilder.cpp
View
@@ -62,6 +62,7 @@ createLoad,
createLocalArrayVariable,
createLocalVariable,
createNeg,
+createFNeg,
createNot,
createRet,
createReturn,
View
@@ -73,6 +73,14 @@ function(builder, val, id = character())
.Call("R_IRBuilder_CreateNeg", builder, val)
}
+
+createFNeg =
+function(builder, val, id = character())
+{
+ .Call("R_IRBuilder_CreateFNeg", builder, val)
+}
+
+
createNot =
function(builder, val, id = character())
{
View
@@ -10,7 +10,6 @@ setGeneric("getType",
setMethod("getType", "Value",
function(obj, ...) {
ans = .Call("R_Value_getType", obj)
- browser()
ans
})
View
@@ -185,6 +185,17 @@ R_IRBuilder_CreateNeg(SEXP r_builder, SEXP r_val)
return(R_createRef(ans, "Value"));
}
+extern "C"
+SEXP
+R_IRBuilder_CreateFNeg(SEXP r_builder, SEXP r_val)
+{
+ llvm::IRBuilder<> *builder;
+ builder = GET_REF(r_builder, IRBuilder<>);
+ llvm::Value *val = GET_REF(r_val, Value);
+ llvm::Value * ans = builder->CreateFNeg(val);
+ return(R_createRef(ans, "Value"));
+}
+
extern "C"
SEXP
R_IRBuilder_CreateUIToFP(SEXP r_builder, SEXP r_val, SEXP r_type)

0 comments on commit a3cad79

Please sign in to comment.