-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathfoo.xml
70 lines (53 loc) · 1.13 KB
/
foo.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
<article
xmlns:r="http://www.r-project.org"
xmlns:c="http://www.C.org"
xmlns:omg="http://www.omegahat.org">
<info>
<author>
<personname>
<firstname>Duncan</firstname>
<surname>Temple Lang</surname>
</personname>
<affiliation>
<orgname>UC Davis</orgname>
<orgdiv>Data Science Initiative</orgdiv>
</affiliation>
</author>
</info>
<title>Type Information for foo.c</title>
<para>
This mirrors the computations in <ulink url="AST.xml"/> but done via the
Intermediate Representation (IR) from compiling the C code,
rather than Abstract Syntax Tree of the C code.
</para>
<section>
<title>foo</title>
<para>
<r:code>
library(Rllvm)
m = parseIR("foo.ir")
m$ifoo
</r:code>
<r:code>
source("getType.R")
compReturnType(m$ifoo)
</r:code>
This is a scalar integer.
</para>
<para>
The same works for m$ifoo2 and gives the same result:
<r:code>
compReturnType(m$ifoo2)
</r:code>
</para>
<para>
The str routine yields a STRSXP with length 1:
<r:code>
compReturnType(m$str)
</r:code>
</para>
<para>
compReturnType(m$len_character)
</para>
</section>
</article>