本文整理汇总了C++中GlobalVariable::getParent方法的典型用法代码示例。如果您正苦于以下问题:C++ GlobalVariable::getParent方法的具体用法?C++ GlobalVariable::getParent怎么用?C++ GlobalVariable::getParent使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GlobalVariable
的用法示例。
在下文中一共展示了GlobalVariable::getParent方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: LLVMGetPreviousGlobal
LLVMValueRef LLVMGetPreviousGlobal(LLVMValueRef GlobalVar) {
GlobalVariable *GV = unwrap<GlobalVariable>(GlobalVar);
Module::global_iterator I = GV;
if (I == GV->getParent()->global_begin())
return 0;
return wrap(--I);
}
示例2: LLVMGetNextGlobal
LLVMValueRef LLVMGetNextGlobal(LLVMValueRef GlobalVar) {
GlobalVariable *GV = unwrap<GlobalVariable>(GlobalVar);
Module::global_iterator I = GV;
if (++I == GV->getParent()->global_end())
return 0;
return wrap(I);
}
示例3: moveGlobalVariableInitializer
void moveGlobalVariableInitializer(GlobalVariable &OrigGV,
ValueToValueMapTy &VMap,
ValueMaterializer *Materializer,
GlobalVariable *NewGV) {
assert(OrigGV.hasInitializer() && "Nothing to move");
if (!NewGV)
NewGV = cast<GlobalVariable>(VMap[&OrigGV]);
else
assert(VMap[&OrigGV] == NewGV &&
"Incorrect global variable mapping in VMap.");
assert(NewGV->getParent() != OrigGV.getParent() &&
"moveGlobalVariableInitializer should only be used to move "
"initializers between modules");
NewGV->setInitializer(MapValue(OrigGV.getInitializer(), VMap, RF_None,
nullptr, Materializer));
}
示例4: isIn
bool SpecialCaseList::isIn(const GlobalVariable &G,
const StringRef Category) const {
return isIn(*G.getParent(), Category) ||
inSectionCategory("global", G.getName(), Category) ||
inSectionCategory("type", GetGVTypeString(G), Category);
}
示例5: findCategory
bool SpecialCaseList::findCategory(const GlobalVariable &G,
StringRef &Category) const {
return findCategory(*G.getParent(), Category) ||
findCategory("global", G.getName(), Category) ||
findCategory("type", GetGVTypeString(G), Category);
}
示例6: isIn
bool BlackList::isIn(const GlobalVariable &G) {
return isIn(*G.getParent()) || inSection("global", G.getName());
}
示例7: isInInit
bool BlackList::isInInit(const GlobalVariable &G) {
return (isIn(*G.getParent()) ||
inSection("global-init", G.getName()) ||
inSection("global-init-type", GetGVTypeString(G)));
}