コード例 #1
0
ファイル: debuginfo.cpp プロジェクト: jdc8/llvmtcl
int
BuildDbgValue(
    ClientData clientData,
    Tcl_Interp *interp,
    int objc,
    Tcl_Obj *const objv[])
{
    if (objc != 6) {
	Tcl_WrongNumArgs(interp, 1, objv,
		"dibuilder builder value location variableInfo");
	return TCL_ERROR;
    }

    DIBuilder *builder;
    if (GetDIBuilderFromObj(interp, objv[1], builder) != TCL_OK)
	return TCL_ERROR;
    IRBuilder<> *b;
    if (GetBuilderFromObj(interp, objv[2], b) != TCL_OK)
        return TCL_ERROR;
    Value *val;
    if (GetValueFromObj(interp, objv[3], val) != TCL_OK)
	return TCL_ERROR;
    DILocation *location;
    if (GetMetadataFromObj(interp, objv[4], "location", location) != TCL_OK)
	return TCL_ERROR;
    DILocalVariable *varInfo;
    if (GetMetadataFromObj(interp, objv[5], "variable", varInfo) != TCL_OK)
	return TCL_ERROR;

    auto expr = builder->createExpression(); // Dummy

    auto inst = builder->insertDbgValueIntrinsic(val, 0, varInfo, expr,
	    location, b->GetInsertBlock());

    Tcl_SetObjResult(interp, NewValueObj(inst));
    return TCL_OK;
}
コード例 #2
0
LLVMMetadataRef LLVMDIBuilderCreateExpression(LLVMDIBuilderRef Dref,
                                              int64_t *Addr, size_t Length) {
  DIBuilder *D = unwrap(Dref);
  return wrap(D->createExpression(ArrayRef<int64_t>(Addr, Length)));
}
コード例 #3
0
ファイル: DIBuilderBindings.cpp プロジェクト: Drup/llvm
LLVMValueRef LLVMDIBuilderCreateExpression(LLVMDIBuilderRef Dref, int64_t *Addr,
                                           size_t Length) {
  DIBuilder *D = unwrap(Dref);
  DIExpression Expr = D->createExpression(ArrayRef<int64_t>(Addr, Length));
  return wrap(Expr);
}