本文整理汇总了C++中SrcKey::getFuncId方法的典型用法代码示例。如果您正苦于以下问题:C++ SrcKey::getFuncId方法的具体用法?C++ SrcKey::getFuncId怎么用?C++ SrcKey::getFuncId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SrcKey
的用法示例。
在下文中一共展示了SrcKey::getFuncId方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: addTransPrologue
TransID ProfData::addTransPrologue(TransKind kind, const SrcKey& sk,
int nArgs) {
assert(kind == TransPrologue || kind == TransProflogue);
TransID transId = m_numTrans++;
m_transRecs.emplace_back(new ProfTransRec(transId, kind, sk, nArgs));
if (kind == TransProflogue) {
// only Proflogue translations need an entry in the m_prologueDB
m_prologueDB.add(sk.getFuncId(), nArgs, transId);
}
return transId;
}
示例2: findLastBcOffset
/*
* Returns the last BC offset in the region that corresponds to the
* function where the region starts. This will normally be the offset
* of the last instruction in the last block, except if the function
* ends with an inlined call. In this case, the offset of the
* corresponding FCall* in the function that starts the region is
* returned.
*/
static Offset findLastBcOffset(const RegionDescPtr region) {
assert(region->blocks.size() > 0);
auto& blocks = region->blocks;
FuncId startFuncId = blocks[0]->start().getFuncId();
for (int i = blocks.size() - 1; i >= 0; i--) {
SrcKey sk = blocks[i]->last();
if (sk.getFuncId() == startFuncId) {
return sk.offset();
}
}
not_reached();
}
示例3: show
std::string show(SrcKey sk) {
auto func = sk.func();
auto unit = sk.unit();
const char *filepath = "*anonFile*";
if (unit->filepath()->data() && unit->filepath()->size()) {
filepath = unit->filepath()->data();
}
return folly::format("{}:{} in {}(id 0x{:#x})@{: >6}",
filepath, unit->getLineNumber(sk.offset()),
func->isPseudoMain() ? "pseudoMain"
: func->fullName()->data(),
(unsigned long long)sk.getFuncId(), sk.offset()).str();
}
示例4: showShort
std::string showShort(SrcKey sk) {
if (!sk.valid()) return "<invalid SrcKey>";
return folly::format("{}(id {:#x})@{}{}",
sk.func()->fullName()->data(), sk.getFuncId(),
sk.offset(), sk.resumed() ? "r" : "").str();
}
示例5: showShort
std::string showShort(SrcKey sk) {
return folly::format("{}(id 0x{:#x})@{}",
sk.func()->fullName()->data(), sk.getFuncId(),
sk.offset()).str();
}