Support MetaDataString, and correctly represent MetaData Values in _make_value
This commit is contained in:
parent
7f69beb258
commit
e2d8079b93
5 changed files with 31 additions and 3 deletions
13
llvm/core.py
13
llvm/core.py
|
|
@ -1478,6 +1478,17 @@ class MetaData(Value):
|
|||
def _get_operand(self, i):
|
||||
return _make_value(_core.LLVMMetaDataGetOperand(self.ptr, i))
|
||||
|
||||
class MetaDataString(Value):
|
||||
@staticmethod
|
||||
def get(module, s):
|
||||
ptr = _core.LLVMMetaDataStringGet(module.ptr, s)
|
||||
return MetaDataString(ptr)
|
||||
|
||||
@property
|
||||
def string(self):
|
||||
'''Same as MDString::getString'''
|
||||
return self.name
|
||||
|
||||
#===----------------------------------------------------------------------===
|
||||
# Instruction
|
||||
#===----------------------------------------------------------------------===
|
||||
|
|
@ -1648,6 +1659,8 @@ __class_for_valueid = {
|
|||
VALUE_CONSTANT_STRUCT : ConstantStruct,
|
||||
VALUE_CONSTANT_VECTOR : ConstantVector,
|
||||
VALUE_CONSTANT_POINTER_NULL : ConstantPointerNull,
|
||||
VALUE_MD_NODE : MetaData,
|
||||
VALUE_MD_STRING : MetaDataString,
|
||||
VALUE_INSTRUCTION + OPCODE_PHI : PHINode,
|
||||
VALUE_INSTRUCTION + OPCODE_CALL : CallOrInvokeInstruction,
|
||||
VALUE_INSTRUCTION + OPCODE_INVOKE : CallOrInvokeInstruction,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue