Exemplo n.º 1
0
LLVMValueRef LLVMDIBuilderGetOrCreateArray(LLVMDIBuilderRef Dref,
                                           LLVMValueRef *Data, size_t Length) {
  DIBuilder *D = unwrap(Dref);
  Value **DataValue = unwrap(Data);
  ArrayRef<Value *> Elements(DataValue, Length);
  DIArray A = D->getOrCreateArray(Elements);
  return wrap(A);
}
Exemplo n.º 2
0
LLVMValueRef DIBuilderGetOrCreateArray(LLVMDIBuilderRef dref,
                                       LLVMValueRef *data, size_t length) {
  DIBuilder *d = unwrap(dref);
  Value **dataValue = unwrap(data);
  ArrayRef<Value *> elements(dataValue, length);
  DIArray a = d->getOrCreateArray(elements);
  return wrap(a);
}
Exemplo n.º 3
0
LLVMMetadataRef LLVMDIBuilderGetOrCreateArray(LLVMDIBuilderRef Dref,
                                              LLVMMetadataRef *Data,
                                              size_t Length) {
  DIBuilder *D = unwrap(Dref);
  Metadata **DataValue = unwrap(Data);
  ArrayRef<Metadata *> Elements(DataValue, Length);
  DINodeArray A = D->getOrCreateArray(Elements);
  return wrap(A.get());
}
Exemplo n.º 4
0
LLVMValueRef LLVMDIBuilderGetOrCreateArray(
  LLVMDIBuilderRef D,
  LLVMValueRef *Data,
  size_t Length)
{
  DIBuilder *db = unwrap(D);
  ArrayRef<Value *> DataList(unwrap(Data), Length);
  DIArray A = db->getOrCreateArray(DataList);
  return wrap(A);
}
Exemplo n.º 5
0
int
DefineStructType(
    ClientData clientData,
    Tcl_Interp *interp,
    int objc,
    Tcl_Obj *const objv[])
{
    if (objc < 7) {
	Tcl_WrongNumArgs(interp, 1, objv,
		"DIBuilder scope name file line size element...");
	return TCL_ERROR;
    }

    DIBuilder *builder;
    if (GetDIBuilderFromObj(interp, objv[1], builder) != TCL_OK)
	return TCL_ERROR;
    DIScope *scope;
    if (GetMetadataFromObj(interp, objv[2], "scope", scope) != TCL_OK)
	return TCL_ERROR;
    std::string name = Tcl_GetString(objv[3]);
    DIFile *file;
    if (GetMetadataFromObj(interp, objv[4], "file", file) != TCL_OK)
	return TCL_ERROR;
    unsigned flags = 0, align = 0;
    int size, line;
    if (Tcl_GetIntFromObj(interp, objv[5], &line) != TCL_OK)
	return TCL_ERROR;
    if (Tcl_GetIntFromObj(interp, objv[6], &size) != TCL_OK)
	return TCL_ERROR;
    std::vector<Metadata *> elements;
    for (int i=7 ; i<objc ; i++) {
	DIType *type;
	if (GetMetadataFromObj(interp, objv[i], "type", type) != TCL_OK)
	    return TCL_ERROR;
	elements.push_back(type);
    }

    auto val = builder->createStructType(scope, name, file, (unsigned) line,
	    (uint64_t) size, align, flags, nullptr,
	    builder->getOrCreateArray(elements));

    Tcl_SetObjResult(interp, NewMetadataObj(val, "StructType"));
    return TCL_OK;
}