Beispiel #1
0
    static EJS_NATIVE_FUNC(ArrayType_prototype_toString) {
        std::string str;
        llvm::raw_string_ostream str_ostream(str);
        ((ArrayType*)EJSVAL_TO_OBJECT(*_this))->type->print(str_ostream);

        return _ejs_string_new_utf8(trim(str_ostream.str()).c_str());
    }
Beispiel #2
0
    static EJS_NATIVE_FUNC(GlobalVariable_prototype_toString) {
        std::string str;
        llvm::raw_string_ostream str_ostream(str);
        ((GlobalVariable*)EJSVAL_TO_OBJECT(*_this))->llvm_global->print(str_ostream);

        return _ejs_string_new_utf8(trim(str_ostream.str()).c_str());
    }
    ejsval
    GlobalVariable_prototype_toString(ejsval env, ejsval _this, int argc, ejsval *args)
    {
        std::string str;
        llvm::raw_string_ostream str_ostream(str);
        ((GlobalVariable*)EJSVAL_TO_OBJECT(_this))->llvm_global->print(str_ostream);

        return _ejs_string_new_utf8(trim(str_ostream.str()).c_str());
    }
Beispiel #4
0
    ejsval
    AllocaInst_prototype_toString(ejsval env, ejsval *_this, uint32_t argc, ejsval *args, ejsval newTarget)
    {
        std::string str;
        llvm::raw_string_ostream str_ostream(str);
        ((AllocaInst*)EJSVAL_TO_OBJECT(*_this))->llvm_alloca->print(str_ostream);

        return _ejs_string_new_utf8(trim(str_ostream.str()).c_str());
    }
Beispiel #5
0
    ejsval
    Call_prototype_toString(ejsval env, ejsval _this, int argc, ejsval *args)
    {
        std::string str;
        llvm::raw_string_ostream str_ostream(str);
        ((Call*)EJSVAL_TO_OBJECT(_this))->llvm_call->print(str_ostream, NULL);

        return _ejs_string_new_utf8(trim(str_ostream.str()).c_str());
    }
Beispiel #6
0
    ejsval
    LoadInst_prototype_toString(ejsval env, ejsval _this, int argc, ejsval *args)
    {
        std::string str;
        llvm::raw_string_ostream str_ostream(str);
        ((LoadInst*)EJSVAL_TO_OBJECT(_this))->llvm_load->print(str_ostream);

        return _ejs_string_new_utf8(trim(str_ostream.str()).c_str());
    }
Beispiel #7
0
    ejsval
    FunctionType_prototype_toString(ejsval env, ejsval _this, int argc, ejsval *args)
    {
        std::string str;
        llvm::raw_string_ostream str_ostream(str);
        ((FunctionType*)EJSVAL_TO_OBJECT(_this))->type->print(str_ostream);

        return _ejs_string_new_utf8(trim(str_ostream.str()).c_str());
    }
Beispiel #8
0
  Handle<v8::Value> Function::ToString(const Arguments& args)
  {
    HandleScope scope;
    Function* fun = ObjectWrap::Unwrap<Function>(args.This());

    std::string str;
    llvm::raw_string_ostream str_ostream(str);
    fun->llvm_fun->print(str_ostream);

    return scope.Close(String::New(trim(str_ostream.str()).c_str()));
  }
Beispiel #9
0
  Handle<v8::Value> AllocaInst::ToString(const Arguments& args)
  {
    HandleScope scope;
    AllocaInst* a = ObjectWrap::Unwrap<AllocaInst>(args.This());

    std::string str;
    llvm::raw_string_ostream str_ostream(str);
    a->llvm_alloca->print(str_ostream);

    return scope.Close(String::New(trim(str_ostream.str()).c_str()));
  }
Beispiel #10
0
  Handle<v8::Value> Call::ToString(const Arguments& args)
  {
    HandleScope scope;
    Call* _call = ObjectWrap::Unwrap<Call>(args.This());

    std::string str;
    llvm::raw_string_ostream str_ostream(str);
    _call->llvm_call->print(str_ostream);

    return scope.Close(String::New(trim(str_ostream.str()).c_str()));
  }
Beispiel #11
0
  Handle<v8::Value> Invoke::ToString(const Arguments& args)
  {
    HandleScope scope;
    Invoke* _invoke = ObjectWrap::Unwrap<Invoke>(args.This());

    std::string str;
    llvm::raw_string_ostream str_ostream(str);
    _invoke->llvm_invoke->print(str_ostream);

    return scope.Close(String::New(trim(str_ostream.str()).c_str()));
  }
Beispiel #12
0
  Handle<v8::Value> PHINode::ToString(const Arguments& args)
  {
    HandleScope scope;
    PHINode* phi = ObjectWrap::Unwrap<PHINode>(args.This());

    std::string str;
    llvm::raw_string_ostream str_ostream(str);
    phi->llvm_phi->print(str_ostream);

    return scope.Close(String::New(trim(str_ostream.str()).c_str()));
  }
Beispiel #13
0
  Handle<Value> ArrayType::ToString(const Arguments& args)
  {
    HandleScope scope;
    ArrayType* type = ObjectWrap::Unwrap<ArrayType>(args.This());

    std::string str;
    llvm::raw_string_ostream str_ostream(str);
    type->llvm_ty->print(str_ostream);

    return scope.Close(String::New(trim(str_ostream.str()).c_str()));
  }
Handle< ::v8::Value> GlobalVariable::ToString(const Arguments& args)
{
    HandleScope scope;
    GlobalVariable* val = ObjectWrap::Unwrap<GlobalVariable>(args.This());

    std::string str;
    llvm::raw_string_ostream str_ostream(str);
    val->llvm_global->print(str_ostream);

    return scope.Close(String::New(trim(str_ostream.str()).c_str()));
}