示例#1
0
文件: mangling.cpp 项目: Heromyth/ldc
std::string getMangledVTableSymbolName(AggregateDeclaration *aggrdecl) {
  std::string ret = "_D";

  std::string mangledName = mangle(aggrdecl);
  if (shouldHashAggrName(mangledName)) {
    ret += hashSymbolName(mangledName, aggrdecl);
  } else {
    ret += mangledName;
  }

  ret += "6__vtblZ";

  return gABI->mangleVariableForLLVM(std::move(ret), LINKd);
}
示例#2
0
文件: mangling.cpp 项目: redstar/ldc
std::string getIRMangledName(FuncDeclaration *fdecl, LINK link) {
  std::string mangledName = mangleExact(fdecl);

  // Hash the name if necessary
  if (((link == LINKd) || (link == LINKdefault)) &&
      (global.params.hashThreshold != 0) &&
      (mangledName.length() > global.params.hashThreshold)) {

    auto hashedName = hashSymbolName(mangledName, fdecl);
    mangledName = "_D" + hashedName + "Z";
  }

  // TODO: Cache the result?

  return getIRMangledFuncName(std::move(mangledName), link);
}
示例#3
0
文件: mangling.cpp 项目: Heromyth/ldc
std::string getMangledClassInfoSymbolName(AggregateDeclaration *aggrdecl) {
  std::string ret = "_D";

  std::string mangledName = mangle(aggrdecl);
  if (shouldHashAggrName(mangledName)) {
    ret += hashSymbolName(mangledName, aggrdecl);
  } else {
    ret += mangledName;
  }

  if (aggrdecl->isInterfaceDeclaration()) {
    ret += "11__InterfaceZ";
  } else {
    ret += "7__ClassZ";
  }

  return gABI->mangleVariableForLLVM(std::move(ret), LINKd);
}