From d2a5bee210218220a57d9f61a66e7f766a21d313 Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Wed, 26 Jun 2013 14:33:23 +0000 Subject: [PATCH] We only create one file, no need to delete a directory. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@184949 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp b/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp index 0303176efd..13f75b965c 100644 --- a/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp +++ b/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp @@ -681,14 +681,14 @@ namespace { class UbigraphViz : public ExplodedNode::Auditor { OwningPtr Out; - std::string Dir, Filename; + std::string Filename; unsigned Cntr; typedef llvm::DenseMap VMap; VMap M; public: - UbigraphViz(raw_ostream *Out, StringRef Dir, StringRef Filename); + UbigraphViz(raw_ostream *Out, StringRef Filename); ~UbigraphViz(); @@ -706,8 +706,7 @@ static ExplodedNode::Auditor* CreateUbiViz() { OwningPtr Stream; Stream.reset(new llvm::raw_fd_ostream(FD, true)); - StringRef Dir = llvm::sys::path::parent_path(P); - return new UbigraphViz(Stream.take(), Dir, P); + return new UbigraphViz(Stream.take(), P); } void UbigraphViz::AddEdge(ExplodedNode *Src, ExplodedNode *Dst) { @@ -744,8 +743,8 @@ void UbigraphViz::AddEdge(ExplodedNode *Src, ExplodedNode *Dst) { << ", ('arrow','true'), ('oriented', 'true'))\n"; } -UbigraphViz::UbigraphViz(raw_ostream *Out, StringRef Dir, StringRef Filename) - : Out(Out), Dir(Dir), Filename(Filename), Cntr(0) { +UbigraphViz::UbigraphViz(raw_ostream *Out, StringRef Filename) + : Out(Out), Filename(Filename), Cntr(0) { *Out << "('vertex_style_attribute', 0, ('shape', 'icosahedron'))\n"; *Out << "('vertex_style', 1, 0, ('shape', 'sphere'), ('color', '#ffcc66')," @@ -766,6 +765,6 @@ UbigraphViz::~UbigraphViz() { llvm::errs() << "Error viewing graph: " << ErrMsg << "\n"; } - // Delete the directory. - llvm::sys::fs::remove_all(Dir); + // Delete the file. + llvm::sys::fs::remove(Filename); } -- 2.40.0