i386: Allow all register_operand SUBREGs in x86_ternlog_idx.
[official-gcc.git] / gcc / go / gofrontend / go-dump.cc
blobdd5a4c3f238da3c663c63a2d9106e763007018bd
1 // go-dump.cc -- Go frontend debug dumps.
3 // Copyright 2009 The Go Authors. All rights reserved.
4 // Use of this source code is governed by a BSD-style
5 // license that can be found in the LICENSE file.
7 #include "go-system.h"
9 #include "go-c.h"
10 #include "go-dump.h"
12 namespace {
14 // The list of dumps.
16 Go_dump* dumps;
18 } // End empty namespace.
20 // Create a new dump.
22 Go_dump::Go_dump(const char* name)
23 : next_(dumps), name_(name), is_enabled_(false)
25 dumps = this;
28 // Enable a dump by name.
30 bool
31 Go_dump::enable_by_name(const char* name)
33 bool is_all = strcmp(name, "all") == 0;
34 bool found = false;
35 for (Go_dump* p = dumps; p != NULL; p = p->next_)
37 if (is_all || strcmp(name, p->name_) == 0)
39 p->is_enabled_ = true;
40 found = true;
43 return found;
46 // Enable a dump. Return 1 if this is a real name, 0 if not.
48 GO_EXTERN_C
49 int
50 go_enable_dump(const char* name)
52 return Go_dump::enable_by_name(name) ? 1 : 0;