forked from dirk/llvm2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
33 lines (26 loc) · 787 Bytes
/
index.js
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
var ffi = require('ffi'),
ref = require('ref')
var ptrType = ref.refType(ref.types.void),
void_ = ref.types.void
// Pull in the big FFI library
var Builder = require('./lib/builder'),
Library = require('./lib/library'),
Types = require('./lib/types'),
Wrappers = require('./lib/wrappers'),
RefTypes = require('./lib/ref-types')
function constString (str) {
var dontNullTerminate = false
return Library.LLVMConstString(str, str.length, dontNullTerminate)
}
var toExport = {
Builder: Builder,
Library: Library,
Types: Types,
RefTypes: RefTypes,
constString: constString
};
['FunctionType', 'Function', 'Module', 'FunctionPassManager']
.forEach(function (n) {
toExport[n] = Wrappers[n]
})
module.exports = toExport