Expand Value class
This commit is contained in:
parent
c247cf9527
commit
a3da74c416
2 changed files with 21 additions and 1 deletions
|
|
@ -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)
|
||||
|
|
@ -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()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue