aboutsummaryrefslogtreecommitdiff
path: root/gcc/go/gofrontend/ast-dump.cc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/go/gofrontend/ast-dump.cc')
-rw-r--r--gcc/go/gofrontend/ast-dump.cc10
1 files changed, 5 insertions, 5 deletions
diff --git a/gcc/go/gofrontend/ast-dump.cc b/gcc/go/gofrontend/ast-dump.cc
index 72b0142..8dad18c 100644
--- a/gcc/go/gofrontend/ast-dump.cc
+++ b/gcc/go/gofrontend/ast-dump.cc
@@ -166,24 +166,24 @@ const char* kAstDumpFileExtension = ".dump.ast";
void
Ast_dump_context::dump(Gogo* gogo, const char* basename)
{
- std::ofstream* out = new std::ofstream();
+ std::ofstream out;
std::string dumpname(basename);
dumpname += ".dump.ast";
- out->open(dumpname.c_str());
+ out.open(dumpname.c_str());
- if (out->fail())
+ if (out.fail())
{
error("cannot open %s:%m, -fgo-dump-ast ignored", dumpname.c_str());
return;
}
this->gogo_ = gogo;
- this->ostream_ = out;
+ this->ostream_ = &out;
Ast_dump_traverse_blocks_and_functions adtbf(this);
gogo->traverse(&adtbf);
- out->close();
+ out.close();
}
// Dump a textual representation of a type to the