Ejemplo n.º 1
0
// Strip any named types of their names.
static void StripTypeNames(Module &M, bool PreserveDbgInfo) {
  std::vector<StructType*> StructTypes;
  M.findUsedStructTypes(StructTypes);

  for (unsigned i = 0, e = StructTypes.size(); i != e; ++i) {
    StructType *STy = StructTypes[i];
    if (STy->isAnonymous() || STy->getName().empty()) continue;
    
    if (PreserveDbgInfo && STy->getName().startswith("llvm.dbg"))
      continue;

    STy->setName("");
  }
}