<commit_before>from binding import *
from ..namespace import llvm
from ..Support.StringRefMemoryObject import MemoryObject
from ..Support.raw_ostream import raw_ostream
from src.ADT.StringRef import StringRef

MCSubtargetInfo = llvm.Class()
MCDisassembler = llvm.Class()
MCInst = llvm.Class()
MCOperand = llvm.Class()
MCExpr = llvm.Class()
MCAsmInfo = llvm.Class()
MCRegisterInfo = llvm.Class()
MCInstrInfo = llvm.Class()
MCInstrAnalysis = llvm.Class()
MCInstPrinter = llvm.Class()
MCInstrDesc = llvm.Class()

TargetSubtargetInfo = llvm.Class(MCSubtargetInfo)
TargetInstrInfo = llvm.Class(MCInstrInfo)
TargetRegisterInfo = llvm.Class(MCRegisterInfo)

@MCInstrDesc
class MCInstrDesc:
   _include_ = "llvm/MC/MCInstrDesc.h"

   TSFlags = Attr(getter=cast(Uint64, int), setter=cast(int, Uint64))
   getFlags = Method(cast(Unsigned, int))
   getOpcode = Method(cast(Unsigned, int))

@MCSubtargetInfo
class MCSubtargetInfo:
    pass

@TargetSubtargetInfo
class TargetSubtargetInfo:
    _include_ = 'llvm/Target/TargetSubtargetInfo.h'

@MCExpr
class MCExpr:
    _include_ = "llvm/MC/MCExpr.h"

    ExprKind = Enum('Binary', 'Constant', 'SymbolRef', 'Unary', 'Target')
    getKind = Method(ExprKind)

@MCOperand
class MCOperand:
    _include_ = "llvm/MC/MCInst.h"

    isValid = Method(cast(Bool, bool))
    isReg = Method(cast(Bool, bool))
    isImm = Method(cast(Bool, bool))
    isFPImm = Method(cast(Bool, bool))
    isExpr = Method(cast(Bool, bool))
    isInst = Method(cast(Bool, bool))

    getReg = Method(cast(Unsigned, int))
    getImm = Method(cast(Int64, int))
    getFPImm = Method(cast(Double, float))
    getExpr = Method(const(ptr(MCExpr)))
    
@MCInst
class MCInst:
    _include_ = "llvm/MC/MCInst.h"
    new = Constructor()

    size = Method(cast(Size_t, int))
    getNumOperands = Method(cast(Unsigned, int))

    getOperand = Method(const(ref(MCOperand)), cast(int, Unsigned))
<commit_msg>MCExpr pointer is owned by the MCOperand object<commit_after>from binding import *
from ..namespace import llvm
from ..Support.StringRefMemoryObject import MemoryObject
from ..Support.raw_ostream import raw_ostream
from src.ADT.StringRef import StringRef

MCSubtargetInfo = llvm.Class()
MCDisassembler = llvm.Class()
MCInst = llvm.Class()
MCOperand = llvm.Class()
MCExpr = llvm.Class()
MCAsmInfo = llvm.Class()
MCRegisterInfo = llvm.Class()
MCInstrInfo = llvm.Class()
MCInstrAnalysis = llvm.Class()
MCInstPrinter = llvm.Class()
MCInstrDesc = llvm.Class()

TargetSubtargetInfo = llvm.Class(MCSubtargetInfo)
TargetInstrInfo = llvm.Class(MCInstrInfo)
TargetRegisterInfo = llvm.Class(MCRegisterInfo)

@MCInstrDesc
class MCInstrDesc:
   _include_ = "llvm/MC/MCInstrDesc.h"

   TSFlags = Attr(getter=cast(Uint64, int), setter=cast(int, Uint64))
   getFlags = Method(cast(Unsigned, int))
   getOpcode = Method(cast(Unsigned, int))

@MCSubtargetInfo
class MCSubtargetInfo:
    pass

@TargetSubtargetInfo
class TargetSubtargetInfo:
    _include_ = 'llvm/Target/TargetSubtargetInfo.h'

@MCExpr
class MCExpr:
    _include_ = "llvm/MC/MCExpr.h"

    ExprKind = Enum('Binary', 'Constant', 'SymbolRef', 'Unary', 'Target')
    getKind = Method(ExprKind)

@MCOperand
class MCOperand:
    _include_ = "llvm/MC/MCInst.h"

    isValid = Method(cast(Bool, bool))
    isReg = Method(cast(Bool, bool))
    isImm = Method(cast(Bool, bool))
    isFPImm = Method(cast(Bool, bool))
    isExpr = Method(cast(Bool, bool))
    isInst = Method(cast(Bool, bool))

    getReg = Method(cast(Unsigned, int))
    getImm = Method(cast(Int64, int))
    getFPImm = Method(cast(Double, float))
    getExpr = Method(const(ownedptr(MCExpr)))
    
@MCInst
class MCInst:
    _include_ = "llvm/MC/MCInst.h"
    new = Constructor()

    size = Method(cast(Size_t, int))
    getNumOperands = Method(cast(Unsigned, int))

    getOperand = Method(const(ref(MCOperand)), cast(int, Unsigned))

{'fraction_non_alphanumeric': 0.12633220691447883, 'fraction_numerical': 0.0031193137509747857, 'mean_word_length': 4.795180722891566, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5906235', 'n_tokens_mistral': 1351, 'n_tokens_neox': 1358, 'n_words': 279}