当前位置: 首页>>代码示例>>C++>>正文


C++ DIBuilder::createSubroutineType方法代码示例

本文整理汇总了C++中DIBuilder::createSubroutineType方法的典型用法代码示例。如果您正苦于以下问题:C++ DIBuilder::createSubroutineType方法的具体用法?C++ DIBuilder::createSubroutineType怎么用?C++ DIBuilder::createSubroutineType使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在DIBuilder的用法示例。


在下文中一共展示了DIBuilder::createSubroutineType方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: NewMetadataObj

int
DefineFunctionType(
    ClientData clientData,
    Tcl_Interp *interp,
    int objc,
    Tcl_Obj *const objv[])
{
    if (objc < 4) {
	Tcl_WrongNumArgs(interp, 1, objv,
		"DIBuilder file returnType argumentType...");
	return TCL_ERROR;
    }

    DIBuilder *builder;
    if (GetDIBuilderFromObj(interp, objv[1], builder) != TCL_OK)
	return TCL_ERROR;
    DIFile *file;
    if (GetMetadataFromObj(interp, objv[2], "file", file) != TCL_OK)
	return TCL_ERROR;
    std::vector<Metadata *> elements;
    for (int i=3 ; i<objc ; i++) {
	DIType *type;
	if (GetMetadataFromObj(interp, objv[i], "type", type) != TCL_OK)
	    return TCL_ERROR;
	elements.push_back(type);
    }

    auto val = builder->createSubroutineType(file,
	    builder->getOrCreateTypeArray(elements));

    Tcl_SetObjResult(interp, NewMetadataObj(val, "FunctionType"));
    return TCL_OK;
}
开发者ID:jdc8,项目名称:llvmtcl,代码行数:33,代码来源:debuginfo.cpp

示例2: wrap

LLVMMetadataRef
LLVMDIBuilderCreateSubroutineType(LLVMDIBuilderRef Dref, LLVMMetadataRef File,
                                  LLVMMetadataRef ParameterTypes) {
  DIBuilder *D = unwrap(Dref);
  return wrap(
      D->createSubroutineType(DITypeRefArray(unwrap<MDTuple>(ParameterTypes))));
}
开发者ID:1995hnagamin,项目名称:llvm,代码行数:7,代码来源:DIBuilderBindings.cpp

示例3: LLVMDIBuilderCreateSubroutineType

LLVMValueRef LLVMDIBuilderCreateSubroutineType(LLVMDIBuilderRef Dref,
                                               LLVMValueRef File,
                                               LLVMValueRef ParameterTypes) {
  DIBuilder *D = unwrap(Dref);
  DICompositeType CT = D->createSubroutineType(
      unwrapDI<DIFile>(File), unwrapDI<DITypeArray>(ParameterTypes));
  return wrap(CT);
}
开发者ID:Drup,项目名称:llvm,代码行数:8,代码来源:DIBuilderBindings.cpp

示例4: DIBuilderCreateSubroutineType

LLVMValueRef DIBuilderCreateSubroutineType(LLVMDIBuilderRef dref,
                                           LLVMValueRef diFile,
                                           LLVMValueRef diParameterTypes) {
  DIBuilder *d = unwrap(dref);
  DICompositeType ct = d->createSubroutineType(
      unwrapDI<DIFile>(diFile), unwrapDI<DITypeArray>(diParameterTypes));
  return wrap(ct);
}
开发者ID:go-llvm,项目名称:llvm,代码行数:8,代码来源:dibuilder.cpp

示例5: wrap

LLVMMetadataRef
LLVMDIBuilderCreateSubroutineType(LLVMDIBuilderRef Dref, LLVMMetadataRef File,
                                  LLVMMetadataRef ParameterTypes) {
  DIBuilder *D = unwrap(Dref);
  DICompositeType CT =
      D->createSubroutineType(File ? unwrap<MDFile>(File) : nullptr,
                              DITypeArray(unwrap<MDTuple>(ParameterTypes)));
  return wrap(CT);
}
开发者ID:B1ackCat,项目名称:llvm-dsa,代码行数:9,代码来源:DIBuilderBindings.cpp

示例6:

void*
mono_llvm_di_create_function (void *di_builder, void *cu, const char *name, const char *mangled_name, const char *dir, const char *file, int line)
{
	DIBuilder *builder = (DIBuilder*)di_builder;
	DIFile *di_file;
	DISubroutineType *type;

	// FIXME: Share DIFile
	di_file = builder->createFile (file, dir);
	type = builder->createSubroutineType (builder->getOrCreateTypeArray (ArrayRef<Metadata*> ()));
	return builder->createFunction (di_file, name, mangled_name, di_file, line, type, true, true, 0);
}
开发者ID:TheMetalMage,项目名称:mono,代码行数:12,代码来源:mini-llvm-cpp.cpp

示例7:

LLVMZigDIType *LLVMZigCreateSubroutineType(LLVMZigDIBuilder *dibuilder_wrapped,
        LLVMZigDIFile *file, LLVMZigDIType **types_array, int types_array_len, unsigned flags)
{
    SmallVector<Metadata *, 8> types;
    for (int i = 0; i < types_array_len; i += 1) {
        DIType *ditype = reinterpret_cast<DIType*>(types_array[i]);
        types.push_back(ditype);
    }
    DIBuilder *dibuilder = reinterpret_cast<DIBuilder*>(dibuilder_wrapped);
    DISubroutineType *subroutine_type = dibuilder->createSubroutineType(
            reinterpret_cast<DIFile*>(file),
            dibuilder->getOrCreateTypeArray(types),
            flags);
    DIType *ditype = subroutine_type;
    return reinterpret_cast<LLVMZigDIType*>(ditype);
}
开发者ID:MovingtoMars,项目名称:zig,代码行数:16,代码来源:zig_llvm.cpp

示例8:

void*
mono_llvm_di_create_function (void *di_builder, void *cu, LLVMValueRef func, const char *name, const char *mangled_name, const char *dir, const char *file, int line)
{
    DIBuilder *builder = (DIBuilder*)di_builder;
    DIFile *di_file;
    DISubroutineType *type;
    DISubprogram *di_func;

    // FIXME: Share DIFile
    di_file = builder->createFile (file, dir);
    type = builder->createSubroutineType (builder->getOrCreateTypeArray (ArrayRef<Metadata*> ()));
    di_func = builder->createFunction (di_file, name, mangled_name, di_file, line, type, true, true, 0);

    unwrap<Function>(func)->setMetadata ("dbg", di_func);

    return di_func;
}
开发者ID:sushihangover,项目名称:playscript,代码行数:17,代码来源:mini-llvm-cpp.cpp


注:本文中的DIBuilder::createSubroutineType方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。