コード例 #1
0
ファイル: Core.cpp プロジェクト: blickly/llvm-clang-PRETC
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
0
ファイル: Core.cpp プロジェクト: blickly/llvm-clang-PRETC
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
0
ファイル: IndirectionUtils.cpp プロジェクト: Lucretia/llvm
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
0
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
0
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
0
ファイル: BlackList.cpp プロジェクト: indygreg/llvm
bool BlackList::isIn(const GlobalVariable &G) {
  return isIn(*G.getParent()) || inSection("global", G.getName());
}
コード例 #7
0
ファイル: BlackList.cpp プロジェクト: 32bitmicro/llvm
bool BlackList::isInInit(const GlobalVariable &G) {
  return (isIn(*G.getParent()) ||
          inSection("global-init", G.getName()) ||
          inSection("global-init-type", GetGVTypeString(G)));
}