コード例 #1
0
ファイル: mini-llvm-cpp.cpp プロジェクト: TheMetalMage/mono
void*
mono_llvm_di_create_compile_unit (void *di_builder, const char *cu_name, const char *dir, const char *producer)
{
	DIBuilder *builder = (DIBuilder*)di_builder;

	return builder->createCompileUnit (dwarf::DW_LANG_C99, cu_name, dir, producer, true, "", 0);
}
コード例 #2
0
ファイル: debuginfo.cpp プロジェクト: jdc8/llvmtcl
int
DefineCompileUnit(
    ClientData clientData,
    Tcl_Interp *interp,
    int objc,
    Tcl_Obj *const objv[])
{
    if (objc != 5) {
	Tcl_WrongNumArgs(interp, 1, objv,
		"DIBuilder file directory producer");
	return TCL_ERROR;
    }

    DIBuilder *builder;
    if (GetDIBuilderFromObj(interp, objv[1], builder) != TCL_OK)
	return TCL_ERROR;
    unsigned lang = dwarf::DW_LANG_lo_user;//No standard value for Tcl!
    std::string file = Tcl_GetString(objv[2]);
    std::string dir = Tcl_GetString(objv[3]);
    std::string producer = Tcl_GetString(objv[4]);
    std::string flags = "";
    unsigned runtimeVersion = 0;

    auto val = builder->createCompileUnit(lang, file, dir, producer, true,
	    flags, runtimeVersion);

    Tcl_SetObjResult(interp, NewMetadataObj(val, "CompileUnit"));
    return TCL_OK;
}
コード例 #3
0
LLVMValueRef LLVMDIBuilderCreateCompileUnit(
  LLVMDIBuilderRef D,
  unsigned Lang,
  const char *File,
  const char *Dir,
  const char *Producer,
  bool Optimized,
  const char *Flags,
  unsigned RuntimeVersion)
{
  DIBuilder *db = unwrap(D);
  DICompileUnit CU = db->createCompileUnit(
    Lang,
    File,
    Dir,
    Producer,
    Optimized,
    Flags,
    RuntimeVersion);
    return wrap(CU);

  //LLVMValueRef val;
  // return reinterpret_cast<LLVMValueRef>(&CU);
//    return reinterpret_cast<LLVMValueRef>(const_cast<DICompileUnit*>(CU));

}
コード例 #4
0
LLVMMetadataRef LLVMDIBuilderCreateCompileUnit(LLVMDIBuilderRef Dref,
                                               unsigned Lang, const char *File,
                                               const char *Dir,
                                               const char *Producer,
                                               int Optimized, const char *Flags,
                                               unsigned RuntimeVersion) {
  DIBuilder *D = unwrap(Dref);
  return wrap(D->createCompileUnit(Lang, D->createFile(File, Dir), Producer,
                                   Optimized, Flags, RuntimeVersion));
}
コード例 #5
0
ファイル: DIBuilderBindings.cpp プロジェクト: Drup/llvm
LLVMValueRef LLVMDIBuilderCreateCompileUnit(LLVMDIBuilderRef Dref,
                                            unsigned Lang, const char *File,
                                            const char *Dir,
                                            const char *Producer, int Optimized,
                                            const char *Flags,
                                            unsigned RuntimeVersion) {
  DIBuilder *D = unwrap(Dref);
  DICompileUnit CU = D->createCompileUnit(Lang, File, Dir, Producer, Optimized,
                                          Flags, RuntimeVersion);
  return wrap(CU);
}
コード例 #6
0
ファイル: dibuilder.cpp プロジェクト: go-llvm/llvm
LLVMValueRef DIBuilderCreateCompileUnit(LLVMDIBuilderRef dref, unsigned lang,
                                        const char *file, const char *dir,
                                        const char *producer, int optimized,
                                        const char *flags,
                                        unsigned runtimeVersion) {
  DIBuilder *d = unwrap(dref);
  DICompileUnit cu = d->createCompileUnit(lang, StringRef(file), StringRef(dir),
                                          StringRef(producer), optimized,
                                          StringRef(flags), runtimeVersion);
  return wrap(cu);
}
コード例 #7
0
ファイル: tllvmutil.cpp プロジェクト: 0----0/terra
    CopyConnectedComponent(Module * dest_, Module * src_, llvmutil_Property copyGlobal_, void * data_, ValueToValueMapTy & VMap_)
    : dest(dest_), src(src_), copyGlobal(copyGlobal_), data(data_), VMap(VMap_), DI(NULL) {
        if(NamedMDNode * NMD = src->getNamedMetadata("llvm.module.flags")) {
            NamedMDNode * New = dest->getOrInsertNamedMetadata(NMD->getName());
            for (unsigned i = 0; i < NMD->getNumOperands(); i++) {
                New->addOperand(MapValue(NMD->getOperand(i), VMap));
            }
        }

        if(NamedMDNode * CUN = src->getNamedMetadata("llvm.dbg.cu")) {
            DI = new DIBuilder(*dest);
            DICompileUnit CU(CUN->getOperand(0));
            NCU = DI->createCompileUnit(CU.getLanguage(), CU.getFilename(), CU.getDirectory(), CU.getProducer(), CU.isOptimized(), CU.getFlags(), CU.getRunTimeVersion());
        }
    }