本文整理汇总了C++中SourceLocation::Column方法的典型用法代码示例。如果您正苦于以下问题:C++ SourceLocation::Column方法的具体用法?C++ SourceLocation::Column怎么用?C++ SourceLocation::Column使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SourceLocation
的用法示例。
在下文中一共展示了SourceLocation::Column方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: HashKey
size_t HashKey(const FunctionInstance* key) const
{
// Instances without source file only equal themselves.
if (key->SourceFile() == NULL)
return (uint32)(addr_t)key;
uint32 hash = StringUtils::HashValue(key->Name());
hash = hash * 17 + (uint32)(addr_t)key->SourceFile();
SourceLocation location = key->GetSourceLocation();
hash = hash * 17 + location.Line();
hash = hash * 17 + location.Column();
return hash;
}
示例2:
status_t
Team::GetStatementAtSourceLocation(SourceCode* sourceCode,
const SourceLocation& location, Statement*& _statement)
{
TRACE_CODE("Team::GetStatementAtSourceLocation(%p, (%" B_PRId32 ", %"
B_PRId32 "))\n", sourceCode, location.Line(), location.Column());
// If we're lucky the source code can provide us with a statement.
if (DisassembledCode* code = dynamic_cast<DisassembledCode*>(sourceCode)) {
Statement* statement = code->StatementAtLocation(location);
if (statement == NULL)
return B_ENTRY_NOT_FOUND;
statement->AcquireReference();
_statement = statement;
return B_OK;
}
// Go the long and stony way over the source file and the team debug info.
// get the source file for the source code
LocatableFile* sourceFile = sourceCode->GetSourceFile();
if (sourceFile == NULL)
return B_ENTRY_NOT_FOUND;
// get the function at the source location
Function* function = fDebugInfo->FunctionAtSourceLocation(sourceFile,
location);
if (function == NULL)
return B_ENTRY_NOT_FOUND;
// Get some function instance and ask its image debug info to provide us
// with a statement.
FunctionInstance* functionInstance = function->FirstInstance();
if (functionInstance == NULL)
return B_ENTRY_NOT_FOUND;
FunctionDebugInfo* functionDebugInfo
= functionInstance->GetFunctionDebugInfo();
return functionDebugInfo->GetSpecificImageDebugInfo()
->GetStatementAtSourceLocation(functionDebugInfo, location, _statement);
}