Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

moved to git

  • Loading branch information...
commit bf6f7e584726457b9e093b15e2e13c274dfb05a7 0 parents
@duncantl authored
Showing with 339,169 additions and 0 deletions.
  1. +15 −0 .Rbuildignore
  2. +42 −0 Changelog
  3. +13 −0 Classes
  4. +23 −0 DESCRIPTION
  5. +12 −0 FAQ.xml
  6. +214 −0 NAMESPACE
  7. +23 −0 R/BinaryOpEnums.R
  8. +51 −0 R/ExecutionEngine.R
  9. +122 −0 R/Function.R
  10. +44 −0 R/ICmpEnums.R
  11. +288 −0 R/IRBuilder.R
  12. +62 −0 R/TypeID.R
  13. +15 −0 R/block.R
  14. +64 −0 R/classDefs.R
  15. +53 −0 R/constants.R
  16. +8 −0 R/context.R
  17. +21 −0 R/dso.R
  18. +14 −0 R/externalLinkage.R
  19. +21 −0 R/globalVar.R
  20. +71 −0 R/module.R
  21. +23 −0 R/onLoad.R
  22. +12 −0 R/typeDefs.R
  23. +54 −0 R/types.R
  24. +16 −0 R/value.R
  25. +117 −0 Todo.xml
  26. +45 −0 VinceQues
  27. +39 −0 Web/FAQ.html
  28. +32 −0 Web/GNUmakefile
  29. +2,832 −0 Web/autom4te.cache/output.0
  30. +75 −0 Web/autom4te.cache/requests
  31. +178 −0 Web/autom4te.cache/traces.0
  32. +162 −0 Web/config.log
  33. +894 −0 Web/config.status
  34. +2,832 −0 Web/configure
  35. +18 −0 Web/configure.in
  36. +151 −0 Web/index.html
  37. +151 −0 Web/index.html.in
  38. +230 −0 config.log
  39. +758 −0 config.status
  40. +3,347 −0 configure
  41. +29 −0 configure.in
  42. +3 −0  ctests/GNUmakefile
  43. +77 −0 ctests/parms.cc
  44. +7 −0 experiments/GNUmakefile
  45. BIN  experiments/add.bc
  46. +6 −0 experiments/add.c
  47. +95 −0 experiments/add.cpp
  48. +9 −0 experiments/add.ll
  49. +95 −0 experiments/add.llcpp
  50. BIN  experiments/add.o
  51. +11 −0 experiments/add.s
  52. +8 −0 experiments/add1.c
  53. +119 −0 experiments/add1.llcpp
  54. +38 −0 experiments/catchError.R
  55. +10 −0 experiments/constFold.c
  56. +198 −0 experiments/constFold.llcpp
  57. +95 −0 experiments/constFolding.R
  58. +26 −0 experiments/createLoop.R
  59. BIN  experiments/not.bc
  60. +5 −0 experiments/not.c
  61. +111 −0 experiments/not.llcpp
  62. +46 −0 experiments/optimization.R
  63. +51 −0 experiments/optimize.R
  64. BIN  experiments/whileReturn.bc
  65. +11 −0 experiments/whileReturn.c
  66. +140 −0 experiments/whileReturn.llcpp
  67. +7 −0 inst/TU/GNUmakefile
  68. +457 −0 inst/TU/classNames
  69. +30 −0 inst/TU/llvm.c
  70. +319,586 −0 inst/TU/llvm.c.001t.tu
  71. +41 −0 inst/TU/tu.R
  72. +48 −0 man/Block.Rd
  73. +39 −0 man/ExecutionEngine.Rd
  74. +68 −0 man/Function.Rd
  75. +59 −0 man/IRBuilder.Rd
  76. +31 −0 man/InitializeNativeTarget.Rd
  77. +41 −0 man/Module.Rd
  78. +77 −0 man/RC++Reference-class.Rd
  79. +38 −0 man/VoidType.Rd
  80. +58 −0 man/binOp.Rd
  81. +44 −0 man/createGlobalVariable.Rd
  82. +73 −0 man/createICmp.Rd
  83. +34 −0 man/createIsNotNull.Rd
  84. +33 −0 man/getGlobalContext.Rd
  85. +55 −0 man/getLogicalConstant.Rd
  86. +41 −0 man/getModuleFunctions.Rd
  87. +44 −0 man/getPassManager.Rd
  88. +52 −0 man/llvmAddSymbol.Rd
  89. +29 −0 src/Block.cpp
  90. +24 −0 src/CallInst.cpp
  91. +44 −0 src/Constants.cpp
  92. +100 −0 src/ExecEngine.cpp
  93. BIN  src/ExecEngine.o
  94. +129 −0 src/Function.cpp
  95. +525 −0 src/IRBuilder.cpp
  96. +4 −0 src/Makevars
  97. +4 −0 src/Makevars.in
  98. +259 −0 src/Module.cpp
  99. +45 −0 src/Rllvm.h
  100. +8 −0 src/Twine.cpp
  101. +20 −0 src/Utils.cpp
  102. +54 −0 src/Value.cpp
  103. +115 −0 src/conveters.cpp
  104. +36 −0 src/dynamicLib.cpp
  105. +22 −0 src/globalVar.cpp
  106. +138 −0 src/myGlobal.cpp
  107. +56 −0 src/optimize.cpp
  108. +9 −0 src/runif.cpp
  109. +123 −0 src/types.cpp
  110. +361 −0 tests/#cumsum.Rdb#
  111. +5 −0 tests/GNUmakefile
  112. +361 −0 tests/cumsum.Rdb
  113. +133 −0 tests/extCall.Rdb
  114. +14 −0 tests/fpConstant.R
  115. +41 −0 tests/global.R
  116. +105 −0 tests/globalVars.Rdb
  117. +204 −0 tests/rffiCall.Rdb
  118. +32 −0 tests/rw1.R
  119. +345 −0 tests/rw2d.Rdb
  120. +18 −0 tests/store.R
  121. +24 −0 tests/store1.R
  122. +24 −0 tests/store2.R
  123. +71 −0 tests/strings.Rdb
  124. +40 −0 tests/tut1.R
  125. +54 −0 tests/tut2.R
  126. +291 −0 tests/xPlus1.Rdb
  127. +14 −0 types.R
