diff --git a/newbinding/src/Value.py b/newbinding/src/Value.py index ec7aa9a..062ad43 100644 --- a/newbinding/src/Value.py +++ b/newbinding/src/Value.py @@ -2,7 +2,23 @@ from binding import * from namespace import llvm from raw_ostream import raw_ostream from AssemblyAnnotationWriter import AssemblyAnnotationWriter - +from Type import Type +from LLVMContext import LLVMContext +from StringRef import StringRef +# Value = llvm.Class() + +dump = Value.method(Void) + print_ = Value.method(Void, raw_ostream.Ref, AssemblyAnnotationWriter.Pointer) print_.realname = 'print' + +getType = Value.method(Type.Pointer) +getContext = Value.method(LLVMContext.Ref) + +hasName = Value.method(Bool.To(bool)) +# skip getValueName, setValueName +getName = Value.method(StringRef.To(str)) +setName = Value.method(Void, StringRef.From(str)) + +replaceAllUsesWith = Value.method(Void, Value.Pointer) \ No newline at end of file diff --git a/newbinding/test2.py b/newbinding/test2.py index b866f59..ac74594 100644 --- a/newbinding/test2.py +++ b/newbinding/test2.py @@ -40,3 +40,7 @@ fn = m.getOrInsertFunction("foo", fnty) os = api.make_raw_ostream_for_printing() fn.print_(os, None) print os.str() +assert fn.hasName() +assert 'foo' == fn.getName() +fn.setName('bar') +assert 'bar' == fn.getName()