当前位置: 首页>>代码示例>>C++>>正文


C++ SymbolBody::setName方法代码示例

本文整理汇总了C++中SymbolBody::setName方法的典型用法代码示例。如果您正苦于以下问题:C++ SymbolBody::setName方法的具体用法?C++ SymbolBody::setName怎么用?C++ SymbolBody::setName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SymbolBody的用法示例。


在下文中一共展示了SymbolBody::setName方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: getMaxVersionLen

// Versions are usually assigned to symbols using version scripts,
// but there's another way to assign versions to symbols.
// If a symbol name contains '@', the string after it is not
// actually a part of the symbol name but specifies a version.
// This function takes care of it.
template <class ELFT> void SymbolTable<ELFT>::scanSymbolVersions() {
  if (Config->VersionDefinitions.empty())
    return;

  int MaxVersionLen = getMaxVersionLen();

  // Unfortunately there's no way other than iterating over all
  // symbols to look for '@' characters in symbol names.
  // So this is inherently slow. A good news is that we do this
  // only when versions have been defined.
  for (Symbol *Sym : SymVector) {
    // Symbol versions for exported symbols are by nature
    // only for defined global symbols.
    SymbolBody *B = Sym->body();
    if (!B->isDefined())
      continue;
    uint8_t Visibility = B->getVisibility();
    if (Visibility != STV_DEFAULT && Visibility != STV_PROTECTED)
      continue;

    // Look for '@' in the symbol name.
    StringRef Name;
    uint16_t Version;
    std::tie(Name, Version) = getSymbolVersion(B, MaxVersionLen);
    if (Name.empty())
      continue;

    B->setName(Name);
    Sym->VersionId = Version;
  }
}
开发者ID:kwitaszczyk,项目名称:freebsd,代码行数:36,代码来源:SymbolTable.cpp


注:本文中的SymbolBody::setName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。