本文整理汇总了C++中clang::QualType::getUnqualifiedType方法的典型用法代码示例。如果您正苦于以下问题:C++ QualType::getUnqualifiedType方法的具体用法?C++ QualType::getUnqualifiedType怎么用?C++ QualType::getUnqualifiedType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类clang::QualType
的用法示例。
在下文中一共展示了QualType::getUnqualifiedType方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: reportTypeMismatch
/**
* Reports mismatch between buffer type and mpi datatype.
* @param callExpr
*/
void MPIBugReporter::reportTypeMismatch(
const CallExpr *callExpr, const std::pair<size_t, size_t> &idxPair,
clang::QualType bufferType, std::string mpiType) const {
auto adc = analysisManager_.getAnalysisDeclContext(currentFunctionDecl_);
PathDiagnosticLocation location = PathDiagnosticLocation::createBegin(
callExpr, bugReporter_.getSourceManager(), adc);
// deref buffer type
while (bufferType->isPointerType()) {
bufferType = bufferType->getPointeeType();
}
// remove qualifiers
bufferType = bufferType.getUnqualifiedType();
SourceRange callRange = callExpr->getCallee()->getSourceRange();
std::string bugType{"type mismatch"};
std::string errorText{"Buffer type '" + bufferType.getAsString() +
+"' and specified MPI type '" + mpiType +
"' do not match. "};
llvm::SmallVector<SourceRange, 3> sourceRanges;
sourceRanges.push_back(callRange);
sourceRanges.push_back(callExpr->getArg(idxPair.first)->getSourceRange());
sourceRanges.push_back(callExpr->getArg(idxPair.second)->getSourceRange());
bugReporter_.EmitBasicReport(adc->getDecl(), &checkerBase_, bugType,
MPIError, errorText, location, sourceRanges);
}
示例2:
const std::string WebCLConfiguration::getNameOfType(clang::QualType type) const
{
return type.getUnqualifiedType().getAsString();
}