ROSE  0.9.9.139
Cxx_GrammarSerialization.h
1 // Declarations and templates for supporting boost::serialization of Sage IR nodes.
2 #ifndef ROSE_Cxx_GrammarSerialization_H
3 #define ROSE_Cxx_GrammarSerialization_H
4 
5 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
6 
7 // sage3basic.h or rose.h must be inlucded first from a .C file (don't do it here!)
8 #include <boost/serialization/export.hpp>
9 
10 // The declaration half of exporting polymorphic classes.
11 BOOST_CLASS_EXPORT_KEY(SgAsmArmInstruction);
12 BOOST_CLASS_EXPORT_KEY(SgAsmX86Instruction);
13 BOOST_CLASS_EXPORT_KEY(SgAsmPowerpcInstruction);
14 BOOST_CLASS_EXPORT_KEY(SgAsmMipsInstruction);
15 BOOST_CLASS_EXPORT_KEY(SgAsmM68kInstruction);
16 BOOST_CLASS_EXPORT_KEY(SgAsmInstruction);
17 BOOST_CLASS_EXPORT_KEY(SgAsmOperandList);
18 BOOST_CLASS_EXPORT_KEY(SgAsmBinaryAdd);
19 BOOST_CLASS_EXPORT_KEY(SgAsmBinarySubtract);
20 BOOST_CLASS_EXPORT_KEY(SgAsmBinaryMultiply);
21 BOOST_CLASS_EXPORT_KEY(SgAsmBinaryDivide);
22 BOOST_CLASS_EXPORT_KEY(SgAsmBinaryMod);
23 BOOST_CLASS_EXPORT_KEY(SgAsmBinaryAddPreupdate);
24 BOOST_CLASS_EXPORT_KEY(SgAsmBinarySubtractPreupdate);
25 BOOST_CLASS_EXPORT_KEY(SgAsmBinaryAddPostupdate);
26 BOOST_CLASS_EXPORT_KEY(SgAsmBinarySubtractPostupdate);
27 BOOST_CLASS_EXPORT_KEY(SgAsmBinaryLsl);
28 BOOST_CLASS_EXPORT_KEY(SgAsmBinaryLsr);
29 BOOST_CLASS_EXPORT_KEY(SgAsmBinaryAsr);
30 BOOST_CLASS_EXPORT_KEY(SgAsmBinaryRor);
31 BOOST_CLASS_EXPORT_KEY(SgAsmBinaryExpression);
32 BOOST_CLASS_EXPORT_KEY(SgAsmUnaryPlus);
33 BOOST_CLASS_EXPORT_KEY(SgAsmUnaryMinus);
34 BOOST_CLASS_EXPORT_KEY(SgAsmUnaryRrx);
35 BOOST_CLASS_EXPORT_KEY(SgAsmUnaryArmSpecialRegisterList);
36 BOOST_CLASS_EXPORT_KEY(SgAsmUnaryExpression);
37 BOOST_CLASS_EXPORT_KEY(SgAsmDirectRegisterExpression);
38 BOOST_CLASS_EXPORT_KEY(SgAsmIndirectRegisterExpression);
39 BOOST_CLASS_EXPORT_KEY(SgAsmRegisterReferenceExpression);
40 BOOST_CLASS_EXPORT_KEY(SgAsmRegisterNames);
41 BOOST_CLASS_EXPORT_KEY(SgAsmIntegerValueExpression);
42 BOOST_CLASS_EXPORT_KEY(SgAsmFloatValueExpression);
43 BOOST_CLASS_EXPORT_KEY(SgAsmConstantExpression);
44 BOOST_CLASS_EXPORT_KEY(SgAsmValueExpression);
45 BOOST_CLASS_EXPORT_KEY(SgAsmMemoryReferenceExpression);
46 BOOST_CLASS_EXPORT_KEY(SgAsmControlFlagsExpression);
47 BOOST_CLASS_EXPORT_KEY(SgAsmCommonSubExpression);
48 BOOST_CLASS_EXPORT_KEY(SgAsmRiscOperation);
49 BOOST_CLASS_EXPORT_KEY(SgAsmExprListExp);
50 BOOST_CLASS_EXPORT_KEY(SgAsmExpression);
51 BOOST_CLASS_EXPORT_KEY(SgAsmIntegerType);
52 BOOST_CLASS_EXPORT_KEY(SgAsmFloatType);
53 BOOST_CLASS_EXPORT_KEY(SgAsmScalarType);
54 BOOST_CLASS_EXPORT_KEY(SgAsmVectorType);
55 BOOST_CLASS_EXPORT_KEY(SgAsmType);
56 BOOST_CLASS_EXPORT_KEY(SgAsmFunction);
57 BOOST_CLASS_EXPORT_KEY(SgAsmBlock);
58 BOOST_CLASS_EXPORT_KEY(SgAsmStaticData);
59 BOOST_CLASS_EXPORT_KEY(SgAsmSynthesizedDataStructureDeclaration);
60 BOOST_CLASS_EXPORT_KEY(SgAsmSynthesizedFieldDeclaration);
61 BOOST_CLASS_EXPORT_KEY(SgAsmSynthesizedDeclaration);
62 BOOST_CLASS_EXPORT_KEY(SgAsmStatement);
63 BOOST_CLASS_EXPORT_KEY(SgAsmInterpretationList);
64 BOOST_CLASS_EXPORT_KEY(SgAsmInterpretation);
65 BOOST_CLASS_EXPORT_KEY(SgAsmElfFileHeader);
66 BOOST_CLASS_EXPORT_KEY(SgAsmElfSectionTable);
67 BOOST_CLASS_EXPORT_KEY(SgAsmElfSectionTableEntry);
68 BOOST_CLASS_EXPORT_KEY(SgAsmElfSegmentTable);
69 BOOST_CLASS_EXPORT_KEY(SgAsmElfSegmentTableEntryList);
70 BOOST_CLASS_EXPORT_KEY(SgAsmElfSegmentTableEntry);
71 BOOST_CLASS_EXPORT_KEY(SgAsmElfSymbolSection);
72 BOOST_CLASS_EXPORT_KEY(SgAsmElfSymbolList);
73 BOOST_CLASS_EXPORT_KEY(SgAsmElfSymbol);
74 BOOST_CLASS_EXPORT_KEY(SgAsmElfSymverSection);
75 BOOST_CLASS_EXPORT_KEY(SgAsmElfSymverEntry);
76 BOOST_CLASS_EXPORT_KEY(SgAsmElfSymverEntryList);
77 BOOST_CLASS_EXPORT_KEY(SgAsmElfSymverDefinedSection);
78 BOOST_CLASS_EXPORT_KEY(SgAsmElfSymverDefinedEntryList);
79 BOOST_CLASS_EXPORT_KEY(SgAsmElfSymverDefinedEntry);
80 BOOST_CLASS_EXPORT_KEY(SgAsmElfSymverDefinedAuxList);
81 BOOST_CLASS_EXPORT_KEY(SgAsmElfSymverDefinedAux);
82 BOOST_CLASS_EXPORT_KEY(SgAsmElfSymverNeededSection);
83 BOOST_CLASS_EXPORT_KEY(SgAsmElfSymverNeededEntryList);
84 BOOST_CLASS_EXPORT_KEY(SgAsmElfSymverNeededEntry);
85 BOOST_CLASS_EXPORT_KEY(SgAsmElfSymverNeededAuxList);
86 BOOST_CLASS_EXPORT_KEY(SgAsmElfSymverNeededAux);
87 BOOST_CLASS_EXPORT_KEY(SgAsmElfRelocSection);
88 BOOST_CLASS_EXPORT_KEY(SgAsmElfRelocEntryList);
89 BOOST_CLASS_EXPORT_KEY(SgAsmElfRelocEntry);
90 BOOST_CLASS_EXPORT_KEY(SgAsmElfDynamicSection);
91 BOOST_CLASS_EXPORT_KEY(SgAsmElfDynamicEntryList);
92 BOOST_CLASS_EXPORT_KEY(SgAsmElfDynamicEntry);
93 BOOST_CLASS_EXPORT_KEY(SgAsmElfStringSection);
94 BOOST_CLASS_EXPORT_KEY(SgAsmElfStrtab);
95 BOOST_CLASS_EXPORT_KEY(SgAsmElfNoteSection);
96 BOOST_CLASS_EXPORT_KEY(SgAsmElfNoteEntryList);
97 BOOST_CLASS_EXPORT_KEY(SgAsmElfNoteEntry);
98 BOOST_CLASS_EXPORT_KEY(SgAsmElfEHFrameSection);
99 BOOST_CLASS_EXPORT_KEY(SgAsmElfEHFrameEntryCIList);
100 BOOST_CLASS_EXPORT_KEY(SgAsmElfEHFrameEntryCI);
101 BOOST_CLASS_EXPORT_KEY(SgAsmElfEHFrameEntryFDList);
102 BOOST_CLASS_EXPORT_KEY(SgAsmElfEHFrameEntryFD);
103 BOOST_CLASS_EXPORT_KEY(SgAsmElfSection);
104 BOOST_CLASS_EXPORT_KEY(SgAsmDOSFileHeader);
105 BOOST_CLASS_EXPORT_KEY(SgAsmDOSExtendedHeader);
106 BOOST_CLASS_EXPORT_KEY(SgAsmPEFileHeader);
107 BOOST_CLASS_EXPORT_KEY(SgAsmPERVASizePairList);
108 BOOST_CLASS_EXPORT_KEY(SgAsmPERVASizePair);
109 BOOST_CLASS_EXPORT_KEY(SgAsmPEImportItem);
110 BOOST_CLASS_EXPORT_KEY(SgAsmPEImportItemList);
111 BOOST_CLASS_EXPORT_KEY(SgAsmPEImportDirectory);
112 BOOST_CLASS_EXPORT_KEY(SgAsmPEImportDirectoryList);
113 BOOST_CLASS_EXPORT_KEY(SgAsmPEImportSection);
114 BOOST_CLASS_EXPORT_KEY(SgAsmPEExportSection);
115 BOOST_CLASS_EXPORT_KEY(SgAsmPEExportDirectory);
116 BOOST_CLASS_EXPORT_KEY(SgAsmPEExportEntryList);
117 BOOST_CLASS_EXPORT_KEY(SgAsmPEExportEntry);
118 BOOST_CLASS_EXPORT_KEY(SgAsmPEStringSection);
119 BOOST_CLASS_EXPORT_KEY(SgAsmPESectionTable);
120 BOOST_CLASS_EXPORT_KEY(SgAsmPESectionTableEntry);
121 BOOST_CLASS_EXPORT_KEY(SgAsmPESection);
122 BOOST_CLASS_EXPORT_KEY(SgAsmStringStorage);
123 BOOST_CLASS_EXPORT_KEY(SgAsmBasicString);
124 BOOST_CLASS_EXPORT_KEY(SgAsmStoredString);
125 BOOST_CLASS_EXPORT_KEY(SgAsmGenericString);
126 BOOST_CLASS_EXPORT_KEY(SgAsmGenericHeaderList);
127 BOOST_CLASS_EXPORT_KEY(SgAsmGenericHeader);
128 BOOST_CLASS_EXPORT_KEY(SgAsmGenericSymbolList);
129 BOOST_CLASS_EXPORT_KEY(SgAsmGenericSymbol);
130 BOOST_CLASS_EXPORT_KEY(SgAsmGenericStrtab);
131 BOOST_CLASS_EXPORT_KEY(SgAsmGenericSectionList);
132 BOOST_CLASS_EXPORT_KEY(SgAsmGenericSection);
133 BOOST_CLASS_EXPORT_KEY(SgAsmGenericDLLList);
134 BOOST_CLASS_EXPORT_KEY(SgAsmGenericDLL);
135 BOOST_CLASS_EXPORT_KEY(SgAsmGenericFormat);
136 BOOST_CLASS_EXPORT_KEY(SgAsmGenericFileList);
137 BOOST_CLASS_EXPORT_KEY(SgAsmGenericFile);
138 BOOST_CLASS_EXPORT_KEY(SgAsmExecutableFileFormat);
139 BOOST_CLASS_EXPORT_KEY(SgAsmNode);
140 
141 
148 template<class Archive>
149 void roseAstSerializationRegistration(Archive &archive) {
150  archive.template register_type<SgAsmArmInstruction>();
151  archive.template register_type<SgAsmX86Instruction>();
152  archive.template register_type<SgAsmPowerpcInstruction>();
153  archive.template register_type<SgAsmMipsInstruction>();
154  archive.template register_type<SgAsmM68kInstruction>();
155  archive.template register_type<SgAsmInstruction>();
156  archive.template register_type<SgAsmOperandList>();
157  archive.template register_type<SgAsmBinaryAdd>();
158  archive.template register_type<SgAsmBinarySubtract>();
159  archive.template register_type<SgAsmBinaryMultiply>();
160  archive.template register_type<SgAsmBinaryDivide>();
161  archive.template register_type<SgAsmBinaryMod>();
162  archive.template register_type<SgAsmBinaryAddPreupdate>();
163  archive.template register_type<SgAsmBinarySubtractPreupdate>();
164  archive.template register_type<SgAsmBinaryAddPostupdate>();
165  archive.template register_type<SgAsmBinarySubtractPostupdate>();
166  archive.template register_type<SgAsmBinaryLsl>();
167  archive.template register_type<SgAsmBinaryLsr>();
168  archive.template register_type<SgAsmBinaryAsr>();
169  archive.template register_type<SgAsmBinaryRor>();
170  archive.template register_type<SgAsmBinaryExpression>();
171  archive.template register_type<SgAsmUnaryPlus>();
172  archive.template register_type<SgAsmUnaryMinus>();
173  archive.template register_type<SgAsmUnaryRrx>();
174  archive.template register_type<SgAsmUnaryArmSpecialRegisterList>();
175  archive.template register_type<SgAsmUnaryExpression>();
176  archive.template register_type<SgAsmDirectRegisterExpression>();
177  archive.template register_type<SgAsmIndirectRegisterExpression>();
178  archive.template register_type<SgAsmRegisterReferenceExpression>();
179  archive.template register_type<SgAsmRegisterNames>();
180  archive.template register_type<SgAsmIntegerValueExpression>();
181  archive.template register_type<SgAsmFloatValueExpression>();
182  archive.template register_type<SgAsmConstantExpression>();
183  archive.template register_type<SgAsmValueExpression>();
184  archive.template register_type<SgAsmMemoryReferenceExpression>();
185  archive.template register_type<SgAsmControlFlagsExpression>();
186  archive.template register_type<SgAsmCommonSubExpression>();
187  archive.template register_type<SgAsmRiscOperation>();
188  archive.template register_type<SgAsmExprListExp>();
189  archive.template register_type<SgAsmExpression>();
190  archive.template register_type<SgAsmIntegerType>();
191  archive.template register_type<SgAsmFloatType>();
192  archive.template register_type<SgAsmScalarType>();
193  archive.template register_type<SgAsmVectorType>();
194  archive.template register_type<SgAsmType>();
195  archive.template register_type<SgAsmFunction>();
196  archive.template register_type<SgAsmBlock>();
197  archive.template register_type<SgAsmStaticData>();
198  archive.template register_type<SgAsmSynthesizedDataStructureDeclaration>();
199  archive.template register_type<SgAsmSynthesizedFieldDeclaration>();
200  archive.template register_type<SgAsmSynthesizedDeclaration>();
201  archive.template register_type<SgAsmStatement>();
202  archive.template register_type<SgAsmInterpretationList>();
203  archive.template register_type<SgAsmInterpretation>();
204  archive.template register_type<SgAsmElfFileHeader>();
205  archive.template register_type<SgAsmElfSectionTable>();
206  archive.template register_type<SgAsmElfSectionTableEntry>();
207  archive.template register_type<SgAsmElfSegmentTable>();
208  archive.template register_type<SgAsmElfSegmentTableEntryList>();
209  archive.template register_type<SgAsmElfSegmentTableEntry>();
210  archive.template register_type<SgAsmElfSymbolSection>();
211  archive.template register_type<SgAsmElfSymbolList>();
212  archive.template register_type<SgAsmElfSymbol>();
213  archive.template register_type<SgAsmElfSymverSection>();
214  archive.template register_type<SgAsmElfSymverEntry>();
215  archive.template register_type<SgAsmElfSymverEntryList>();
216  archive.template register_type<SgAsmElfSymverDefinedSection>();
217  archive.template register_type<SgAsmElfSymverDefinedEntryList>();
218  archive.template register_type<SgAsmElfSymverDefinedEntry>();
219  archive.template register_type<SgAsmElfSymverDefinedAuxList>();
220  archive.template register_type<SgAsmElfSymverDefinedAux>();
221  archive.template register_type<SgAsmElfSymverNeededSection>();
222  archive.template register_type<SgAsmElfSymverNeededEntryList>();
223  archive.template register_type<SgAsmElfSymverNeededEntry>();
224  archive.template register_type<SgAsmElfSymverNeededAuxList>();
225  archive.template register_type<SgAsmElfSymverNeededAux>();
226  archive.template register_type<SgAsmElfRelocSection>();
227  archive.template register_type<SgAsmElfRelocEntryList>();
228  archive.template register_type<SgAsmElfRelocEntry>();
229  archive.template register_type<SgAsmElfDynamicSection>();
230  archive.template register_type<SgAsmElfDynamicEntryList>();
231  archive.template register_type<SgAsmElfDynamicEntry>();
232  archive.template register_type<SgAsmElfStringSection>();
233  archive.template register_type<SgAsmElfStrtab>();
234  archive.template register_type<SgAsmElfNoteSection>();
235  archive.template register_type<SgAsmElfNoteEntryList>();
236  archive.template register_type<SgAsmElfNoteEntry>();
237  archive.template register_type<SgAsmElfEHFrameSection>();
238  archive.template register_type<SgAsmElfEHFrameEntryCIList>();
239  archive.template register_type<SgAsmElfEHFrameEntryCI>();
240  archive.template register_type<SgAsmElfEHFrameEntryFDList>();
241  archive.template register_type<SgAsmElfEHFrameEntryFD>();
242  archive.template register_type<SgAsmElfSection>();
243  archive.template register_type<SgAsmDOSFileHeader>();
244  archive.template register_type<SgAsmDOSExtendedHeader>();
245  archive.template register_type<SgAsmPEFileHeader>();
246  archive.template register_type<SgAsmPERVASizePairList>();
247  archive.template register_type<SgAsmPERVASizePair>();
248  archive.template register_type<SgAsmPEImportItem>();
249  archive.template register_type<SgAsmPEImportItemList>();
250  archive.template register_type<SgAsmPEImportDirectory>();
251  archive.template register_type<SgAsmPEImportDirectoryList>();
252  archive.template register_type<SgAsmPEImportSection>();
253  archive.template register_type<SgAsmPEExportSection>();
254  archive.template register_type<SgAsmPEExportDirectory>();
255  archive.template register_type<SgAsmPEExportEntryList>();
256  archive.template register_type<SgAsmPEExportEntry>();
257  archive.template register_type<SgAsmPEStringSection>();
258  archive.template register_type<SgAsmPESectionTable>();
259  archive.template register_type<SgAsmPESectionTableEntry>();
260  archive.template register_type<SgAsmPESection>();
261  archive.template register_type<SgAsmStringStorage>();
262  archive.template register_type<SgAsmBasicString>();
263  archive.template register_type<SgAsmStoredString>();
264  archive.template register_type<SgAsmGenericString>();
265  archive.template register_type<SgAsmGenericHeaderList>();
266  archive.template register_type<SgAsmGenericHeader>();
267  archive.template register_type<SgAsmGenericSymbolList>();
268  archive.template register_type<SgAsmGenericSymbol>();
269  archive.template register_type<SgAsmGenericStrtab>();
270  archive.template register_type<SgAsmGenericSectionList>();
271  archive.template register_type<SgAsmGenericSection>();
272  archive.template register_type<SgAsmGenericDLLList>();
273  archive.template register_type<SgAsmGenericDLL>();
274  archive.template register_type<SgAsmGenericFormat>();
275  archive.template register_type<SgAsmGenericFileList>();
276  archive.template register_type<SgAsmGenericFile>();
277  archive.template register_type<SgAsmExecutableFileFormat>();
278  archive.template register_type<SgAsmNode>();
279 }
280 
281 #endif
282 #endif
List of pointers to file sections.
The GNU symbol version definitions.
One entry of the ELF symbol version needed table.
String associated with a binary file.
Expression that adds two operands.
List of dynamic linking section entries.
Contiguous region of a file.
Expression that performs a post-increment operation.
Expression representing a (no-op) unary plus operation.
Base class for references to a machine register.
Expression that performs a right rotate.
Auxiliary info for needed symbol version.
Instruction basic block.
Base class for all binary analysis IR nodes.
List of entries for the ELF symbol version definition table.
One entry of an ELF relocation table.
Represents the file header of an ELF binary container.
Expression that performs a post-decrement operation.
Portable Executable Import Section.
List of generic file headers.
List of binary interpretations.
Base class for machine instructions.
Section table entry.
Base class for scalar types.
List of expression nodes.
Expression that performs an arithmetic, sign-bit preserving right shift.
Expression that performs a logical, sign-bit non-preserving right shift.
Strings stored in an ELF or PE container.
Expression that returns the remainder when dividing the first operand by the second.
Node to hold a list of symbol node pointers.
Base class for ELF file sections.
Base class for PE sections.
Represents a synthesized function.
Expression that divides the first operand by the second.
Hods a list of symbol version aux entries.
Basic information about an executable container.
Entry in an ELF symbol version table.
ELF error handling frame entry frame description entry.
Represents an ELF relocation section.
One import directory per library.
GNU symbol version requirements table.
List of ELF relocation entries.
List of AST file node pointers.
ELF section containing dynamic linking information.
Represents the file header for DOS executables.
List of ELF EH frame CI entries.
Represents an ELF EH frame section.
One entry of an ELF notes table.
ELF string table section.
Reference to memory locations.
An ordered list of registers.
Base class for container file headers.
Expression represting negation.
List of pointers to other AST nodes.
Expression representing a machine register.
Base class for integer values.
ELF file section containing symbols.
List of operands for an instruction.
Base class for dynamically linked library information.
Expression that performs a pre-decrement operation.
Expression that performs a pre-increment operation.
A single imported object.
Represents one PowerPC machine instruction.
One entry from an ELF symbol version definition table.
Represents a single ELF symbol.
Base class for strings related to binary specimens.
DOS exteded header.
Represents static data in an executable.
Base class for unary expressions.
Base class for many binary analysis nodes.
Represents one Intel x86 machine instruction.
Represents one entry of a segment table.
Base class for expressions.
Expression that performs a logical left shift operation.
List of pointers to other nodes.
Expression that multiplies two operands.
Represents one MIPS machine instruction.
Represents one ARM machine instruction.
Node to hold list of ELF note entries.
List of entries from a symbol version table.
List of SgAsmPERVASizePair AST nodes.
Base class for binary types.
Export file section.
Registers accessed indirectly.
Base class for values.
Floating-point value.
Windows PE file header.
Expression that subtracts the second operand from the first.
Base class for synthesized declarations.
One entry from the dynamic linking table.
Integer types.
The ELF symbol version table.
Represents one entry in an ELF section table.
Represents an ELF segment table.
Strings stored in an ELF or PE container.
Represents an ELF section table.
ELF string table.
A list of imported items.
Represents an interpretation of a binary container.
List of symbol version needed entries.
Floating point types.
Base class for binary files.
Base class for binary expressions.
Declaration-like nodes that encapsulate multiple instructions.
Base class for vector types.
Base class for constants.
List of symbol version aux entries.
Static representation of instruction semantics.
A list of PE Import Directories.
ELF error handling frame entry, common information entry.