Improve AST dumping:
1) When dumping a declaration that declares a name for a type, also dump the named type.
2) Add a #pragma clang __debug dump X, that dumps the lookup results for X in
the current context.
llvm-svn: 257529
This commit is contained in:
@@ -650,6 +650,13 @@ void LookupResult::print(raw_ostream &Out) {
|
||||
}
|
||||
}
|
||||
|
||||
LLVM_DUMP_METHOD void LookupResult::dump() {
|
||||
llvm::errs() << "lookup results for " << getLookupName().getAsString()
|
||||
<< ":\n";
|
||||
for (NamedDecl *D : *this)
|
||||
D->dump();
|
||||
}
|
||||
|
||||
/// \brief Lookup a builtin function, when name lookup would otherwise
|
||||
/// fail.
|
||||
static bool LookupBuiltin(Sema &S, LookupResult &R) {
|
||||
@@ -4991,3 +4998,12 @@ const Sema::TypoExprState &Sema::getTypoExprState(TypoExpr *TE) const {
|
||||
void Sema::clearDelayedTypo(TypoExpr *TE) {
|
||||
DelayedTypos.erase(TE);
|
||||
}
|
||||
|
||||
void Sema::ActOnPragmaDump(Scope *S, SourceLocation IILoc, IdentifierInfo *II) {
|
||||
DeclarationNameInfo Name(II, IILoc);
|
||||
LookupResult R(*this, Name, LookupAnyName, Sema::NotForRedeclaration);
|
||||
R.suppressDiagnostics();
|
||||
R.setHideTags(false);
|
||||
LookupName(R, S);
|
||||
R.dump();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user