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


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

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


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

示例1: LLVMDIBuilderCreateParameterVariable

LLVMMetadataRef LLVMDIBuilderCreateParameterVariable(
    LLVMDIBuilderRef Dref, LLVMMetadataRef Scope, const char *Name,
    unsigned ArgNo, LLVMMetadataRef File, unsigned Line, LLVMMetadataRef Ty,
    int AlwaysPreserve, unsigned Flags) {
  DIBuilder *D = unwrap(Dref);
  return wrap(D->createParameterVariable(
      unwrap<DIScope>(Scope), Name, ArgNo, unwrap<DIFile>(File), Line,
      unwrap<DIType>(Ty), AlwaysPreserve, static_cast<DINode::DIFlags>(Flags)));
}
开发者ID:1995hnagamin,项目名称:llvm,代码行数:9,代码来源:DIBuilderBindings.cpp

示例2: NewMetadataObj

int
DefineParameter(
    ClientData clientData,
    Tcl_Interp *interp,
    int objc,
    Tcl_Obj *const objv[])
{
    if (objc != 8) {
	Tcl_WrongNumArgs(interp, 1, objv,
		"DIBuilder scope name argIndex file line type");
	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]);
    int argIndex, line;
    if (Tcl_GetIntFromObj(interp, objv[4], &argIndex) != TCL_OK)
	return TCL_ERROR;
    if (argIndex < 1) {
	Tcl_SetObjResult(interp, Tcl_NewStringObj(
		"argument indices must be at least 1", -1));
	return TCL_ERROR;
    }
    DIFile *file;
    if (GetMetadataFromObj(interp, objv[5], "file", file) != TCL_OK)
	return TCL_ERROR;
    if (Tcl_GetIntFromObj(interp, objv[6], &line) != TCL_OK)
	return TCL_ERROR;
    DIType *type;
    if (GetMetadataFromObj(interp, objv[7], "type", type) != TCL_OK)
	return TCL_ERROR;

#if (LLVM_VERSION_MAJOR >=3 && LLVM_VERSION_MINOR > 7)
    auto val = builder->createParameterVariable(scope, name,
	    (unsigned) argIndex, file, (unsigned) line, type);
#else
    // This API was deprecated (and made private) after 3.7
    auto val = builder->createLocalVariable(
	    llvm::dwarf::DW_TAG_arg_variable, scope, name, file,
	    (unsigned) line, type, false, 0, (unsigned) argIndex);
#endif

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

示例3: LLVMDIBuilderCreateLocalVariable

LLVMMetadataRef LLVMDIBuilderCreateLocalVariable(
    LLVMDIBuilderRef Dref, unsigned, LLVMMetadataRef Scope,
    const char *Name, LLVMMetadataRef File, unsigned Line, LLVMMetadataRef Ty,
    int AlwaysPreserve, unsigned Flags, unsigned ArgNo) {
  DIBuilder *D = unwrap(Dref);
  // FIXME: Update the Go bindings to match the DIBuilder API.
  if (ArgNo)
    return wrap(D->createParameterVariable(
        unwrap<DIScope>(Scope), Name, ArgNo, unwrap<DIFile>(File), Line,
        unwrap<DIType>(Ty), AlwaysPreserve, Flags));
  return wrap(D->createAutoVariable(unwrap<DIScope>(Scope), Name,
                                    unwrap<DIFile>(File), Line,
                                    unwrap<DIType>(Ty), AlwaysPreserve, Flags));
}
开发者ID:IanLee1521,项目名称:ares,代码行数:14,代码来源:DIBuilderBindings.cpp


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