CurrentToken->Type != TT_RegexLiteral &&
CurrentToken->Type != TT_TrailingReturnArrow)
CurrentToken->Type = TT_Unknown;
- if (CurrentToken->Role)
- CurrentToken->Role.reset(nullptr);
+ CurrentToken->Role.reset();
CurrentToken->FakeLParens.clear();
CurrentToken->FakeRParens = 0;
}
// FIXME: This should be replaced with something that doesn't rely on
// side-effects in PathDiagnosticConsumer's destructor. This is required when
// used with option -disable-free.
- Mgr.reset(nullptr);
+ Mgr.reset();
if (TUTotalTimer) TUTotalTimer->stopTimer();
VMap M;
public:
- UbigraphViz(raw_ostream *Out, StringRef Filename);
+ UbigraphViz(std::unique_ptr<raw_ostream> Out, StringRef Filename);
~UbigraphViz();
llvm::sys::fs::createTemporaryFile("llvm_ubi", "", FD, P);
llvm::errs() << "Writing '" << P.str() << "'.\n";
- std::unique_ptr<llvm::raw_fd_ostream> Stream;
- Stream.reset(new llvm::raw_fd_ostream(FD, true));
+ auto Stream = llvm::make_unique<llvm::raw_fd_ostream>(FD, true);
- return new UbigraphViz(Stream.release(), P);
+ return new UbigraphViz(std::move(Stream), P);
}
void UbigraphViz::AddEdge(ExplodedNode *Src, ExplodedNode *Dst) {
<< ", ('arrow','true'), ('oriented', 'true'))\n";
}
-UbigraphViz::UbigraphViz(raw_ostream *Out, StringRef Filename)
- : Out(Out), Filename(Filename), Cntr(0) {
+UbigraphViz::UbigraphViz(std::unique_ptr<raw_ostream> Out, StringRef Filename)
+ : Out(std::move(Out)), Filename(Filename), Cntr(0) {
*Out << "('vertex_style_attribute', 0, ('shape', 'icosahedron'))\n";
*Out << "('vertex_style', 1, 0, ('shape', 'sphere'), ('color', '#ffcc66'),"
}
UbigraphViz::~UbigraphViz() {
- Out.reset(nullptr);
+ Out.reset();
llvm::errs() << "Running 'ubiviz' program... ";
std::string ErrMsg;
std::string Ubiviz = llvm::sys::FindProgramByName("ubiviz");