15 .Rbuildignore
@@ -0,0 +1,15 @@
+#*~
+config.log
+config.status
+.*Web
+GNUmakefile
+inst/doc/old.xml
+.*Rllvm.Rcheck
+.*autom4te.cache
+\.\.Rcheck.*
+Rplots.ps
+tests/.*.o
+.*\.tar\.gz
+Experiments
+.*.tcp
+.*.cache.*
42 Changelog
@@ -0,0 +1,42 @@
+Version 0.4-0
+
+ * Added getDescription() and method for Type and getTypeID(), getScalarType().
+
+Version 0.3-0
+
+ * The package automatically calls InitializeNativeTarget()
+ unless the R option Rllvm.autoInitialize is set to FALSE
+ before the package is loaded.
+
+ * Added getTerminator(), getInsertBlock()
+
+ * Implemented getting logical constants for TRUE and FALSE.
+
+Version 0.2-1
+
+ * Method for Optimize referred to a free variable rather than
+ a parameter.
+
+ * Added getModuleFunctions(), getBlocks(), getPassManager()
+
+Version 0.2-0
+
+ * The Optimize function and methods are now extended and
+ apply to the code via creating a FunctionPassManager and
+ invoking its run() method (in C++ for now).
+ This can work on modules or individual functions.
+
+ * getModuleFunctions() allows us to get the list of functions
+ in a module.
+
+ * showModule() returns the content as a string, but can also
+ write on the console/stdout().
+ We might make it possible to write to a connection in the
+ future.
+
+ * Additional examples in experiments/ that show constant
+ folding, avoiding temporary variables.
+
+Version 0.1-0
+
+ * Addition to configuration to check suitable version of llvm available on the machine.
13 Classes
@@ -0,0 +1,13 @@
+Module
+Function
+Value
+BasicBlock
+IRBuilder
+
+Context
+
+
+Collector for the generated code to see the IR.
+
+
+Type objects
23 DESCRIPTION
@@ -0,0 +1,23 @@
+Package: Rllvm
+Version: 0.3-0
+Title: Interface to llvm for creating native functions
+Author: Duncan Temple Lang
+SystemRequirements: llvm (>= 2.7)
+Maintainer: Duncan Temple Lang <duncan@wald.ucdavis.edu>
+Description: This package is currently an interface to some of the
+ functionality in the llvm toolkit for programmaticall constructing native code.
+ This allows us to build "compilers" in R and use llvm's optmization and JIT techniques
+ to improve the code we generate and then turn it into machine code.
+ This is currently not a compiler. There are examples that illustrate how
+ to generate code to create native functions that are equivalent to
+ some simple R functions. The goal is to build on this and create a compiler,
+ hopefully building on the framework that Luke Tierney has created in his
+ compiler package (see http://www.cs.uiowa.edu/~luke/R/compiler/).
+ The speed up we achieve in our examples
+License: GPL2
+Depends: R (>= 2.7.0), methods, RAutoGenRunTime
+URL: http://www.omegahat.org/Rllvm
+Note: We hope to build on this to build a compiler for R.
+Collate: classDefs.R BinaryOpEnums.R Function.R block.R module.R typeDefs.R
+ ExecutionEngine.R IRBuilder.R onLoad.R ICmpEnums.R types.R constants.R
+ externalLinkage.R globalVar.R value.R dso.R context.R TypeID.R
12 FAQ.xml
@@ -0,0 +1,12 @@
+<faq>
+<q>
+I get errors of the form
+<quote>
+ failed to create execution engine: Unable to find target for this triple (no targets are registered)
+</quote>
+What's the problem?
+<a>
+You need to call InitializeNativeTarget() before creating the execution engine.
+</a>
+</q>
+</faq>
214 NAMESPACE
@@ -0,0 +1,214 @@
+useDynLib(Rllvm)
+
+import(methods)
+
+exportClasses(AllocaInst,
+ BasicBlock,
+ BranchInst,
+ CallInst,
+ CastInst,
+ CompositeType,
+ Constant,
+ ConstantFP,
+ ConstantInt,
+ DerivedType,
+ ExecutionEngine,
+ Function,
+ GetElementPtrInst,
+ Instruction,
+ IRBuilder,
+ LLVMContext,
+ LoadInst,
+ Module,
+ ParameterList,
+ PointerType,
+ 'RC++Reference',
+ ReturnInst,
+ SequentialType,
+ SExtInst,
+ StoreInst,
+ StructType,
+ TerminatorInst,
+ Type,
+ UnaryInstruction,
+ UnionType,
+ User,
+ Value,
+ FunctionPassManager,
+ BinaryOperator)
+
+exportMethods("$", "names", "names<-", "run", "setName", "getName", "$",
+ createIntegerConstant, coerce)
+
+export(
+Add,
+And,
+AShr,
+BAD_FCMP_PREDICATE,
+BAD_ICMP_PREDICATE,
+BinaryOps,
+binOp,
+Block,
+createBr,
+createCall,
+createCondBr,
+createConstant,
+createFloatingPointConstant,
+createGEP,
+createICmp,
+createFCmp,
+createIntegerConstant,
+createLoad,
+createLocalArrayVariable,
+createLocalVariable,
+createNeg,
+createNot,
+createRet,
+createReturn,
+createReturnVoid,
+createRetVoid,
+createSExt,
+createStore,
+createUIToFP,
+DoublePtrType,
+DoubleType,
+ExecutionEngine,
+FAdd,
+FCMP_FALSE,
+FCMP_OEQ,
+FCMP_OGE,
+FCMP_OGT,
+FCMP_OLE,
+FCMP_OLT,
+FCMP_ONE,
+FCMP_ORD,
+FCMP_TRUE,
+FCMP_UEQ,
+FCMP_UGE,
+FCMP_UGT,
+FCMP_ULE,
+FCMP_ULT,
+FCMP_UNE,
+FCMP_UNO,
+FDiv,
+FIRST_FCMP_PREDICATE,
+FIRST_ICMP_PREDICATE,
+FloatPtrType,
+FloatType,
+FMul,
+FRem,
+FSub,
+Function,
+getGlobalContext,
+createLogicalConstant,
+getName,
+getParameters,
+ICMP_EQ,
+ICMP_NE,
+ICMP_SGE,
+ICMP_SGT,
+ICMP_SLE,
+ICMP_SLT,
+ICMP_UGE,
+ICMP_UGT,
+ICMP_ULE,
+ICMP_ULT,
+ICmpInst.Predicate,
+InitializeNativeTarget,
+Int16Type,
+Int1Type,
+Int32PtrType,
+Int32Type,
+Int64Type,
+Int8Type,
+IRBuilder,
+isBasicType,
+LabelType,
+LAST_FCMP_PREDICATE,
+LAST_ICMP_PREDICATE,
+LShr,
+makeConstant,
+Module,
+Mul,
+Or,
+pointerType,
+run, .llvm,
+SDiv,
+setInsertPoint,
+getInsertBlock,
+setName,
+setTailCall,
+Shl,
+SRem,
+Sub,
+UDiv,
+URem,
+verifyModule,
+VoidType,
+Xor
+)
+
+
+export(createBitCast)
+export(createGlobalVariable, createGlobalVar)
+export(Optimize)
+exportMethods(Optimize)
+
+
+export(setLinkage)
+
+export(findFunction, getPointerToFunction)
+
+export(createDoubleConstant)
+
+export(showModule)
+
+
+
+export(ExternalLinkage,
+AvailableExternallyLinkage,
+LinkOnceAnyLinkage,
+LinkOnceODRLinkage,
+WeakAnyLinkage,
+WeakODRLinkage,
+AppendingLinkage,
+InternalLinkage,
+PrivateLinkage,
+LinkerPrivateLinkage,
+DLLImportLinkage,
+DLLExportLinkage,
+ExternalWeakLinkage,
+CommonLinkage)
+
+export(llvmAddSymbol, llvmLoadDLL)
+
+
+export(createGlobalString, createIsNull, createIsNotNull, createSelect,
+ createUnreachable, createUnwind)
+
+
+
+#export(getModule)
+
+export(getModuleFunctions)
+export(getPassManager)
+export(getBlocks)
+
+export(getTerminator)
+export(getGlobalVariable)
+export(getCalledFunction, getReturnType, getType)
+
+
+export(createNeg, createNot)
+exportMethods(createNeg, createNot)
+
+export(getFalse, getTrue)
+
+
+
+export(getScalarType, getDescription)
+exportMethods(getDescription)
+
+export(isVoidType, isFloatType, isDoubleType, isX86_FP80Type, isFP128Type,
+ isPPC_FP128Type, isLabelType, isMetadataType, isIntegerType, isFunctionType,
+ isStructType, isArrayType, isPointerType, isOpaqueType, isVectorType)
23 R/BinaryOpEnums.R
@@ -0,0 +1,23 @@
+Add = 8
+FAdd = 9
+Sub = 10
+FSub = 11
+Mul = 12
+FMul = 13
+UDiv = 14
+SDiv = 15
+FDiv = 16
+URem = 17
+SRem = 18
+FRem = 19
+Shl = 20
+LShr = 21
+AShr = 22
+And = 23
+Or = 24
+Xor = 25
+
+
+BinaryOps = structure(8:25, .Names = c("Add", "FAdd", "Sub", "FSub", "Mul",
+"FMul", "UDiv", "SDiv", "FDiv", "URem", "SRem", "FRem", "Shl",
+"LShr", "AShr", "And", "Or", "Xor"))
51 R/ExecutionEngine.R
@@ -0,0 +1,51 @@
+ExecutionEngine =
+function(module)
+{
+ .Call("R_create_ExecutionEngine", module)
+}
+
+# Use the name .x so that we don't conflict with routines with parameters named x
+# which we want to name in our call, e.g for mutable parameters we want back.
+setGeneric("run",
+ function(.x, ...)
+ standardGeneric("run"))
+
+setMethod("run", "Function",
+ function(.x, ..., .args = list(...), .ee = ExecutionEngine(as(.x, "Module")), .all = FALSE) {
+ ans = .Call("R_callFunction", .x, .args, .ee)
+
+ if(.all)
+ append(ans, structure(.args, names = names(.args)))
+ else
+ ans
+ })
+
+
+.llvm = run
+
+
+InitializeNativeTarget =
+function()
+{
+ .C("R_InitializeNativeTarget")
+}
+
+
+
+getPointerToFunction =
+function(fun, execEngine)
+{
+ .Call("R_ExecutionEngine_getPointerToFunction", execEngine, fun)
+}
+
+getPointerToGlobal =
+function(var, execEngine)
+{
+ .Call("R_ExecutionEngine_getPointerToGlobal", execEngine, var)
+}
+
+findFunction =
+function(funcName, execEngine)
+{
+ .Call("R_ExecutionEngine_FindFunctionNamed", execEngine, as.character(funcName))
+}
122 R/Function.R
@@ -0,0 +1,122 @@
+
+Function =
+function(name, retType, paramTypes = list(), module)
+{
+
+ fun = .Call("R_createFunction", module, as.character(name), retType, paramTypes)
+
+ if(length(names(paramTypes)))
+ names(fun) = names(paramTypes)
+
+ fun
+}
+
+setMethod("names", c("Function"),
+ function(x) {
+ .Call("R_getFunctionParamNames", x)
+ })
+
+setMethod("names<-", c("Function", "character"),
+ function(x, value) {
+ params = getParameters(x)
+ names(params) = value
+ x
+ })
+
+setMethod("names<-", c("ParameterList", "character"),
+ function(x, value) {
+ mapply(setName, x, value)
+ x
+ })
+
+setGeneric("setName",
+function(obj, name, ...)
+ standardGeneric("setName"))
+
+setGeneric("getName",
+function(obj, ...)
+ standardGeneric("getName"))
+
+setMethod("setName", "Value",
+ function(obj, name)
+ .Call("R_Value_setName", obj, as.character(name)))
+
+setMethod("getName", "Value",
+ function(obj, name)
+ .Call("R_Value_getName", obj))
+
+
+getParameters =
+function(fun, addNames = TRUE)
+{
+ els = .Call("R_getFunctionArgs", fun)
+ ans = new("ParameterList", els)
+ if(addNames)
+ names(ans) = lapply(ans, getName)
+ ans
+}
+
+setMethod("$", "Function",
+ function(x, name) {
+ getParameters(x)[[name]]
+ })
+
+
+setLinkage =
+function(obj, val)
+{
+ .Call("R_Function_setLinkage", obj, as.integer(val))
+}
+
+
+setGeneric("getModule", function(obj, ...)
+ standardGeneric("getModule"))
+
+setMethod("getModule", "Function",
+ function(obj, ...)
+ .Call("R_GlobalValue_getParent", obj))
+
+setAs("Function", "Module",
+ function(from)
+ getModule(from))
+
+if(FALSE) # not needed
+setAs("Function", "Module",
+ function(from) {
+ .Call("R_Function_getParent", from)
+ })
+
+
+getBlocks =
+function(fun)
+{
+ .Call("R_Function_getBasicBlockList", fun)
+}
+
+
+setGeneric("getReturnType",
+ function(obj, ...)
+ standardGeneric("getReturnType"))
+
+setMethod("getReturnType",
+ "Function",
+ function(obj, ...)
+ .Call("R_Function_getReturnType", obj))
+
+
+setMethod("getReturnType",
+ "CallInst",
+ function(obj, ...)
+ .Call("R_Function_getReturnType", getCalledFunction(obj)))
+
+
+setGeneric("getCalledFunction",
+ function(obj, ...)
+ standarGeneric("getCalledFunction"))
+
+setMethod("getCalledFunction", "CallInst",
+ function(obj, ...)
+ .Call("R_CallInst_getCalledFunction", obj))
+
+
+
44 R/ICmpEnums.R
@@ -0,0 +1,44 @@
+FCMP_FALSE = 0
+FCMP_OEQ = 1
+FCMP_OGT = 2
+FCMP_OGE = 3
+FCMP_OLT = 4
+FCMP_OLE = 5
+FCMP_ONE = 6
+FCMP_ORD = 7
+FCMP_UNO = 8
+FCMP_UEQ = 9
+FCMP_UGT = 10
+FCMP_UGE = 11
+FCMP_ULT = 12
+FCMP_ULE = 13
+FCMP_UNE = 14
+FCMP_TRUE = 15
+FIRST_FCMP_PREDICATE = 0
+LAST_FCMP_PREDICATE = 15
+BAD_FCMP_PREDICATE = 16
+ICMP_EQ = 32
+ICMP_NE = 33
+ICMP_UGT = 34
+ICMP_UGE = 35
+ICMP_ULT = 36
+ICMP_ULE = 37
+ICMP_SGT = 38
+ICMP_SGE = 39
+ICMP_SLT = 40
+ICMP_SLE = 41
+FIRST_ICMP_PREDICATE = 32
+LAST_ICMP_PREDICATE = 41
+BAD_ICMP_PREDICATE = 42
+
+
+ICmpInst.Predicate = structure(c(0L, 1L, 2L, 3L, 4L, 5L, 6L, 7L, 8L, 9L, 10L, 11L,
+12L, 13L, 14L, 15L, 0L, 15L, 16L, 32L, 33L, 34L, 35L, 36L, 37L,
+38L, 39L, 40L, 41L, 32L, 41L, 42L), .Names = c("FCMP_FALSE",
+"FCMP_OEQ", "FCMP_OGT", "FCMP_OGE", "FCMP_OLT", "FCMP_OLE", "FCMP_ONE",
+"FCMP_ORD", "FCMP_UNO", "FCMP_UEQ", "FCMP_UGT", "FCMP_UGE", "FCMP_ULT",
+"FCMP_ULE", "FCMP_UNE", "FCMP_TRUE", "FIRST_FCMP_PREDICATE",
+"LAST_FCMP_PREDICATE", "BAD_FCMP_PREDICATE", "ICMP_EQ", "ICMP_NE",
+"ICMP_UGT", "ICMP_UGE", "ICMP_ULT", "ICMP_ULE", "ICMP_SGT", "ICMP_SGE",
+"ICMP_SLT", "ICMP_SLE", "FIRST_ICMP_PREDICATE", "LAST_ICMP_PREDICATE",
+"BAD_ICMP_PREDICATE"))
288 R/IRBuilder.R
@@ -0,0 +1,288 @@
+IRBuilder =
+function(block = getGlobalContext())
+{
+ # if no block, use the context
+ if(is(block, "LLVMContext"))
+ .Call("R_new_IRBuilder_LLVMContext", block)
+ else
+ .Call("R_new_IRBuilder", block)
+}
+
+setInsertPoint =
+function(builder, block)
+{
+ .Call("R_IRBuilder_SetInsertPoint", builder, block)
+}
+
+binOp =
+function(builder, op, x, y, id = character())
+{
+ # incomplete. The idea is to recognize symbols in R such as + or - and
+ # map those to the corresponding enum values.
+ fun = deparse(substitute(op))
+ if(is.function(op))
+ op = fun
+
+ if(isBasicType(x))
+ x = makeConstant(builder, x)
+ if(isBasicType(y))
+ y = makeConstant(builder, y)
+
+ .Call("R_IRBuilder_CreateBinOp", builder, as.integer(op), x, y, as.character(id))
+}
+
+createReturn = createRet =
+function(builder, value = NULL)
+{
+ if(missing( value ))
+ createReturnVoid(builder)
+ else
+ .Call("R_IRBuilder_CreateRet", builder, value)
+}
+
+createReturnVoid = createRetVoid =
+function(builder)
+{
+ .Call("R_IRBuilder_CreateRetVoid", builder)
+}
+
+
+createCall =
+function(builder, fun, ..., .args = list(...), id = character())
+{
+ .Call("R_IRBuilder_CreateCall", builder, fun, .args, as.character(id))
+}
+
+
+createBr =
+function(builder, block)
+{
+ .Call("R_IRBuilder_CreateBr", builder, block)
+}
+
+createCondBr =
+function(builder, cond, true, false)
+{
+ .Call("R_IRBuilder_CreateCondBr", builder, cond, true, false)
+}
+
+
+createNeg =
+function(builder, val, id = character())
+{
+ .Call("R_IRBuilder_CreateNeg", builder, val)
+}
+
+createNot =
+function(builder, val, id = character())
+{
+ .Call("R_IRBuilder_CreateNot", builder, val)
+}
+
+
+createUIToFP =
+function(builder, val, type, id = character())
+{
+ .Call("R_IRBuilder_CreateUIToFP", builder, val, type)
+}
+
+createICmp =
+function(builder, op, lhs, rhs, id = character())
+{
+ .Call("R_IRBuilder_CreateICmp", builder, as(op, "integer"), lhs, rhs)
+}
+
+createFCmp =
+function(builder, op, lhs, rhs, id = character())
+{
+ .Call("R_IRBuilder_CreateFCmp", builder, as(op, "integer"), lhs, rhs)
+}
+
+isBasicType =
+function(val)
+{
+ typeof(val) %in% c("integer", "logical", "character", "double")
+}
+
+createStore =
+function(builder, val, ptr, volatile = FALSE)
+{
+ if(isBasicType(val)) # make a constant.
+ val = makeConstant(builder, val)
+
+ .Call("R_IRBuilder_CreateStore", builder, val, ptr, as.logical(volatile))
+}
+
+createLoad =
+function(builder, val, isVolatile = FALSE, id = character())
+{
+ .Call("R_IRBuilder_CreateLoad", builder, val, as.logical(isVolatile), as.character(id))
+}
+
+
+createGEP =
+function(builder, val, index, id = character())
+{
+ if(isBasicType(index))
+ index = makeConstant(builder, index)
+
+ .Call("R_IRBuilder_CreateGEP", builder, val, index, as.character(id))
+}
+
+
+createLocalVariable =
+ #XXX doesn't match method in IRBuilder. Building myself. Be suspicious
+function(builder, type, id)
+{
+ .Call("R_IRBuilder_createLocalVariable", builder, type, integer(), as.character(id))
+}
+
+createLocalArrayVariable =
+ #XXX doesn't match method in IRBuilder. Building myself. Be suspicious
+ # size is a Value. If a constant, we should create the value.
+function(builder, type, id, size = NULL)
+{
+# if(size <= 0)
+# stop("Must be positive value for size of array")
+
+ .Call("R_IRBuilder_createLocalVariable", builder, type, size, as.character(id))
+}
+
+##############
+# syntactic sugar to allow calls such as irbuilder$createGEP(...)
+# bldr$binOp(...)
+# rather than having the builder as the first argument.
+# This makes it easier to follow along with C++ code examples.
+#
+
+setMethod("$", "IRBuilder",
+ function(x, name) {
+ fun = get(name)
+
+ # formals(fun)$builder = x
+ function(...)
+ fun(builder = x, ...)
+ })
+
+
+createSExt =
+function(builder, val, type, id = character())
+{
+ if(is(type, "numeric"))
+ type = switch(as.character(type),
+ "32" = Int32Type,
+ "64" = Int64Type)
+ .Call("R_IRBuilder_CreateSExt", builder, val, type, as.character(id))
+}
+
+createBitCast =
+function(builder, val, type, id = character())
+{
+ .Call("R_IRBuilder_CreateBitCastInst", builder, val, type, as.character(id))
+}
+
+
+createGlobalString =
+function(builder, val, id = character())
+{
+ .Call("R_IRBuilder_CreateGlobalString", builder, as.character(val), as.character(id))
+}
+
+createIsNull =
+function(builder, val, id = character())
+{
+ .Call("R_IRBuilder_CreateIsNull", builder, val, as.character(id))
+}
+
+
+createIsNotNull =
+function(builder, val, id = character())
+{
+ .Call("R_IRBuilder_CreateIsNull", builder, val, as.character(id))
+}
+
+createUnwind =
+function(builder, id = character())
+{
+ .Call("R_IRBuilder_CreateUnwind", builder, as.character(id))
+}
+
+createUnreachable =
+function(builder, id = character())
+{
+ .Call("R_IRBuilder_CreateUnreachable", builder, as.character(id))
+}
+
+
+createSelect =
+function(builder, cond, true, false, id = character())
+{
+ .Call("R_IRBuilder_CreateSelect", builder, cond, true, false, as.character(id))
+}
+
+
+getInsertBlock =
+function(builder)
+{
+ .Call("R_IRBuilder_GetInsertBlock", builder)
+}
+
+setGeneric("createNot",
+ function(val, id = character(), block = NULL, builder = NULL)
+ standardGeneric("createNot"))
+
+if(FALSE) {
+setMethod("createNot", c("Value", block = "missing"),
+ function(val, id = character(), block = NULL)
+ .Call("R_BinaryOperator_CreateNot", val, as.character(id), VoidType, block))
+
+setMethod("createNot", c("Value", block = "BasicBlock"),
+ function(val, id = character(), block = NULL) {
+ if(length(id) == 0)
+ id = ""
+ .Call("R_BinaryOperator_CreateNot", val, as.character(id), VoidType, block)
+ })
+}
+
+setMethod("createNot", c("Value", block = "missing", builder = "IRBuilder"),
+ function(val, id = character(), block = NULL, builder = NULL)
+ .Call("R_IRBuilder_CreateNot", builder, val))
+
+setMethod("createNot", c("Value", block = "BasicBlock", builder = "IRBuilder"),
+ function(val, id = character(), block = NULL, builder = NULL) {
+ if(length(id) == 0)
+ id = ""
+ .Call("R_BinaryOperator_CreateNot", builder, val)
+ })
+
+
+setGeneric("createNeg",
+ function(val, id = character(), block = NULL)
+ standardGeneric("createNeg"))
+
+setMethod("createNeg", c("Value", block = "missing"),
+ function(val, id = character(), block = NULL)
+ .Call("R_BinaryOperator_CreateNeg", val, as.character(id), getType(val), NULL))
+
+setMethod("createNeg", c("Value", block = "BasicBlock"),
+ function(val, id = character(), block = NULL) {
+ if(length(id) == 0)
+ id = ""
+
+ .Call("R_BinaryOperator_CreateNeg", val, as.character(id), getType(val), block)
+ })
+
+
+
+
+getFalse =
+function(ir)
+{
+ .Call("R_IRBuilder_getFalse", ir)
+}
+
+getTrue =
+function(ir)
+{
+ .Call("R_IRBuilder_getTrue", ir)
+}
62 R/TypeID.R
@@ -0,0 +1,62 @@
+setClass('Type::TypeID', contains = 'EnumValue')
+`Type::TypeIDValues` = EnumDef('Type::TypeID', structure(as.integer(c(0,
+1,
+2,
+3,
+4,
+5,
+6,
+7,
+8,
+9,
+10,
+11,
+12,
+13,
+14,
+15,
+7,
+8)),
+names = c("VoidTyID",
+"FloatTyID",
+"DoubleTyID",
+"X86_FP80TyID",
+"FP128TyID",
+"PPC_FP128TyID",
+"LabelTyID",
+"MetadataTyID",
+"IntegerTyID",
+"FunctionTyID",
+"StructTyID",
+"ArrayTyID",
+"PointerTyID",
+"OpaqueTyID",
+"VectorTyID",
+"NumTypeIDs",
+"LastPrimitiveTyID",
+"FirstDerivedTyID")))
+
+
+setAs('numeric', 'Type::TypeID', function(from) asEnumValue(from, `Type::TypeIDValues`, 'Type::TypeID'))
+setAs('character', 'Type::TypeID', function(from) asEnumValue(from, `Type::TypeIDValues`, 'Type::TypeID'))
+setAs('integer', 'Type::TypeID', function(from) asEnumValue(from, `Type::TypeIDValues`, 'Type::TypeID'))
+
+
+`VoidTyID` <- GenericEnumValue('VoidTyID', 0, 'Type::TypeID')
+`FloatTyID` <- GenericEnumValue('FloatTyID', 1, 'Type::TypeID')
+`DoubleTyID` <- GenericEnumValue('DoubleTyID', 2, 'Type::TypeID')
+`X86_FP80TyID` <- GenericEnumValue('X86_FP80TyID', 3, 'Type::TypeID')
+`FP128TyID` <- GenericEnumValue('FP128TyID', 4, 'Type::TypeID')
+`PPC_FP128TyID` <- GenericEnumValue('PPC_FP128TyID', 5, 'Type::TypeID')
+`LabelTyID` <- GenericEnumValue('LabelTyID', 6, 'Type::TypeID')
+`MetadataTyID` <- GenericEnumValue('MetadataTyID', 7, 'Type::TypeID')
+`IntegerTyID` <- GenericEnumValue('IntegerTyID', 8, 'Type::TypeID')
+`FunctionTyID` <- GenericEnumValue('FunctionTyID', 9, 'Type::TypeID')
+`StructTyID` <- GenericEnumValue('StructTyID', 10, 'Type::TypeID')
+`ArrayTyID` <- GenericEnumValue('ArrayTyID', 11, 'Type::TypeID')
+`PointerTyID` <- GenericEnumValue('PointerTyID', 12, 'Type::TypeID')
+`OpaqueTyID` <- GenericEnumValue('OpaqueTyID', 13, 'Type::TypeID')
+`VectorTyID` <- GenericEnumValue('VectorTyID', 14, 'Type::TypeID')
+`NumTypeIDs` <- GenericEnumValue('NumTypeIDs', 15, 'Type::TypeID')
+`LastPrimitiveTyID` <- GenericEnumValue('LastPrimitiveTyID', 7, 'Type::TypeID')
+`FirstDerivedTyID` <- GenericEnumValue('FirstDerivedTyID', 8, 'Type::TypeID')
15 R/block.R
@@ -0,0 +1,15 @@
+Block =
+function(fun, id = character(), context = getGlobalContext(), n = 1)
+{
+ if(missing(n))
+ n = length(id)
+
+ .Call("R_new_BasicBlock", context, as.character(id), fun)
+}
+
+
+getTerminator =
+function(block)
+{
+ .Call("R_BasicBlock_getTerminator", block)
+}
64 R/classDefs.R
@@ -0,0 +1,64 @@
+
+setClass("RC++Reference", representation(ref = "externalptr"))
+
+setClass("Module", contains = "RC++Reference")
+setClass("IRBuilder", contains = "RC++Reference")
+setClass("LLVMContext", contains = "RC++Reference")
+setClass("ExecutionEngine", contains = "RC++Reference")
+setClass("Value", contains = "RC++Reference")
+setClass("BasicBlock", contains = "Value")
+
+setClass("FunctionPassManager", contains = "RC++Reference")
+
+
+setClass("Instruction", contains = "RC++Reference")
+setClass("UnaryInstruction", contains = "RC++Reference")
+setClass("TerminatorInst", contains = "Instruction")
+setClass("ReturnInst", contains = "TerminatorInst")
+setClass("CallInst", contains = "Instruction")
+setClass("CastInst", contains = "UnaryInstruction")
+setClass("SExtInst", contains = "CastInst")
+
+setClass("BinaryOperator", contains = "Instruction")
+
+setClass("BranchInst", contains = "TerminatorInst")
+
+setClass("ParameterList", contains = "list")
+
+ # allocates memory on the stack.
+setClass("AllocaInst", contains = "UnaryInstruction")
+setClass("LoadInst", contains = "UnaryInstruction")
+
+setClass("StoreInst", contains = "Instruction")
+setClass("GetElementPtrInst", contains = "Instruction")
+
+
+
+setClass("Type", contains = "RC++Reference")
+setClass("DerivedType", contains = "Type")
+setClass("CompositeType", contains = "DerivedType")
+setClass("StructType", contains = "CompositeType")
+setClass("UnionType", contains = "CompositeType")
+setClass("SequentialType", contains = "CompositeType")
+setClass("PointerType", contains = "SequentialType")
+
+
+setClass("User", contains = "Value")
+setClass("Constant", contains = "User")
+setClass("ConstantInt", contains = "Constant")
+setClass("ConstantFP", contains = "Constant")
+setClass("GlobalValue", contains = "Constant")
+setClass("GlobalVariable", contains = "GlobalValue")
+
+setClass("Function", contains = "GlobalValue")
+
+setClass("NativeFunctionPointer", contains = "RC++Reference")
+setClass("NativeGlobalVariable", contains = "RC++Reference")
+
+setTailCall =
+function(call, val = TRUE)
+{
+ .Call("R_CallInst_setTailCall", call, as.logical(val))
+}
+
+
53 R/constants.R
@@ -0,0 +1,53 @@
+setAs("IRBuilder", "LLVMContext",
+ function(from)
+ getGlobalContext()) # should try to get it from any of the blocks.
+
+createConstant = makeConstant =
+function(builder, val, type = NULL,
+ context = if(!missing(builder))
+ as(builder, "LLVMContext")
+ else
+ getGlobalContext())
+{
+ if(is.logical(val)) {
+ return(createLogicalConstant(val, context))
+ } else if(is.integer(val)) {
+ return(createIntegerConstant(val, context, type))
+ } else if(is.numeric(val)) {
+ return(createFloatingPointConstant(val, context, type))
+ } else
+ stop("Don't know yet how to create such a constant")
+}
+
+createLogicalConstant =
+function(val, context = getGlobalContext())
+{
+ .Call("R_getLogicalConstant", as.logical(val), context)
+}
+
+setGeneric("createIntegerConstant",
+ function(val, context = getGlobalContext(), ...)
+ standardGeneric("createIntegerConstant"))
+
+setMethod("createIntegerConstant",
+ c("character"),
+function(val, context = getGlobalContext(), type = NULL, bitwidth = 32L, radix = 10L, ...)
+{
+ .Call("R_createIntegerConstant_from_string", val, context, as.integer(bitwidth), as.integer(radix))
+})
+
+
+setMethod("createIntegerConstant",
+ c("integer"),
+function(val, context = getGlobalContext(), type = NULL, bitwidth = 32L, radix = 10L, ...)
+{
+
+ createIntegerConstant(as.character(val), context, type, bitwidth, radix)
+})
+
+
+createFloatingPointConstant = createDoubleConstant =
+function(val, context = getGlobalContext(), type = DoubleType)
+{
+ .Call("R_createFPConstant", as.numeric(val), context, type)
+}
8 R/context.R
@@ -0,0 +1,8 @@
+setGeneric("getContext",
+ function(x, ...)
+ standardGeneric('getContext'))
+
+setMethod("getContext", "Type",
+ function(x, ...)
+ .Call("R_Type_getContext", x))
+
21 R/dso.R
@@ -0,0 +1,21 @@
+# Functions for aiding resolving of external symbols.
+
+llvmLoadDLL =
+function(libs)
+{
+ libs = path.expand(as.character(libs))
+ e = file.exists(libs)
+ if(!all(e))
+ stop("DSO(s) don't exist", paste(libs[!e], sep = ", "))
+
+ .Call("R_DynamicLibrary_LoadLibraryPermanently", libs)
+}
+
+llvmAddSymbol =
+function(..., .syms = list(...))
+{
+ if(length(names(.syms)) == 0 || any(names(.syms) == ""))
+ stop("need names for all symbols")
+
+ invisible(.Call("R_DynamicLibrary_AddSymbol", .syms, names(.syms)))
+}
14 R/externalLinkage.R
@@ -0,0 +1,14 @@
+ExternalLinkage = 0
+AvailableExternallyLinkage = 1
+LinkOnceAnyLinkage = 2
+LinkOnceODRLinkage = 3
+WeakAnyLinkage = 4
+WeakODRLinkage = 5
+AppendingLinkage = 6
+InternalLinkage = 7
+PrivateLinkage = 8
+LinkerPrivateLinkage = 9
+DLLImportLinkage = 10
+DLLExportLinkage = 11
+ExternalWeakLinkage = 12
+CommonLinkage = 13
21 R/globalVar.R
@@ -0,0 +1,21 @@
+
+createGlobalVar = createGlobalVariable =
+function(id, val, mod, type = getType(val), # guessType(val),
+ constant = FALSE, linkage = ExternalLinkage, threadLocal = FALSE)
+{
+ .Call("R_createGlobalVariable", mod, type, val, as.character(id),
+ as.logical(constant), as.integer(linkage), as.logical(threadLocal))
+}
+
+
+guessType =
+ # guess the LLVM / native type from the R type
+function(val)
+{
+ n = length(val)
+ switch(typeof(val),
+ "integer" = if(n < 2) Int32Type else Int32PtrType,
+ "double" = if(n < 2) DoubleType else DoublePtrType,
+ stop("Can't guess type"))
+}
+
71 R/module.R
@@ -0,0 +1,71 @@
+
+Module =
+function(id, context = NULL)
+{
+ .Call("R_new_Module", as.character(id), context)
+}
+
+
+getGlobalContext =
+function()
+{
+ .Call("R_getGlobalContext")
+}
+
+verifyModule =
+function(module)
+ .Call("R_verifyModule", module)
+
+
+setGeneric("Optimize",
+ function(obj, ...)
+ standardGeneric("Optimize"))
+
+setMethod("Optimize", "Module",
+ function(obj, execEngine = NULL, ...) {
+ fun = getModuleFunctions(obj)
+ mgr = getPassManager(obj, execEngine)
+ lapply(fun, Optimize, mgr)
+ TRUE
+ })
+
+setMethod("Optimize",
+ c("Function"), # "FunctionPassManager"), # the llvm Function object
+ function(obj, passManager = getPassManager(getModule(obj)), ...) {
+ .Call("R_optimizeFunction", obj, passManager)
+ })
+
+
+getPassManager =
+function(module, execEngine = ExecutionEngine(module))
+{
+ .Call("R_getPassManager", module, execEngine)
+}
+
+
+setClass("ModuleDisplay", contains = "character")
+setMethod("show", "ModuleDisplay",
+ function(object)
+ cat(object))
+
+showModule =
+function(mod, asString = FALSE)
+{
+ mod = as(mod, "Module")
+ ans = .Call("R_showModule", mod, as.logical(asString))
+ if(asString)
+ new("ModuleDisplay", ans)
+}
+
+getModuleFunctions =
+function(mod)
+{
+ .Call("R_Module_getFunctionList", mod)
+}
+
+
+getGlobalVariable =
+function(module, var, allowInternal = TRUE)
+{
+ .Call("R_Module_getGlobalVariable", module, as.character(var), as.logical(allowInternal))
+}
23 R/onLoad.R
@@ -0,0 +1,23 @@
+getTypeDefs =
+function()
+{
+ types = .Call("R_getTypeDefinitions")
+ names(types) = c("Void", "Label", "Float", "Double", "Int1", "Int8", "Int16",
+ "Int32", "Int64", "FloatPtr", "DoublePtr", "Int32Ptr")
+ types
+}
+
+.onLoad =
+function(...)
+{
+
+ types = getTypeDefs()
+ e = getNamespace("Rllvm")
+ mapply(utils::assignInNamespace,
+ paste(names(types), "Type", sep = ""),
+ types,
+ MoreArgs = list(ns = e))
+
+ if(getOption("Rllvm.autoInitialize", TRUE))
+ InitializeNativeTarget()
+}
12 R/typeDefs.R
@@ -0,0 +1,12 @@
+VoidType = 1
+LabelType = 1
+FloatType = 1
+DoubleType = 1
+Int1Type = 1
+Int8Type = 1
+Int16Type = 1
+Int32Type = 1
+Int64Type = 1
+FloatPtrType = 1
+DoublePtrType = 1
+Int32PtrType = 1
54 R/types.R
@@ -0,0 +1,54 @@
+pointerType =
+function(elType)
+{
+ .Call("R_pointerType", elType)
+}
+
+
+
+setGeneric("getDescription",
+ function(x, ...)
+ standardGeneric("getDescription"))
+
+setMethod("getDescription", "Type",
+ function(x, ...)
+ .Call("R_Type_getDescription", x))
+
+
+getTypeID =
+ function(x, ...)
+ .Call("R_Type_getTypeID", ans)
+
+getScalarType =
+ function(x, ...)
+ .Call("R_Type_getScalarType", x)
+
+# Generated with
+# ids = gsub("TyID", "", names(tt@values))[c(1:15)])
+# enums = getEnumerations(tu)
+# tt = resolveType(enums[["Type::TypeID"]], tu)
+# cat(sprintf("is%sType = function(type) isType(type, '%s')", ids, sep = "\n")
+
+isVoidType = function(type) isType(type, "Void")
+isDoubleType = function(type) isType(type, "Double")
+isFloatType = function(type) isType(type, 'Float')
+isX86_FP80Type = function(type) isType(type, 'X86_FP80')
+isFP128Type = function(type) isType(type, 'FP128')
+isPPC_FP128Type = function(type) isType(type, 'PPC_FP128')
+isLabelType = function(type) isType(type, 'Label')
+isMetadataType = function(type) isType(type, 'Metadata')
+isIntegerType = function(type) isType(type, 'Integer')
+isFunctionType = function(type) isType(type, 'Function')
+isStructType = function(type) isType(type, 'Struct')
+isArrayType = function(type) isType(type, 'Array')
+isPointerType = function(type) isType(type, 'Pointer')
+isOpaqueType = function(type) isType(type, 'Opaque')
+isVectorType = function(type) isType(type, 'Vector')
+
+isType =
+function(type, id)
+{
+ sym = sprintf("R_Type_is%s", id)
+ .Call(sym, type)
+}
+
16 R/value.R
@@ -0,0 +1,16 @@
+setAs("GlobalValue", "Module",
+ function(from)
+ .Call("R_GlobalValue_getParent", from))
+
+
+setGeneric("getType",
+ function(obj, ...)
+ standardGeneric("getType"))
+
+setMethod("getType", "Value",
+ function(obj, ...) {
+ ans = .Call("R_Value_getType", obj)
+ browser()
+ ans
+ })
+
117 Todo.xml
@@ -0,0 +1,117 @@
+<todo>
+
+<items>
+
+<item>
+In the TU, ExecutionEngine create method has an NA for the type of one of the parameters.
+The type is there and the name of the type is also there, just not shown.
+<r:code>
+system.time({tu = parseTU("inst/TU/llvm.c.001t.tu")})
+k = getClassNodes(tu)
+m = getClassMethods(k[["llvm::ExecutionEngine"]])
+rm = resolveType(m, tu)
+rm$create
+</r:code>
+
+</item>
+
+<item>
+varargs
+</item>
+
+<item>
+structures
+</item>
+
+<item>
+Methods for IRBuilder
+<br/>
+See the TU interface generation.
+<br/>
+
+CreateVAArg
+CreateExtractElemet
+CreateInsertElement
+CreatePtrDiff
+
+CreateSwitch,
+CreateIndirectBr, CreateAggregateRet,
+CreateInvoke,
+
+CrateNSWAdd, NUWAdd, NSWSub, ...
+
+CreateInBoundsGEP
+
+CreateTrunc, CreateZExt, CreateSExt
+
+CreatePHI
+
+[Done] CreateIsNull, CreateIsNotNull
+CreateUnwind, CreateUnreachable
+CreateSelect
+</item>
+
+<item>
+Also allow passing in a function pointer to an LLVM generated
+routine as a type of argument.
+<br/>
+How do we specify that sort of type?
+</item>
+
+<item>
+Make certain that errors don't abort R.
+</item>
+
+<item status="done">
+IRBuilder has a $ method so we can use
+ ir$createICmp(), ir$createRet(), etc.
+a la C++ invocation.
+</item>
+
+<item>
+create a GEP with inbounds.
+<br/>
+Need to specify the indices in the constructor.
+Call IRBuilder-&gt;CreateInBoundsGEP
+</item>
+
+<item>
+global variables. Get the value. Write a routine to get them. Can't
+we do this generically.
+<br/>
+Use the ExecutionEngine and its methods
+</item>
+
+<item>
+strings &amp; string constants.
+</item>
+
+<item>
+dump a module to a buffer.
+or createPrintModulePass to our buffer.
+</item>
+
+<item status="done">
+Call a generated routine via Rffi or .Call()/.C()
+<br/>
+Use getPointerToFunction().
+See tests/rffiCall.Rdb.
+Crashing now.
+See the second example in rffiCall.Rdb
+<br/>
+</item>
+
+<item status="done">
+Within a routine, call an existing routine in a DSO.
+<br/>
+Need to help out the resolving of routines.
+<br/>
+Ideally we would like to call the R engine
+to resolve a symbol. However, for now
+we can require that the caller
+register symbols or DLLs.
+</item>
+
+
+</items>
+</todo>
45 VinceQues
@@ -0,0 +1,45 @@
+- delaying evaluation of arguments... necessary for functions like `<-`. Should this be done with a lookup table, or
+ should all arguments be unevaluated, passed into the compiling function, and then handled individually?
+
+ Well, all arguments are delayed due to lazy evaluation. And then there are the .Primitive() and
+ .Internal() functions. Let's talk about these tomorrow.
+
+
+- is positional argument matching ok for now?
+
+ Absolutely, it is fine for the moment. However, it is probably quite easy.
+ We can use match.call() to expand the call and match the arguments.
+
+- I'm a bit unclear on createSExt.
+ That is a cast operation. What do you need to cast and to what?
+
+- How do we do constant detection? Not necessarily for constant folding...
+
+ Do you mean a literal or a constant? I think of a literal as being
+ a string or number. So a literal is a constant value.
+ And I think of a constant as a variable that doesn't change, i.e. a const in C.
+ To identify constants in this sense we have to look through the rest of the code.
+ I imagine you are talking about literals specifically?
+
+ Suppose we have an expression or body of a function such as
+ {
+ x = 1 + y
+ sprintf("0x%f", x)
+ }
+ We' see the AST/parse tree and it would be equivalent to
+ e = quote( { x = 1 + y; sprintf("0x%f", x)})
+ Now, let's look at the first expression (the x = ...) which is element 2
+ and specifically the RHS:
+ sapply(e[[2]][[3]], class)
+ [1] "name" "numeric" "name"
+
+ See that the 1 is of class numeric, whereas the others are of class "name"
+ referring to variables. So if something is of class
+ logical, integer, numeric, character, complex
+ in the parse tree, that is a literal/constant.
+
+- What was the dependency finding system you mentioned?
+
+ The CodeDepends package. Should be on the omegahat site.
+ If not, let me know and I can put it there and/or give you access
+ to the repository on eeyore.ucdavis.edu
39 Web/FAQ.html
@@ -0,0 +1,39 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html> <head>
+<title></title>
+</head>
+
+<body>
+<h1>FAQ for Rllvm</h1>
+
+<dl>
+ <dt>
+ <li> What version of LLVM do I need?
+ <dd>
+ I am working with llvm-2.7.
+
+ <dt>
+ <li> Where is the documentation?
+ <dd>
+ There are some vignettes on examples in the tests/ directories.
+ These are reasonably comprehensive.
+ <p>
+ I havent written basic skeletons for the help pages.
+ The functions are reasonably similar to the corresponding
+ LLVM classes and methods and so you should consult the
+ documentation for LLVM and the particular clases and their methods.
+ For the time being, send me mail aobut any issues you have
+ and I can try to explain what the functions are intended
+ to do. That will prompt me to write more R-oriented documentation.
+ </p>
+</dl>
+
+
+
+<hr>
+<address><a href="http://www.stat.ucdavis.edu/~duncan">Duncan Temple Lang</a>
+<a href=mailto:duncan@wald.ucdavis.edu>&lt;duncan@wald.ucdavis.edu&gt;</a></address>
+<!-- hhmts start -->
+Last modified: Wed Sep 1 08:04:37 PDT 2010
+<!-- hhmts end -->
+</body> </html>
32 Web/GNUmakefile
@@ -0,0 +1,32 @@
+PKG=Rllvm
+WEB_DIR=www.omegahat.org:/home3/WebSites/Omega/$(PKG)
+
+
+shipIndex: index.html extra
+# $(MAKE) -C ../inst/doc ship
+ scp index.html $(WEB_DIR)/index.html
+
+extra:
+ -scp ../Changes.html ../FAQ.html $(WEB_DIR)
+
+indexInstall indexOnly: index.html
+ scp index.html $(WEB_DIR)/
+
+
+html:
+ if ! test -d Temp ; then mkdir Temp ; fi
+ R CMD INSTALL -l Temp ..
+ cp -r Temp/$(PKG)/html .
+ rm -fr Temp
+
+index.html: index.html.in configure ../DESCRIPTION
+ @echo "Running configure to create index.html"
+ ./configure
+
+configure: configure.in
+ autoconf
+
+
+%.html: %.xml
+ $(MAKE) -C $(@D) $(@F)
+
2,832 Web/autom4te.cache/output.0
@@ -0,0 +1,2832 @@
+@%:@! /bin/sh
+@%:@ Guess values for system-dependent variables and create Makefiles.
+@%:@ Generated by GNU Autoconf 2.68.
+@%:@
+@%:@
+@%:@ Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
+@%:@ 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software
+@%:@ Foundation, Inc.
+@%:@
+@%:@
+@%:@ This configure script is free software; the Free Software Foundation
+@%:@ gives unlimited permission to copy, distribute and modify it.
+## -------------------- ##
+## M4sh Initialization. ##
+## -------------------- ##
+
+# Be more Bourne compatible
+DUALCASE=1; export DUALCASE # for MKS sh
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
+ emulate sh
+ NULLCMD=:
+ # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '${1+"$@"}'='"$@"'
+ setopt NO_GLOB_SUBST
+else
+ case `(set -o) 2>/dev/null` in @%:@(
+ *posix*) :
+ set -o posix ;; @%:@(
+ *) :
+ ;;
+esac
+fi
+
+
+as_nl='
+'
+export as_nl
+# Printing a long string crashes Solaris 7 /usr/bin/printf.
+as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
+# Prefer a ksh shell builtin over an external printf program on Solaris,
+# but without wasting forks for bash or zsh.
+if test -z "$BASH_VERSION$ZSH_VERSION" \
+ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
+ as_echo='print -r --'
+ as_echo_n='print -rn --'
+elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
+ as_echo='printf %s\n'
+ as_echo_n='printf %s'
+else
+ if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
+ as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
+ as_echo_n='/usr/ucb/echo -n'
+ else
+ as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
+ as_echo_n_body='eval
+ arg=$1;
+ case $arg in @%:@(
+ *"$as_nl"*)
+ expr "X$arg" : "X\\(.*\\)$as_nl";
+ arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
+ esac;
+ expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
+ '
+ export as_echo_n_body
+ as_echo_n='sh -c $as_echo_n_body as_echo'
+ fi
+ export as_echo_body
+ as_echo='sh -c $as_echo_body as_echo'
+fi
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+ PATH_SEPARATOR=:
+ (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
+ (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
+ PATH_SEPARATOR=';'
+ }
+fi
+
+
+# IFS
+# We need space, tab and new line, in precisely that order. Quoting is
+# there to prevent editors from complaining about space-tab.
+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
+# splitting by setting IFS to empty value.)
+IFS=" "" $as_nl"
+
+# Find who we are. Look in the path if we contain no directory separator.
+as_myself=
+case $0 in @%:@((
+ *[\\/]* ) as_myself=$0 ;;
+ *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+ done
+IFS=$as_save_IFS
+
+ ;;
+esac
+# We did not find ourselves, most probably we were run as `sh COMMAND'
+# in which case we are not to be found in the path.
+if test "x$as_myself" = x; then
+ as_myself=$0
+fi
+if test ! -f "$as_myself"; then
+ $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+ exit 1
+fi
+
+# Unset variables that we do not need and which cause bugs (e.g. in
+# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1"
+# suppresses any "Segmentation fault" message there. '((' could
+# trigger a bug in pdksh 5.2.14.
+for as_var in BASH_ENV ENV MAIL MAILPATH
+do eval test x\${$as_var+set} = xset \
+ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
+done
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+LC_ALL=C
+export LC_ALL
+LANGUAGE=C
+export LANGUAGE
+
+# CDPATH.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+if test "x$CONFIG_SHELL" = x; then
+ as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then :
+ emulate sh
+ NULLCMD=:
+ # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '\${1+\"\$@\"}'='\"\$@\"'
+ setopt NO_GLOB_SUBST
+else
+ case \`(set -o) 2>/dev/null\` in @%:@(
+ *posix*) :
+ set -o posix ;; @%:@(
+ *) :
+ ;;
+esac
+fi
+"
+ as_required="as_fn_return () { (exit \$1); }
+as_fn_success () { as_fn_return 0; }
+as_fn_failure () { as_fn_return 1; }
+as_fn_ret_success () { return 0; }
+as_fn_ret_failure () { return 1; }
+
+exitcode=0
+as_fn_success || { exitcode=1; echo as_fn_success failed.; }
+as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; }
+as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; }
+as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; }
+if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then :
+
+else
+ exitcode=1; echo positional parameters were not saved.
+fi
+test x\$exitcode = x0 || exit 1"
+ as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO
+ as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO
+ eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" &&
+ test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1"
+ if (eval "$as_required") 2>/dev/null; then :
+ as_have_required=yes
+else
+ as_have_required=no
+fi
+ if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then :
+
+else
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+as_found=false
+for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ as_found=:
+ case $as_dir in @%:@(
+ /*)
+ for as_base in sh bash ksh sh5; do
+ # Try only shells that exist, to save several forks.
+ as_shell=$as_dir/$as_base
+ if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
+ { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then :
+ CONFIG_SHELL=$as_shell as_have_required=yes
+ if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then :
+ break 2
+fi
+fi
+ done;;
+ esac
+ as_found=false
+done
+$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } &&
+ { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then :
+ CONFIG_SHELL=$SHELL as_have_required=yes
+fi; }
+IFS=$as_save_IFS
+
+
+ if test "x$CONFIG_SHELL" != x; then :
+ # We cannot yet assume a decent shell, so we have to provide a
+ # neutralization value for shells without unset; and this also
+ # works around shells that cannot unset nonexistent variables.
+ # Preserve -v and -x to the replacement shell.
+ BASH_ENV=/dev/null
+ ENV=/dev/null
+ (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
+ export CONFIG_SHELL
+ case $- in @%:@ ((((
+ *v*x* | *x*v* ) as_opts=-vx ;;
+ *v* ) as_opts=-v ;;
+ *x* ) as_opts=-x ;;
+ * ) as_opts= ;;
+ esac
+ exec "$CONFIG_SHELL" $as_opts "$as_myself" ${1+"$@"}
+fi
+
+ if test x$as_have_required = xno; then :
+ $as_echo "$0: This script requires a shell more modern than all"
+ $as_echo "$0: the shells that I found on your system."
+ if test x${ZSH_VERSION+set} = xset ; then
+ $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should"
+ $as_echo "$0: be upgraded to zsh 4.3.4 or later."
+ else
+ $as_echo "$0: Please tell bug-autoconf@gnu.org about your system,
+$0: including any error possibly output before this
+$0: message. Then install a modern shell, or manually run
+$0: the script under such a shell if you do have one."
+ fi
+ exit 1
+fi
+fi
+fi
+SHELL=${CONFIG_SHELL-/bin/sh}
+export SHELL
+# Unset more variables known to interfere with behavior of common tools.
+CLICOLOR_FORCE= GREP_OPTIONS=
+unset CLICOLOR_FORCE GREP_OPTIONS
+
+## --------------------- ##
+## M4sh Shell Functions. ##
+## --------------------- ##
+@%:@ as_fn_unset VAR
+@%:@ ---------------
+@%:@ Portably unset VAR.
+as_fn_unset ()
+{
+ { eval $1=; unset $1;}
+}
+as_unset=as_fn_unset
+
+@%:@ as_fn_set_status STATUS
+@%:@ -----------------------
+@%:@ Set @S|@? to STATUS, without forking.
+as_fn_set_status ()
+{
+ return $1
+} @%:@ as_fn_set_status
+
+@%:@ as_fn_exit STATUS
+@%:@ -----------------
+@%:@ Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
+as_fn_exit ()
+{
+ set +e
+ as_fn_set_status $1
+ exit $1
+} @%:@ as_fn_exit
+
+@%:@ as_fn_mkdir_p
+@%:@ -------------
+@%:@ Create "@S|@as_dir" as a directory, including parents if necessary.
+as_fn_mkdir_p ()
+{
+
+ case $as_dir in #(
+ -*) as_dir=./$as_dir;;
+ esac
+ test -d "$as_dir" || eval $as_mkdir_p || {
+ as_dirs=
+ while :; do
+ case $as_dir in #(
+ *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
+ *) as_qdir=$as_dir;;
+ esac
+ as_dirs="'$as_qdir' $as_dirs"
+ as_dir=`$as_dirname -- "$as_dir" ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$as_dir" : 'X\(//\)[^/]' \| \
+ X"$as_dir" : 'X\(//\)$' \| \
+ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_dir" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ test -d "$as_dir" && break
+ done
+ test -z "$as_dirs" || eval "mkdir $as_dirs"
+ } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
+
+
+} @%:@ as_fn_mkdir_p
+@%:@ as_fn_append VAR VALUE
+@%:@ ----------------------
+@%:@ Append the text in VALUE to the end of the definition contained in VAR. Take
+@%:@ advantage of any shell optimizations that allow amortized linear growth over
+@%:@ repeated appends, instead of the typical quadratic growth present in naive
+@%:@ implementations.
+if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
+ eval 'as_fn_append ()
+ {
+ eval $1+=\$2
+ }'
+else
+ as_fn_append ()
+ {
+ eval $1=\$$1\$2
+ }
+fi # as_fn_append
+
+@%:@ as_fn_arith ARG...
+@%:@ ------------------
+@%:@ Perform arithmetic evaluation on the ARGs, and store the result in the
+@%:@ global @S|@as_val. Take advantage of shells that can avoid forks. The arguments
+@%:@ must be portable across @S|@(()) and expr.
+if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
+ eval 'as_fn_arith ()
+ {
+ as_val=$(( $* ))
+ }'
+else
+ as_fn_arith ()
+ {
+ as_val=`expr "$@" || test $? -eq 1`
+ }
+fi # as_fn_arith
+
+
+@%:@ as_fn_error STATUS ERROR [LINENO LOG_FD]
+@%:@ ----------------------------------------
+@%:@ Output "`basename @S|@0`: error: ERROR" to stderr. If LINENO and LOG_FD are
+@%:@ provided, also output the error to LOG_FD, referencing LINENO. Then exit the
+@%:@ script with STATUS, using 1 if that was 0.
+as_fn_error ()
+{
+ as_status=$1; test $as_status -eq 0 && as_status=1
+ if test "$4"; then
+ as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
+ fi
+ $as_echo "$as_me: error: $2" >&2
+ as_fn_exit $as_status
+} @%:@ as_fn_error
+
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+ test "X`expr 00001 : '.*\(...\)'`" = X001; then
+ as_expr=expr
+else
+ as_expr=false
+fi
+
+if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
+ as_basename=basename
+else
+ as_basename=false
+fi
+
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+ as_dirname=dirname
+else
+ as_dirname=false
+fi
+
+as_me=`$as_basename -- "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+ X"$0" : 'X\(//\)$' \| \
+ X"$0" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X/"$0" |
+ sed '/^.*\/\([^/][^/]*\)\/*$/{
+ s//\1/
+ q
+ }
+ /^X\/\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\/\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+
+ as_lineno_1=$LINENO as_lineno_1a=$LINENO
+ as_lineno_2=$LINENO as_lineno_2a=$LINENO
+ eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" &&
+ test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || {
+ # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-)
+ sed -n '
+ p
+ /[$]LINENO/=
+ ' <$as_myself |
+ sed '
+ s/[$]LINENO.*/&-/
+ t lineno
+ b
+ :lineno
+ N
+ :loop
+ s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
+ t loop
+ s/-\n.*//
+ ' >$as_me.lineno &&
+ chmod +x "$as_me.lineno" ||
+ { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; }
+
+ # Don't try to exec as it changes $[0], causing all sort of problems
+ # (the dirname of $[0] is not the place where we might find the
+ # original and so on. Autoconf is especially sensitive to this).
+ . "./$as_me.lineno"
+ # Exit status is that of the last command.
+ exit
+}
+
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in @%:@(((((
+-n*)
+ case `echo 'xy\c'` in
+ *c*) ECHO_T=' ';; # ECHO_T is single tab character.
+ xy) ECHO_C='\c';;
+ *) echo `echo ksh88 bug on AIX 6.1` > /dev/null
+ ECHO_T=' ';;
+ esac;;
+*)
+ ECHO_N='-n';;
+esac
+
+rm -f conf$$ conf$$.exe conf$$.file
+if test -d conf$$.dir; then
+ rm -f conf$$.dir/conf$$.file
+else
+ rm -f conf$$.dir
+ mkdir conf$$.dir 2>/dev/null
+fi
+if (echo >conf$$.file) 2>/dev/null; then
+ if ln -s conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s='ln -s'
+ # ... but there are two gotchas:
+ # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+ # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+ # In both cases, we have to default to `cp -p'.
+ ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+ as_ln_s='cp -p'
+ elif ln conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s=ln
+ else
+ as_ln_s='cp -p'
+ fi
+else
+ as_ln_s='cp -p'
+fi
+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
+
+if mkdir -p . 2>/dev/null; then
+ as_mkdir_p='mkdir -p "$as_dir"'
+else
+ test -d ./-p && rmdir ./-p
+ as_mkdir_p=false
+fi
+
+if test -x / >/dev/null 2>&1; then
+ as_test_x='test -x'
+else
+ if ls -dL / >/dev/null 2>&1; then
+ as_ls_L_option=L
+ else
+ as_ls_L_option=
+ fi
+ as_test_x='
+ eval sh -c '\''
+ if test -d "$1"; then
+ test -d "$1/.";
+ else
+ case $1 in @%:@(
+ -*)set "./$1";;
+ esac;
+ case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in @%:@((
+ ???[sx]*):;;*)false;;esac;fi
+ '\'' sh
+ '
+fi
+as_executable_p=$as_test_x
+
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
+
+
+test -n "$DJDIR" || exec 7<&0 </dev/null
+exec 6>&1
+
+# Name of the host.
+# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status,
+# so uname gets run too.
+ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
+
+#
+# Initializations.
+#
+ac_default_prefix=/usr/local
+ac_clean_files=
+ac_config_libobj_dir=.
+LIB@&t@OBJS=
+cross_compiling=no
+subdirs=
+MFLAGS=
+MAKEFLAGS=
+
+# Identity of this package.
+PACKAGE_NAME=
+PACKAGE_TARNAME=
+PACKAGE_VERSION=
+PACKAGE_STRING=
+PACKAGE_BUGREPORT=
+PACKAGE_URL=
+
+ac_unique_file="index.html.in"
+ac_subst_vars='LTLIBOBJS
+LIB@&t@OBJS
+DATE
+TAR_FILE
+VERSION
+PKG_NAME
+target_alias
+host_alias
+build_alias
+LIBS
+ECHO_T
+ECHO_N
+ECHO_C
+DEFS
+mandir
+localedir
+libdir
+psdir
+pdfdir
+dvidir
+htmldir
+infodir
+docdir
+oldincludedir
+includedir
+localstatedir
+sharedstatedir
+sysconfdir
+datadir
+datarootdir
+libexecdir
+sbindir
+bindir
+program_transform_name
+prefix
+exec_prefix
+PACKAGE_URL
+PACKAGE_BUGREPORT
+PACKAGE_STRING
+PACKAGE_VERSION
+PACKAGE_TARNAME
+PACKAGE_NAME
+PATH_SEPARATOR
+SHELL'
+ac_subst_files=''
+ac_user_opts='
+enable_option_checking
+'
+ ac_precious_vars='build_alias
+host_alias
+target_alias'
+
+
+# Initialize some variables set by options.
+ac_init_help=
+ac_init_version=false
+ac_unrecognized_opts=
+ac_unrecognized_sep=
+# The variables have the same names as the options, with
+# dashes changed to underlines.
+cache_file=/dev/null
+exec_prefix=NONE
+no_create=
+no_recursion=
+prefix=NONE
+program_prefix=NONE
+program_suffix=NONE
+program_transform_name=s,x,x,
+silent=
+site=
+srcdir=
+verbose=
+x_includes=NONE
+x_libraries=NONE
+
+# Installation directory options.
+# These are left unexpanded so users can "make install exec_prefix=/foo"
+# and all the variables that are supposed to be based on exec_prefix
+# by default will actually change.
+# Use braces instead of parens because sh, perl, etc. also accept them.
+# (The list follows the same order as the GNU Coding Standards.)
+bindir='${exec_prefix}/bin'
+sbindir='${exec_prefix}/sbin'
+libexecdir='${exec_prefix}/libexec'
+datarootdir='${prefix}/share'
+datadir='${datarootdir}'
+sysconfdir='${prefix}/etc'
+sharedstatedir='${prefix}/com'
+localstatedir='${prefix}/var'
+includedir='${prefix}/include'
+oldincludedir='/usr/include'
+docdir='${datarootdir}/doc/${PACKAGE}'
+infodir='${datarootdir}/info'
+htmldir='${docdir}'
+dvidir='${docdir}'
+pdfdir='${docdir}'
+psdir='${docdir}'
+libdir='${exec_prefix}/lib'
+localedir='${datarootdir}/locale'
+mandir='${datarootdir}/man'
+
+ac_prev=
+ac_dashdash=
+for ac_option
+do
+ # If the previous option needs an argument, assign it.
+ if test -n "$ac_prev"; then
+ eval $ac_prev=\$ac_option
+ ac_prev=
+ continue
+ fi
+
+ case $ac_option in
+ *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
+ *=) ac_optarg= ;;
+ *) ac_optarg=yes ;;
+ esac
+
+ # Accept the important Cygnus configure options, so we can diagnose typos.
+
+ case $ac_dashdash$ac_option in
+ --)
+ ac_dashdash=yes ;;
+
+ -bindir | --bindir | --bindi | --bind | --bin | --bi)
+ ac_prev=bindir ;;
+ -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
+ bindir=$ac_optarg ;;
+
+ -build | --build | --buil | --bui | --bu)
+ ac_prev=build_alias ;;
+ -build=* | --build=* | --buil=* | --bui=* | --bu=*)
+ build_alias=$ac_optarg ;;
+
+ -cache-file | --cache-file | --cache-fil | --cache-fi \
+ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
+ ac_prev=cache_file ;;
+ -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
+ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
+ cache_file=$ac_optarg ;;
+
+ --config-cache | -C)
+ cache_file=config.cache ;;
+
+ -datadir | --datadir | --datadi | --datad)
+ ac_prev=datadir ;;
+ -datadir=* | --datadir=* | --datadi=* | --datad=*)
+ datadir=$ac_optarg ;;
+
+ -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
+ | --dataroo | --dataro | --datar)
+ ac_prev=datarootdir ;;
+ -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
+ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
+ datarootdir=$ac_optarg ;;
+
+ -disable-* | --disable-*)
+ ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+ as_fn_error $? "invalid feature name: $ac_useropt"
+ ac_useropt_orig=$ac_useropt
+ ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+ case $ac_user_opts in
+ *"
+"enable_$ac_useropt"
+"*) ;;
+ *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig"
+ ac_unrecognized_sep=', ';;
+ esac
+ eval enable_$ac_useropt=no ;;
+
+ -docdir | --docdir | --docdi | --doc | --do)
+ ac_prev=docdir ;;
+ -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*)
+ docdir=$ac_optarg ;;
+
+ -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv)
+ ac_prev=dvidir ;;
+ -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*)
+ dvidir=$ac_optarg ;;
+
+ -enable-* | --enable-*)
+ ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+ as_fn_error $? "invalid feature name