search for: litchar

Displaying 4 results from an estimated 4 matches for "litchar".

2008 Jan 25
0
Passing string arguments to C code, call to .C, R memory allocation for character vectors
...understand from manuals). Can anybody track the error(s)? Note that the 2 tested R versions give different error messages (R-2.0.0 and R-2.3.0 on 2 Linux machines, one : Linux host1 2.4.21-32.ELsmp, other : Linux host2 2.6.9-34.ELsmp) Here is the code : R programme : n = 50 cat("R call to litchar\n") dyn.load("lit.so") ret = .C("litchar",noms=character(n),as.integer(n)) --- C code : #include <stdlib.h> #include <stdio.h> #include <string.h> void litchar(char **s,int *n) { int i, j, c; for (i=0;i<*n;i++) { sprintf(s[i],"%6...
2009 Oct 26
1
[LLVMdev] RegAllocSimple doesn't work
...# define ENDSTR '\0' # define ESCAPE '@' # define CLOSURE '*' # define BOL '%' # define EOL '$' # define ANY '?' # define CCL '[' # define CCLEND ']' # define NEGATE '^' # define NCCL '!' # define LITCHAR 'c' # define DITTO -1 # define DASH '-' # define TAB 9 # define NEWLINE 10 # define CLOSIZE 1 typedef char character; typedef char string[MAXSTR]; bool getline(s, maxsize) char *s; int maxsize; { char *result; result = fgets(s, maxsize, stdin); return (resul...
2009 Oct 22
0
[LLVMdev] request for help writing a register allocator
Hi Susan, > But this doesn't seem to be happening; the stores to memory are there but > the loads are not. > > Any ideas what's going wrong? Are you using VirtRegMap::addSpillPoint and VirtRegMap::addRestorePoint ? If not you may need to add calls to them to let the rewriter know where to insert the loads/stores. > If not, any advice on how to generate the loads
2009 Oct 22
4
[LLVMdev] request for help writing a register allocator
I found the problem! My generated code is spilling correctly but is not reloading at all. For example, if the original code has the equivalent of this (where %1024 is a virtual reg): %1024 = xxx ... yyy = %1024 and I find no physical register for %1024, then I assign it to physical register %edi and to a stackslot. That creates code like this: %edi = xxx store from %edi to the