forked from OSchip/llvm-project
parent
9f9010ef47
commit
538af0906d
|
@ -1003,6 +1003,8 @@ public:
|
|||
static bool classof(const Name##Decl *D) { return true; }
|
||||
#include "clang/AST/DeclNodes.def"
|
||||
|
||||
void dump() const;
|
||||
|
||||
private:
|
||||
void LoadLexicalDeclsFromExternalStorage() const;
|
||||
void LoadVisibleDeclsFromExternalStorage() const;
|
||||
|
|
|
@ -148,6 +148,17 @@ void Decl::printGroup(Decl** Begin, unsigned NumDecls,
|
|||
}
|
||||
}
|
||||
|
||||
void DeclContext::dump() const {
|
||||
// Get the translation unit
|
||||
const DeclContext *DC = this;
|
||||
while (!DC->isTranslationUnit())
|
||||
DC = DC->getParent();
|
||||
|
||||
ASTContext &Ctx = cast<TranslationUnitDecl>(DC)->getASTContext();
|
||||
DeclPrinter Printer(llvm::errs(), Ctx, Ctx.PrintingPolicy, 0);
|
||||
Printer.VisitDeclContext(const_cast<DeclContext *>(this), /*Indent=*/false);
|
||||
}
|
||||
|
||||
void Decl::dump() const {
|
||||
print(llvm::errs());
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue