search for: llglobalvariable

Displaying 5 results from an estimated 5 matches for "llglobalvariable".

Did you mean: globalvariable
2008 Mar 15
3
[LLVMdev] improving the ocaml binding's type safety
...om up. This is an example of the following functions: string Value::getName() bool Constant::isNull() bool GlobalValue::isDeclaration() bool GlobalVariable::isGlobalConstant() bool Function::isVarArg() Driver code: val make_constant : unit -> llconstant t val make_global_variable : unit -> llglobalvariable t val make_function : unit -> llfunction t (* typesafe *) value_name (make_constant ());; value_name (make_global_variable ());; value_name (make_function ());; is_null (make_constant ());; is_declaration (make_global_variable ());; is_declaration (make_function ());; is_global_constant (make_g...
2008 Mar 15
0
[LLVMdev] improving the ocaml binding's type safety
On Sat, Mar 15, 2008 at 4:00 PM, Gordon Henriksen <gordonhenriksen at mac.com> wrote: > What do the respective type errors look like? Top down looks like: File "foo.ml", line 21, characters 11-36: This expression has type Bar.llglobalvariable Bar.t but is here used with type ([> `Function ] as 'a) Bar.t Type Bar.llglobalvariable = [ `GlobalValue | `GlobalVariable | `Value ] is not compatible with type 'a The first variant type does not allow tag(s) `Function Bottom up looks like: File "foo.ml", line 21, characters...
2008 Mar 15
0
[LLVMdev] improving the ocaml binding's type safety
...ing that the arguments are > a superset of the variants. We can control this by limiting who can > create 't's: > > type 'a t > > type llvalue = [ `Value ] > type llconstant = [ llvalue | `Constant ] > type llglobalvalue = [ llvalue | `GlobalValue ] > type llglobalvariable = [ llglobalvalue | `GlobalVariable ] > type llfunction = [ llglobalvalue | `Function ] > > val value_name : [> `Value] t -> string > val is_null : [> `Constant] t -> bool > val is_declaration : [> `GlobalValue] t -> bool > val is_global_constant : [> `GlobalV...
2008 Mar 15
0
[LLVMdev] improving the ocaml binding's type safety
Hi Erick, On 2008-03-15, at 04:03, Erick Tryzelaar wrote: > I was talking to Gordon on #llvm earlier, and he challenged me with > coming up with a way to improve the ocaml binding's type safety. I > think I got an easy solution with phantom types. This could be a good step. I'm not sure I can predict all of the implications; I'd suggest you work up a proof of concept.
2008 Mar 15
4
[LLVMdev] improving the ocaml binding's type safety
I was talking to Gordon on #llvm earlier, and he challenged me with coming up with a way to improve the ocaml binding's type safety. We can't go letting haskell beat us now, can we? I think I got an easy solution with phantom types. For those who don't know what the problem is, the ocaml bindings share one type between whole class branches (like values). This means we need to downcast