Ejemplo n.º 1
0
// Create load from object field
ValueBuilder BlockBuilder::createLoad(ValueBuilder thisValue, FieldPtr field) {
    llvm::Value* offset   = offsetField(thisValue, field);
    llvm::Value* loadInst = new llvm::LoadInst(offset, "", m_block);
    return ValueBuilder(*this, loadInst, field->getFieldType());
}
Ejemplo n.º 2
0
// Create store in object field
ValueBuilder BlockBuilder::createStore(ValueBuilder thisValue, FieldPtr field, ValueBuilder value) {
    llvm::Value* offset = offsetField(thisValue, field);
    new llvm::StoreInst(value.getValue(), offset, "", m_block);
    return ValueBuilder(*this, value.getValue(), field->getFieldType());
}