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); }
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; }
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)); }
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)); }
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); }
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); }
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()); } }