本文整理汇总了C++中DIBuilder::createCompileUnit方法的典型用法代码示例。如果您正苦于以下问题:C++ DIBuilder::createCompileUnit方法的具体用法?C++ DIBuilder::createCompileUnit怎么用?C++ DIBuilder::createCompileUnit使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DIBuilder
的用法示例。
在下文中一共展示了DIBuilder::createCompileUnit方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
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: NewMetadataObj
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: LLVMDIBuilderCreateCompileUnit
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: LLVMDIBuilderCreateCompileUnit
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: LLVMDIBuilderCreateCompileUnit
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: DIBuilderCreateCompileUnit
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: 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());
}
}