Debian Codegraph @

src/bin/dwarfgen/irepmacro.h

raw
1 /*
2 Copyright (C) 2010-2013 David Anderson. All rights reserved.
3
4 Redistribution and use in source and binary forms, with or without
5 modification, are permitted provided that the following
6 conditions are met:
7
8 * Redistributions of source code must retain the above
9 copyright notice, this list of conditions and the following
10 disclaimer.
11 * Redistributions in binary form must reproduce the above
12 copyright notice, this list of conditions and the following
13 disclaimer in the documentation and/or other materials
14 provided with the distribution.
15 * Neither the name of the example nor the
16 names of its contributors may be used to endorse or
17 promote products derived from this software without
18 specific prior written permission.
19
20 THIS SOFTWARE IS PROVIDED BY David Anderson ''AS IS''
21 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT
22 NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
23 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
24 NO EVENT SHALL David Anderson BE LIABLE FOR ANY DIRECT,
25 INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26 DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
27 OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
28 PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
29 ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30 LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
31 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
32 IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 */
34
35 //
36 // irepmacro.h
37 //
38
39 class IRMacroRecord {
40 public:
41 IRMacroRecord() {};
42 ~IRMacroRecord() {};
43 IRMacroRecord(Dwarf_Off cuDieOffset,Dwarf_Off offset,
44 Dwarf_Small type,
45 Dwarf_Signed lineno, Dwarf_Signed lineindex,
46 const std::string &macro):cuDieOffset_(cuDieOffset),
47 offset_(offset),
48 type_(type),lineno_(lineno),lineindex_(lineindex),
49 macro_(macro) {};
50 Dwarf_Off get_cudieoffset() {return cuDieOffset_;};
51 Dwarf_Off get_offset() {return offset_;};
52 Dwarf_Off get_type() {return type_;};
53 Dwarf_Off get_lineno() {return lineno_;};
54 Dwarf_Off get_lineindex() {return lineindex_;};
55 std::string& get_macro() {return macro_; }
56 private:
57 Dwarf_Off cuDieOffset_;
58 Dwarf_Off offset_;
59 Dwarf_Small type_;
60 Dwarf_Signed lineno_;
61 Dwarf_Signed lineindex_;
62 std::string macro_;
63 };
64 class IRMacro {
65 public:
66 IRMacro() {};
67 ~IRMacro() {};
68 std::vector<IRMacroRecord> &getMacroVec() { return macrorec_; };
69 private:
70 std::vector<IRMacroRecord> macrorec_;
71 };