本文整理汇总了C++中DIBuilder::createFile方法的典型用法代码示例。如果您正苦于以下问题:C++ DIBuilder::createFile方法的具体用法?C++ DIBuilder::createFile怎么用?C++ DIBuilder::createFile使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DIBuilder
的用法示例。
在下文中一共展示了DIBuilder::createFile方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
void*
mono_llvm_di_create_file (void *di_builder, const char *dir, const char *file)
{
DIBuilder *builder = (DIBuilder*)di_builder;
return builder->createFile (file, dir);
}
示例2: LLVMDIBuilderCreateFile
LLVMValueRef LLVMDIBuilderCreateFile(
LLVMDIBuilderRef D,
const char *File,
const char *Dir)
{
DIBuilder *db = unwrap(D);
DIFile F = db->createFile(File, Dir);
return wrap(F);
}
示例3: 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));
}
示例4: SP
virtual Value * materializeValueFor(Value * V) {
if(Function * fn = dyn_cast<Function>(V)) {
assert(fn->getParent() == src);
Function * newfn = dest->getFunction(fn->getName());
if(!newfn) {
newfn = Function::Create(fn->getFunctionType(),fn->getLinkage(), fn->getName(),dest);
newfn->copyAttributesFrom(fn);
}
if(!fn->isDeclaration() && newfn->isDeclaration() && copyGlobal(fn,data)) {
for(Function::arg_iterator II = newfn->arg_begin(), I = fn->arg_begin(), E = fn->arg_end(); I != E; ++I, ++II) {
II->setName(I->getName());
VMap[I] = II;
}
VMap[fn] = newfn;
SmallVector<ReturnInst*,8> Returns;
CloneFunctionInto(newfn, fn, VMap, true, Returns, "", NULL, NULL, this);
}
return newfn;
} else if(GlobalVariable * GV = dyn_cast<GlobalVariable>(V)) {
GlobalVariable * newGV = dest->getGlobalVariable(GV->getName(),true);
if(!newGV) {
newGV = new GlobalVariable(*dest,GV->getType()->getElementType(),GV->isConstant(),GV->getLinkage(),NULL,GV->getName(),NULL,GlobalVariable::NotThreadLocal,GV->getType()->getAddressSpace());
newGV->copyAttributesFrom(GV);
if(!GV->isDeclaration()) {
if(!copyGlobal(GV,data)) {
newGV->setExternallyInitialized(true);
} else if(GV->hasInitializer()) {
Value * C = MapValue(GV->getInitializer(),VMap,RF_None,NULL,this);
newGV->setInitializer(cast<Constant>(C));
}
}
}
return newGV;
} else if(MDNode * MD = dyn_cast<MDNode>(V)) {
DISubprogram SP(MD);
if(DI != NULL && SP.isSubprogram()) {
if(Function * OF = SP.getFunction()) {
Function * F = cast<Function>(MapValue(OF,VMap,RF_None,NULL,this));
DISubprogram NSP = DI->createFunction(SP.getContext(), SP.getName(), SP.getLinkageName(),
DI->createFile(SP.getFilename(),SP.getDirectory()),
SP.getLineNumber(), SP.getType(),
SP.isLocalToUnit(), SP.isDefinition(),
SP.getScopeLineNumber(),SP.getFlags(),SP.isOptimized(),
F);
return NSP;
}
/* fallthrough */
}
/* fallthrough */
}
return NULL;
}
示例5:
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;
}
示例6: NewMetadataObj
int
DefineFile(
ClientData clientData,
Tcl_Interp *interp,
int objc,
Tcl_Obj *const objv[])
{
if (objc != 4) {
Tcl_WrongNumArgs(interp, 1, objv, "DIBuilder file directory");
return TCL_ERROR;
}
DIBuilder *builder;
if (GetDIBuilderFromObj(interp, objv[1], builder) != TCL_OK)
return TCL_ERROR;
std::string file = Tcl_GetString(objv[2]);
std::string dir = Tcl_GetString(objv[3]);
auto val = builder->createFile(file, dir);
Tcl_SetObjResult(interp, NewMetadataObj(val, "File"));
return TCL_OK;
}
示例7: LLVMDIBuilderCreateFile
LLVMMetadataRef LLVMDIBuilderCreateFile(LLVMDIBuilderRef Dref, const char *File,
const char *Dir) {
DIBuilder *D = unwrap(Dref);
return wrap(D->createFile(File, Dir));
}
示例8: LLVMDIBuilderCreateFile
LLVMValueRef LLVMDIBuilderCreateFile(LLVMDIBuilderRef Dref, const char *File,
const char *Dir) {
DIBuilder *D = unwrap(Dref);
DIFile F = D->createFile(File, Dir);
return wrap(F);
}
示例9: DIBuilderCreateFile
LLVMValueRef DIBuilderCreateFile(LLVMDIBuilderRef dref, const char *file,
const char *dir) {
DIBuilder *d = unwrap(dref);
DIFile f = d->createFile(StringRef(file), StringRef(dir));
return wrap(f);
}