本文整理汇总了C++中NamedDecl::printQualifiedName方法的典型用法代码示例。如果您正苦于以下问题:C++ NamedDecl::printQualifiedName方法的具体用法?C++ NamedDecl::printQualifiedName怎么用?C++ NamedDecl::printQualifiedName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NamedDecl
的用法示例。
在下文中一共展示了NamedDecl::printQualifiedName方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: matchesNodeFull
bool HasNameMatcher::matchesNodeFull(const NamedDecl &Node) const {
llvm::SmallString<128> NodeName = StringRef("::");
llvm::raw_svector_ostream OS(NodeName);
Node.printQualifiedName(OS);
const StringRef FullName = OS.str();
const StringRef Pattern = Name;
if (Pattern.startswith("::"))
return FullName == Pattern;
return FullName.endswith(Pattern) &&
FullName.drop_back(Pattern.size()).endswith("::");
}
示例2: VisitOMPThreadPrivateDecl
void DeclPrinter::VisitOMPThreadPrivateDecl(OMPThreadPrivateDecl *D) {
Out << "#pragma omp threadprivate";
if (!D->varlist_empty()) {
for (OMPThreadPrivateDecl::varlist_iterator I = D->varlist_begin(),
E = D->varlist_end();
I != E; ++I) {
Out << (I == D->varlist_begin() ? '(' : ',');
NamedDecl *ND = cast<NamedDecl>(cast<DeclRefExpr>(*I)->getDecl());
ND->printQualifiedName(Out);
}
Out << ")";
}
}
示例3: print
void TemplateArgument::print(const PrintingPolicy &Policy,
raw_ostream &Out) const {
switch (getKind()) {
case Null:
Out << "<no value>";
break;
case Type: {
PrintingPolicy SubPolicy(Policy);
SubPolicy.SuppressStrongLifetime = true;
getAsType().print(Out, SubPolicy);
break;
}
case Declaration: {
NamedDecl *ND = cast<NamedDecl>(getAsDecl());
Out << '&';
if (ND->getDeclName()) {
// FIXME: distinguish between pointer and reference args?
ND->printQualifiedName(Out);
} else {
Out << "<anonymous>";
}
break;
}
case NullPtr:
Out << "nullptr";
break;
case Template:
getAsTemplate().print(Out, Policy);
break;
case TemplateExpansion:
getAsTemplateOrTemplatePattern().print(Out, Policy);
Out << "...";
break;
case Integral: {
printIntegral(*this, Out);
break;
}
case Expression:
getAsExpr()->printPretty(Out, 0, Policy);
break;
case Pack:
Out << "<";
bool First = true;
for (TemplateArgument::pack_iterator P = pack_begin(), PEnd = pack_end();
P != PEnd; ++P) {
if (First)
First = false;
else
Out << ", ";
P->print(Policy, Out);
}
Out << ">";
break;
}
}
示例4: printTemplateArgument
// Adapted from tools\clang\lib\AST\TemplateBase.cpp TemplateArgument::print
void printTemplateArgument(raw_ostream &out, const PrintingPolicy &policy, TemplateArgument const &arg, bool qualifyNames)
{
switch (arg.getKind()) {
case TemplateArgument::Null:
out << "(no value)";
break;
case TemplateArgument::Type: {
PrintingPolicy SubPolicy(policy);
SubPolicy.SuppressStrongLifetime = true;
arg.getAsType().print(out, SubPolicy);
break;
}
case TemplateArgument::Declaration: {
NamedDecl *ND = cast<NamedDecl>(arg.getAsDecl());
out << '&';
if (ND->getDeclName()) {
// FIXME: distinguish between pointer and reference args?
ND->printQualifiedName(out);
}
else {
out << "(anonymous)";
}
break;
}
case TemplateArgument::NullPtr:
out << "nullptr";
break;
case TemplateArgument::Template:
// Orig: arg.getAsTemplate().print(out, policy);
{
auto templateName = arg.getAsTemplate();
printTemplateName(out, policy, templateName, qualifyNames);
break;
}
case TemplateArgument::TemplateExpansion:
arg.getAsTemplateOrTemplatePattern().print(out, policy);
out << "...";
break;
case TemplateArgument::Integral: {
printIntegral(arg, out, policy);
break;
}
case TemplateArgument::Expression:
arg.getAsExpr()->printPretty(out, nullptr, policy);
break;
case TemplateArgument::Pack:
out << "<";
bool First = true;
for (const auto &P : arg.pack_elements()) {
if (First)
First = false;
else
out << ", ";
P.print(policy, out);
}
out << ">";
break;
}
}