;
33classInheritanceHierarchyWriter {
36std::map<QualType, int, QualTypeOrdering> DirectBaseCount;
37std::set<QualType, QualTypeOrdering> KnownVirtualBases;
40InheritanceHierarchyWriter(
ASTContext& Context, raw_ostream& Out)
41: Context(Context), Out(Out) { }
44Out <<
"digraph \""<< llvm::DOT::EscapeString(
Type.getAsString())
46WriteNode(
Type,
false);
58raw_ostream& WriteNodeReference(
QualType Type,
boolFromVirtual);
62voidInheritanceHierarchyWriter::WriteNode(
QualType Type,
boolFromVirtual) {
66 if(!KnownVirtualBases.insert(CanonType).second)
75WriteNodeReference(
Type, FromVirtual);
79Out <<
" [ shape=\"box\", label=\""<< llvm::DOT::EscapeString(TypeName);
94 for(
const auto&
Base:
Decl->bases()) {
99 if(!
Base.isVirtual())
100++DirectBaseCount[CanonBaseType];
103WriteNode(
Base.getType(),
Base.isVirtual());
107WriteNodeReference(
Type, FromVirtual);
109WriteNodeReference(
Base.getType(),
Base.isVirtual());
112 if(
Base.isVirtual()) {
113Out <<
" [ style=\"dashed\" ]";
123InheritanceHierarchyWriter::WriteNodeReference(
QualType Type,
129Out <<
"_"<< DirectBaseCount[CanonType];
140 if(std::error_code EC = llvm::sys::fs::createTemporaryFile(
142llvm::errs() <<
"Error: "<< EC.message() <<
"\n";
146llvm::errs() <<
"Writing '"<<
Filename<<
"'... ";
148llvm::raw_fd_ostream O(FD,
true);
150InheritanceHierarchyWriter Writer(Context, O);
151Writer.WriteGraph(
Self);
152llvm::errs() <<
" done. \n";
Defines the clang::ASTContext interface.
Defines the C++ Decl subclasses, other than those for templates (found in DeclTemplate....
Allows QualTypes to be sorted and hence used in maps and sets.
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
CanQualType getCanonicalType(QualType T) const
Return the canonical (structural) type corresponding to the specified potentially non-canonical type ...
QualType getTypeDeclType(const TypeDecl *Decl, const TypeDecl *PrevDecl=nullptr) const
Return the unique reference to the type for the specified type declaration.
Represents a C++ struct/union/class.
void viewInheritance(ASTContext &Context) const
Renders and displays an inheritance diagram for this C++ class and all of its base classes (transitiv...
Decl - This represents one declaration (or definition), e.g.
A (possibly-)qualified type.
void * getAsOpaquePtr() const
static std::string getAsString(SplitQualType split, const PrintingPolicy &Policy)
A helper class that allows the use of isa/cast/dyncast to detect TagType objects of structs/unions/cl...
The base class of the type hierarchy.
const T * castAs() const
Member-template castAs<specific type>.
The JSON file list parser is used to communicate input to InstallAPI.
@ Self
'self' clause, allowed on Compute and Combined Constructs, plus 'update'.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4