Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
llvm-epi-0.8
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Roger Ferrer
llvm-epi-0.8
Commits
72346e97
Commit
72346e97
authored
14 years ago
by
Dan Gohman
Browse files
Options
Downloads
Patches
Plain Diff
Revert 123553, as sys::fs::unique_file is not finished yet.
llvm-svn: 126772
parent
26bbc3d4
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
clang/lib/AST/InheritViz.cpp
+22
-17
22 additions, 17 deletions
clang/lib/AST/InheritViz.cpp
with
22 additions
and
17 deletions
clang/lib/AST/InheritViz.cpp
+
22
−
17
View file @
72346e97
...
@@ -17,7 +17,6 @@
...
@@ -17,7 +17,6 @@
#include
"clang/AST/Decl.h"
#include
"clang/AST/Decl.h"
#include
"clang/AST/DeclCXX.h"
#include
"clang/AST/DeclCXX.h"
#include
"clang/AST/TypeOrdering.h"
#include
"clang/AST/TypeOrdering.h"
#include
"llvm/Support/FileSystem.h"
#include
"llvm/Support/GraphWriter.h"
#include
"llvm/Support/GraphWriter.h"
#include
"llvm/Support/raw_ostream.h"
#include
"llvm/Support/raw_ostream.h"
#include
<map>
#include
<map>
...
@@ -136,28 +135,34 @@ InheritanceHierarchyWriter::WriteNodeReference(QualType Type,
...
@@ -136,28 +135,34 @@ InheritanceHierarchyWriter::WriteNodeReference(QualType Type,
/// class using GraphViz.
/// class using GraphViz.
void
CXXRecordDecl
::
viewInheritance
(
ASTContext
&
Context
)
const
{
void
CXXRecordDecl
::
viewInheritance
(
ASTContext
&
Context
)
const
{
QualType
Self
=
Context
.
getTypeDeclType
(
const_cast
<
CXXRecordDecl
*>
(
this
));
QualType
Self
=
Context
.
getTypeDeclType
(
const_cast
<
CXXRecordDecl
*>
(
this
));
// Create temp directory
std
::
string
ErrMsg
;
SmallString
<
128
>
Filename
;
sys
::
Path
Filename
=
sys
::
Path
::
GetTemporaryDirectory
(
&
ErrMsg
);
int
FileFD
=
0
;
if
(
Filename
.
isEmpty
())
{
if
(
error_code
ec
=
sys
::
fs
::
unique_file
(
llvm
::
errs
()
<<
"Error: "
<<
ErrMsg
<<
"
\n
"
;
"clang-class-inheritance-hierarchy-%%-%%-%%-%%-"
+
return
;
Self
.
getAsString
()
+
".dot"
,
}
FileFD
,
Filename
))
{
Filename
.
appendComponent
(
Self
.
getAsString
()
+
".dot"
);
errs
()
<<
"Error creating temporary output file: "
<<
ec
.
message
()
<<
'\n'
;
if
(
Filename
.
makeUnique
(
true
,
&
ErrMsg
))
{
llvm
::
errs
()
<<
"Error: "
<<
ErrMsg
<<
"
\n
"
;
return
;
return
;
}
}
llvm
::
errs
()
<<
"Writing '"
<<
Filename
<<
"'... "
;
llvm
::
errs
()
<<
"Writing '"
<<
Filename
.
c_str
()
<<
"'... "
;
llvm
::
raw_fd_ostream
O
(
FileFD
,
true
);
llvm
::
raw_fd_ostream
O
(
Filename
.
c_str
(),
ErrMsg
);
InheritanceHierarchyWriter
Writer
(
Context
,
O
);
Writer
.
WriteGraph
(
Self
);
llvm
::
errs
()
<<
" done.
\n
"
;
if
(
ErrMsg
.
empty
())
{
O
.
close
();
InheritanceHierarchyWriter
Writer
(
Context
,
O
);
Writer
.
WriteGraph
(
Self
);
llvm
::
errs
()
<<
" done.
\n
"
;
// Display the graph
O
.
close
();
DisplayGraph
(
sys
::
Path
(
Filename
));
// Display the graph
DisplayGraph
(
Filename
);
}
else
{
llvm
::
errs
()
<<
"error opening file for writing!
\n
"
;
}
}
}
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment