diff options
author | dim <dim@FreeBSD.org> | 2015-05-27 18:47:56 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2015-05-27 18:47:56 +0000 |
commit | 3191b2b32a96e1a6ee833fcca73e5c8e0c67ba65 (patch) | |
tree | dbbd4047878da71c1a706e26ce05b4e7791b14cc /lib/AST/InheritViz.cpp | |
parent | 38d6f2e7f2ce51a5b3836d26596c6c34a3288752 (diff) | |
download | FreeBSD-src-3191b2b32a96e1a6ee833fcca73e5c8e0c67ba65.zip FreeBSD-src-3191b2b32a96e1a6ee833fcca73e5c8e0c67ba65.tar.gz |
Vendor import of clang trunk r238337:
https://llvm.org/svn/llvm-project/cfe/trunk@238337
Diffstat (limited to 'lib/AST/InheritViz.cpp')
-rw-r--r-- | lib/AST/InheritViz.cpp | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/lib/AST/InheritViz.cpp b/lib/AST/InheritViz.cpp index eb3020c..0b82da1 100644 --- a/lib/AST/InheritViz.cpp +++ b/lib/AST/InheritViz.cpp @@ -22,11 +22,9 @@ #include "llvm/Support/raw_ostream.h" #include <map> #include <set> +using namespace clang; -using namespace llvm; - -namespace clang { - +namespace { /// InheritanceHierarchyWriter - Helper class that writes out a /// GraphViz file that diagrams the inheritance hierarchy starting at /// a given C++ class type. Note that we do not use LLVM's @@ -44,7 +42,8 @@ public: : Context(Context), Out(Out) { } void WriteGraph(QualType Type) { - Out << "digraph \"" << DOT::EscapeString(Type.getAsString()) << "\" {\n"; + Out << "digraph \"" << llvm::DOT::EscapeString(Type.getAsString()) + << "\" {\n"; WriteNode(Type, false); Out << "}\n"; } @@ -59,6 +58,7 @@ protected: /// (only) virtual base. raw_ostream& WriteNodeReference(QualType Type, bool FromVirtual); }; +} // namespace void InheritanceHierarchyWriter::WriteNode(QualType Type, bool FromVirtual) { QualType CanonType = Context.getCanonicalType(Type); @@ -78,7 +78,7 @@ void InheritanceHierarchyWriter::WriteNode(QualType Type, bool FromVirtual) { // Give the node a label based on the name of the class. std::string TypeName = Type.getAsString(); - Out << " [ shape=\"box\", label=\"" << DOT::EscapeString(TypeName); + Out << " [ shape=\"box\", label=\"" << llvm::DOT::EscapeString(TypeName); // If the name of the class was a typedef or something different // from the "real" class name, show the real class name in @@ -139,9 +139,8 @@ void CXXRecordDecl::viewInheritance(ASTContext& Context) const { int FD; SmallString<128> Filename; - std::error_code EC = - sys::fs::createTemporaryFile(Self.getAsString(), "dot", FD, Filename); - if (EC) { + if (std::error_code EC = llvm::sys::fs::createTemporaryFile( + Self.getAsString(), "dot", FD, Filename)) { llvm::errs() << "Error: " << EC.message() << "\n"; return; } @@ -159,5 +158,3 @@ void CXXRecordDecl::viewInheritance(ASTContext& Context) const { // Display the graph DisplayGraph(Filename); } - -} |