OpenCores
URL https://opencores.org/ocsvn/scarts/scarts/trunk

Subversion Repositories scarts

[/] [scarts/] [trunk/] [toolchain/] [scarts-gcc/] [gcc-4.1.1/] [libstdc++-v3/] [testsuite/] [testsuite_abi.h] - Blame information for rev 19

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 19 jlechner
// -*- C++ -*-
2
 
3
// Copyright (C) 2004, 2005 Free Software Foundation, Inc.
4
 
5
// This library is free software; you can redistribute it and/or
6
// modify it under the terms of the GNU General Public License as
7
// published by the Free Software Foundation; either version 2, or (at
8
// your option) any later version.
9
 
10
// This library is distributed in the hope that it will be useful, but
11
// WITHOUT ANY WARRANTY; without even the implied warranty of
12
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13
// General Public License for more details.
14
 
15
// You should have received a copy of the GNU General Public License
16
// along with this library; see the file COPYING.  If not, write to
17
// the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston,
18
// MA 02110-1301, USA.
19
 
20
// As a special exception, you may use this file as part of a free
21
// software library without restriction.  Specifically, if other files
22
// instantiate templates or use macros or inline functions from this
23
// file, or you compile this file and link it with other files to
24
// produce an executable, this file does not by itself cause the
25
// resulting executable to be covered by the GNU General Public
26
// License.  This exception does not however invalidate any other
27
// reasons why the executable file might be covered by the GNU General
28
// Public License.
29
 
30
// Benjamin Kosnik  <bkoz@redhat.com>
31
 
32
#include <string>
33
#include <stdexcept>
34
#include <deque>
35
#include <ext/hash_map>
36
#include <cxxabi.h>
37
 
38
// Encapsulates symbol characteristics.
39
struct symbol
40
{
41
  enum category { function, object, uncategorized };
42
  enum designation { existing, added, subtracted, undesignated };
43
  enum version { none, compatible, incompatible, unversioned };
44
  enum compatibility
45
    {
46
      compat_type = 1,
47
      compat_name = 2,
48
      compat_size = 4,
49
      compat_version = 8
50
    };
51
 
52
  category      type;
53
  std::string   name;
54
  std::string   raw_name; // Name with versioning info still attached.
55
  std::string   demangled_name;
56
  int           size;
57
  std::string   version_name;
58
  version       version_status;
59
  designation   status;
60
 
61
  symbol()
62
  : type(uncategorized), size(0), version_status(unversioned),
63
    status(undesignated) { }
64
 
65
  symbol(const symbol& other)
66
  : type(other.type), name(other.name), demangled_name(other.demangled_name),
67
    size(other.size), version_name(other.version_name),
68
    version_status(other.version_status), status(other.status) { }
69
 
70
  void
71
  print() const;
72
 
73
  void
74
  init(std::string& data);
75
};
76
 
77
typedef __gnu_cxx::hash_map<std::string, symbol>        symbol_objects;
78
 
79
typedef std::deque<std::string>                         symbol_names;
80
 
81
typedef std::pair<symbol_names, symbol_objects>         symbols;
82
 
83
 
84
// Check.
85
bool
86
check_version(symbol& test, bool added = false);
87
 
88
bool
89
check_compatible(symbol& lhs, symbol& rhs, bool verbose = false);
90
 
91
 
92
// Examine.
93
bool
94
has_symbol(const std::string& mangled, const symbols& list) throw();
95
 
96
symbol&
97
get_symbol(const std::string& mangled, const symbols& list);
98
 
99
extern "C" void
100
examine_symbol(const char* name, const char* file);
101
 
102
extern "C" int
103
compare_symbols(const char* baseline_file, const char* test_file, bool verb);
104
 
105
 
106
// Util.
107
symbols
108
create_symbols(const char* file);
109
 
110
const char*
111
demangle(const std::string& mangled);
112
 
113
 
114
// Specialization.
115
namespace __gnu_cxx
116
{
117
  using namespace std;
118
 
119
  template<>
120
    struct hash<string>
121
    {
122
      size_t operator()(const string& s) const
123
      {
124
        const collate<char>& c = use_facet<collate<char> >(locale::classic());
125
        return c.hash(s.c_str(), s.c_str() + s.size());
126
      }
127
    };
128
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.