diff options
author | Roberto Lublinerman <rluble@gmail.com> | 2011-08-24 19:22:44 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@gcc.gnu.org> | 2011-08-24 19:22:44 +0000 |
commit | 706cd57f714fcb3572f97ded0bfbfcfe090181bc (patch) | |
tree | b321299877c5f4c075b0bf489c636f9c0c8dc1f3 /gcc/go/gofrontend/string-dump.h | |
parent | 8020d73e39fbeef5c52455b8d935569b004fb031 (diff) | |
download | gcc-706cd57f714fcb3572f97ded0bfbfcfe090181bc.zip gcc-706cd57f714fcb3572f97ded0bfbfcfe090181bc.tar.gz gcc-706cd57f714fcb3572f97ded0bfbfcfe090181bc.tar.bz2 |
gccgo...
gccgo: fixes to ast-dump, refactoring of export and ast-dump
to implement a common interface for writing basic
type literals and added flags for optimization.
* lang.opt: Add fgo-optimize-.
* go-lang.c (go_langhook_handle_option): Handle OPT_fgo_optimize.
* go-c.h (go_enable_optimize): Declare.
* Make-lang.in (GO_OBJS): Add go/go-optimize.o.
(GO_EXPORT_H): Define.
(GO_IMPORT_H): Add $(GO_EXPORT_H).
(GO_AST_DUMP_H): Define.
(go/ast-dump.o, go/statements.o): Use GO_AST_DUMP_H.
(go/export.o, go/gogo.o, go/import.o): Use GO_EXPORT_H.
(go/types.o): Likewise.
(go/expressions.o): Use GO_AST_DUMP_H and GO_EXPORT_H.
(go/go-optimize.o): New target.
From-SVN: r178046
Diffstat (limited to 'gcc/go/gofrontend/string-dump.h')
-rw-r--r-- | gcc/go/gofrontend/string-dump.h | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/gcc/go/gofrontend/string-dump.h b/gcc/go/gofrontend/string-dump.h new file mode 100644 index 0000000..fe4807d --- /dev/null +++ b/gcc/go/gofrontend/string-dump.h @@ -0,0 +1,25 @@ +// string-dump.h -- Abstract base class for dumping strings. -*- C++ -*- + +// Copyright 2011 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +#ifndef GO_STRING_DUMP_H +#define GO_STRING_DUMP_H + +// This abstract class provides an interface strings for whatever purpose. +// Used for example for exporting and dumping objects. + +class String_dump +{ + public: + // Write a string. Implements the String_dump interface. + virtual void + write_string(const std::string& s) = 0; + + // Implementors should override this member, to dump a formatted c string. + virtual void + write_c_string(const char*) = 0; +}; + +#endif // GO_STRING_DUMP_H |