ROSE 0.11.145.147
SgAsmExecutableFileFormat.h
1
2#ifndef ROSE_SgAsmExecutableFileFormat_H
3#define ROSE_SgAsmExecutableFileFormat_H
4#include <RoseFirst.h>
5#include <Cxx_GrammarDeclarations.h>
6#include <SgAsmNode.h>
7
8
9
10/* #line 1 "/workspace/src/ROSETTA/Grammar/grammarClassDeclarationMacros.macro" */
11
12// WARNING -- GENERATED CODE -- DO NOT MODIFY THIS CODE -- WARNING!
13// This code is automatically generated for each
14// terminal and non-terminal within the defined
15// grammar. There is a simple way to change the
16// code to fix bugs etc. See the ROSE README file
17// for directions.
18
19// tps: (02/22/2010): Adding DLL export requirements
20#include "rosedll.h"
21
22// predeclarations for SgAsmExecutableFileFormat
23
24/* #line 25 "../../../src/frontend/SageIII//SgAsmExecutableFileFormat.h" */
25/* #line 42310 "/workspace/src/ROSETTA/src/binaryInstruction.C" */
26
27#include <Rose/Exception.h>
28
29
30/* #line 13 "/workspace/src/ROSETTA/Grammar/grammarClassDeclarationMacros.macro after subst for $PREDECLARATIONS" */
31
32/* #line 14 "/workspace/src/ROSETTA/Grammar/grammarClassDeclarationMacros.macro" */
33
34#if !defined(DOCUMENTATION)
35// Class Definition for SgAsmExecutableFileFormat
36class ROSE_DLL_API SgAsmExecutableFileFormat : public SgAsmNode
37 {
38 public:
39
40
41/* #line 42 "../../../src/frontend/SageIII//SgAsmExecutableFileFormat.h" */
42
43 virtual SgNode* copy ( SgCopyHelp& help) const override;
44// Start of memberFunctionString
45/* #line 42320 "/workspace/src/ROSETTA/src/binaryInstruction.C" */
46
47
48 //----------------------- Boost serialization for SgAsmExecutableFileFormat -----------------------
49#ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
50private:
51 friend class boost::serialization::access;
52
53 template<class S>
54 void serialize(S &s, const unsigned /*version*/) {
55 debugSerializationBegin("SgAsmExecutableFileFormat");
56 s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmNode);
57 debugSerializationEnd("SgAsmExecutableFileFormat");
58 }
59#endif // ROSE_HAVE_BOOST_SERIALIZATION_LIB
61 // Local types
63public:
67 class ShortRead: public Rose::Exception {
68 public:
69 const SgAsmGenericSection *section;
70 rose_addr_t offset;
71 rose_addr_t size;
73 ShortRead(const class SgAsmGenericSection *section, size_t offset, size_t size)
74 : Rose::Exception("short read"), section(section), offset(offset), size(size) {}
75 ShortRead(const class SgAsmGenericSection *section, size_t offset, size_t size, const std::string &mesg)
76 : Rose::Exception(mesg), section(section), offset(offset), size(size) {}
77 ShortRead(const class SgAsmGenericSection *section, size_t offset, size_t size, const char *mesg)
78 : Rose::Exception(mesg), section(section), offset(offset), size(size) {}
79 ~ShortRead() throw () {}
80 };
81
85 class ShortWrite: public Rose::Exception {
86 public:
87 const SgAsmGenericSection *section;
88 rose_addr_t offset;
89 rose_addr_t size;
91 ShortWrite(const class SgAsmGenericSection *section, size_t offset, size_t size)
92 : Rose::Exception(""), section(section), offset(offset), size(size) {}
93 ShortWrite(const class SgAsmGenericSection *section, size_t offset, size_t size, const std::string &mesg)
94 : Rose::Exception(mesg), section(section), offset(offset), size(size) {}
95 ShortWrite(const class SgAsmGenericSection *section, size_t offset, size_t size, const char *mesg)
96 : Rose::Exception(mesg), section(section), offset(offset), size(size) {}
97 };
98
102 class FormatError: public Rose::Exception {
103 public:
104 FormatError(const std::string &mesg)
105 : Rose::Exception(mesg) {}
106 FormatError(const char *mesg)
107 : Rose::Exception(mesg) {}
108 ~FormatError() throw () {}
109 };
110
112 typedef struct stat fileDetails;
113
115 enum ExecFamily {
116 FAMILY_UNSPECIFIED,
117 FAMILY_DOS,
118 FAMILY_ELF,
119 FAMILY_JVM,
120 FAMILY_LE,
121 FAMILY_LX,
122 FAMILY_NE,
123 FAMILY_PE
124 };
125
127 enum ExecABI {
128 ABI_UNSPECIFIED,
129 ABI_OTHER,
130 ABI_86OPEN,
131 ABI_AIX,
132 ABI_ARM,
133 ABI_FREEBSD,
134 ABI_HPUX,
135 ABI_IRIX,
136 ABI_HURD,
137 ABI_JVM,
138 ABI_LINUX,
139 ABI_MODESTO,
140 ABI_MONTEREY,
141 ABI_MSDOS,
142 ABI_NT,
143 ABI_NETBSD,
144 ABI_OS2,
145 ABI_SOLARIS,
146 ABI_SYSV,
147 ABI_TRU64,
148 ABI_WIN386
149 };
150
152 enum InsSetArchitecture {
153 ISA_UNSPECIFIED = 0x0000,
154 ISA_OTHER = 0xffff,
155 ISA_FAMILY_MASK = 0xff00,
157 ISA_IA32_Family = 0x0100,
158 ISA_IA32_286 = 0x0101,
159 ISA_IA32_386 = 0x0102,
160 ISA_IA32_486 = 0x0103,
161 ISA_IA32_Pentium = 0x0104,
162 ISA_IA32_Cyrix6x86 = 0x0105,
163 ISA_IA32_AMDK5 = 0x0106,
164 ISA_IA32_PentiumPro = 0x0107,
165 ISA_IA32_PentiumII = 0x0108,
166 ISA_IA32_Athlon = 0x0109,
167 ISA_IA32_Pentium4 = 0x010a,
168 ISA_IA32_PentiumM = 0x010b,
170 ISA_X8664_Family = 0x0200,
171 ISA_X8664_Athlon64 = 0x0201,
172 ISA_X8664_Prescott = 0x0202,
173 ISA_X8664_IntelCore = 0x0203,
174 ISA_X8664_AMDPhenom = 0x0204,
176 ISA_SPARC_Family = 0x0300,
177 ISA_SPARC_V7 = 0x0301,
178 ISA_SPARC_V8 = 0x0302,
179 ISA_SPARC_V8E = 0x0303,
180 ISA_SPARC_V9 = 0x0304,
181 ISA_SPARC_V9JPS1 = 0x0305,
182 ISA_SPARC_V9UA = 0x0306,
183 ISA_SPARC_V9JPS2 = 0x0307,
184
185 ISA_M68K_Family = 0x0400,
186 ISA_M68K_68000 = 0x0401,
187 ISA_M68K_68EC000 = 0x0402,
188 ISA_M68K_68HC000 = 0x0403,
189 ISA_M68K_68008 = 0x0404,
190 ISA_M68K_68010 = 0x0405,
191 ISA_M68K_68012 = 0x0406,
192 ISA_M68K_68020 = 0x0407,
193 ISA_M68K_68EC020 = 0x0408,
194 ISA_M68K_68030 = 0x0409,
195 ISA_M68K_68EC030 = 0x040a,
196 ISA_M68K_68040 = 0x040b,
197 ISA_M68K_68EC040 = 0x040c,
198 ISA_M68K_68LC040 = 0x040d,
199 ISA_M68K_68060 = 0x040e,
200 ISA_M68K_ColdFire = 0x040f,
201 ISA_M68K_DragonBall = 0x0410,
203 ISA_M88K_Family = 0x0500,
204 ISA_M88K_88100 = 0x0501,
205 ISA_M88K_88110 = 0x0502,
206 ISA_M88K_88110MP = 0x0503,
207 ISA_M88K_88120 = 0x0504,
209 ISA_MIPS_Family = 0x0600,
210 ISA_MIPS_MarkI = 0x0601,
211 ISA_MIPS_MarkII = 0x0602,
212 ISA_MIPS_MarkIII = 0x0603,
213 ISA_MIPS_R2000 = 0x0604,
214 ISA_MIPS_R3000 = 0x0605,
215 ISA_MIPS_R4000 = 0x0606,
216 ISA_MIPS_R4200 = 0x0607,
217 ISA_MIPS_R4300 = 0x0608,
218 ISA_MIPS_R4600 = 0x0609,
219 ISA_MIPS_R4650 = 0x060a,
220 ISA_MIPS_R4700 = 0x060b,
221 ISA_MIPS_R5000 = 0x060c,
222 ISA_MIPS_RM7000 = 0x060d,
223 ISA_MIPS_R8000 = 0x060e,
224 ISA_MIPS_R10000 = 0x060f,
225 ISA_MIPS_R12000 = 0x0610,
226 ISA_MIPS_R14000 = 0x0611,
227 ISA_MIPS_R16000 = 0x0612,
228 ISA_MIPS_R16000A = 0x0613,
229 ISA_MIPS_16 = 0x0614,
230 ISA_MIPS_FPU = 0x0615,
231 ISA_MIPS_16FPU = 0x0616,
233 ISA_I860_Family = 0x0700,
234 ISA_I860_860XR = 0x0701,
235 ISA_I860_860XP = 0x0702,
237 ISA_IA64_Family = 0x0800,
238 ISA_IA64_Itanium = 0x0801,
239 ISA_IA64_Itanium2 = 0x0802,
241 // See http://en.wikipedia.org/wiki/ARM_architecture
242 ISA_ARM_Family = 0x0900,
243 ISA_ARM_ARM1 = 0x0901,
244 ISA_ARM_ARM2 = 0x0902,
245 ISA_ARM_ARM3 = 0x0903,
246 ISA_ARM_ARM6 = 0x0904,
247 ISA_ARM_ARM7 = 0x0905,
248 ISA_ARM_ARM7TDMI = 0x0906,
249 ISA_ARM_StrongARM = 0x0907,
250 ISA_ARM_ARM8 = 0x0908,
251 ISA_ARM_ARM9TDMI = 0x0909,
252 ISA_ARM_ARM9E = 0x090a,
253 ISA_ARM_ARM10E = 0x090b,
254 ISA_ARM_XScale = 0x090c,
258 ISA_ARM_ARM11 = 0x090d,
259 ISA_ARM_Cortex = 0x090e,
260 ISA_ARM_A64 = 0x090f,
262 ISA_JVM = 0x0a00,
264 // Others, not yet incorporated into this enum
265 ISA_OTHER_Family = 0xf000,
266
267 ISA_ATT_WE_32100 = 0xf001,
268 ISA_IBM_System_370 = 0xf002,
269 ISA_HPPA = 0xf003,
270 ISA_Fujitsu_VPP500 = 0xf004,
271 ISA_Sun_v8plus = 0xf005,
272 ISA_PowerPC = 0xf006,
273 ISA_PowerPC_64bit = 0xf007,
274 ISA_IBM_S390 = 0xf008,
275 ISA_NEC_V800_series = 0xf009,
276 ISA_Fujitsu_FR20 = 0xf00a,
277 ISA_TRW_RH_32 = 0xf00b,
278 ISA_Motorola_RCE = 0xf00c,
279 ISA_Digital_Alpha_fake = 0xf00e,
280 ISA_Hitachi_SH = 0xf00f,
281 ISA_Siemens_Tricore = 0xf010,
282 ISA_Argonaut_RISC_Core = 0xf011,
283 ISA_Hitachi_H8_300 = 0xf012,
284 ISA_Hitachi_H8_300H = 0xf013,
285 ISA_Hitachi_H8S = 0xf014,
286 ISA_Hitachi_H8_500 = 0xf015,
287 ISA_Stanford_MIPS_X = 0xf016,
288 ISA_Motorola_M68HC12 = 0xf017,
289 ISA_Fujitsu_MMA_Multimedia_Accelerator=0xf018,
290 ISA_Siemens_PCP = 0xf019,
291 ISA_Sony_nCPU_embeeded_RISC = 0xf01a,
292 ISA_Denso_NDR1_microprocessor=0xf01b,
293 ISA_Motorola_Start_Core_processor=0xf01c,
294 ISA_Toyota_ME16_processor = 0xf01d,
295 ISA_STMicroelectronic_ST100_processor=0xf01e,
296 ISA_Advanced_Logic_Corp_Tinyj_emb_family=0xf01f,
297 ISA_AMD_x86_64_architecture = 0xf020,
298 ISA_Sony_DSP_Processor = 0xf021,
299 ISA_Siemens_FX66_microcontroller=0xf022,
300 ISA_STMicroelectronics_ST9_plus_8_16_microcontroller=0xf023,
301 ISA_STMicroelectronics_ST7_8bit_microcontroller=0xf024,
302 ISA_Motorola_MC68HC16_microcontroller=0xf025,
303 ISA_Motorola_MC68HC11_microcontroller=0xf026,
304 ISA_Motorola_MC68HC08_microcontroller=0xf027,
305 ISA_Motorola_MC68HC05_microcontroller=0xf028,
306 ISA_Silicon_Graphics_SVx = 0xf029,
307 ISA_STMicroelectronics_ST19_8bit_microcontroller=0xf02a,
308 ISA_Digital_VAX = 0xf02b,
309 ISA_Axis_Communications_32bit_embedded_processor=0xf02c,
310 ISA_Infineon_Technologies_32bit_embedded_processor=0xf02d,
311 ISA_Element_14_64bit_DSP_Processor=0xf02e,
312 ISA_LSI_Logic_16bit_DSP_Processor=0xf02f,
313 ISA_Donald_Knuths_educational_64bit_processor=0xf030,
314 ISA_Harvard_University_machine_independent_object_files=0xf031,
315 ISA_SiTera_Prism = 0xf032,
316 ISA_Atmel_AVR_8bit_microcontroller=0xf033,
317 ISA_Fujitsu_FR30 = 0xf034,
318 ISA_Mitsubishi_D10V = 0xf035,
319 ISA_Mitsubishi_D30V = 0xf036,
320 ISA_NEC_v850 = 0xf037,
321 ISA_Mitsubishi_M32R = 0xf038,
322 ISA_Matsushita_MN10300 = 0xf039,
323 ISA_Matsushita_MN10200 = 0xf03a,
324 ISA_picoJava = 0xf03b,
325 ISA_OpenRISC_32bit_embedded_processor=0xf03c,
326 ISA_ARC_Cores_Tangent_A5 = 0xf03d,
327 ISA_Tensilica_Xtensa_Architecture=0xf03e,
328 ISA_Digital_Alpha = 0xf03f,
329 ISA_Matsushita_AM33 = 0xf040,
330 ISA_EFI_ByteCode = 0xf041
331 };
332
334 enum ExecPurpose {
335 PURPOSE_UNSPECIFIED,
336 PURPOSE_OTHER,
337 PURPOSE_EXECUTABLE,
338 PURPOSE_LIBRARY,
339 PURPOSE_CORE_DUMP,
340 PURPOSE_OS_SPECIFIC,
341 PURPOSE_PROC_SPECIFIC
342 };
343
345 // Functions
347public:
349 static SgAsmGenericFile *parseBinaryFormat(const char *name);
350
355 static void unparseBinaryFormat(const std::string &name, SgAsmGenericFile*);
356
361 static void unparseBinaryFormat(std::ostream&, SgAsmGenericFile*);
362
365
369 static void initDiagnostics();
370
371 // These convert enums to strings. It is better to use the automatic enum stringification instead. They have names like
372 // Rose::stringifySgAsmExecutableFileFormatInsnSetArchitecture, etc. */
373 static std::string isaFamilyToString(SgAsmExecutableFileFormat::InsSetArchitecture);
374 static std::string isaToString(SgAsmExecutableFileFormat::InsSetArchitecture);
379
381 // Deprecated 2023-11
383public:
384 static std::string isa_family_to_string(SgAsmExecutableFileFormat::InsSetArchitecture) ROSE_DEPRECATED("use isaFamilyToString");
385 static std::string isa_to_string(SgAsmExecutableFileFormat::InsSetArchitecture) ROSE_DEPRECATED("use isaToString");
386 static std::string to_string(SgAsmExecutableFileFormat::InsSetArchitecture) ROSE_DEPRECATED("use toString");
387 static std::string to_string(SgAsmExecutableFileFormat::ExecFamily) ROSE_DEPRECATED("use toString");
388 static std::string to_string(SgAsmExecutableFileFormat::ExecABI) ROSE_DEPRECATED("use toString");
389 static std::string to_string(SgAsmExecutableFileFormat::ExecPurpose) ROSE_DEPRECATED("use toString");
390public:
393
394protected:
397
398protected:
406
407
408// End of memberFunctionString
409// Start of memberFunctionString
410/* #line 1 "/workspace/src/ROSETTA/Grammar/Common.code" */
411
412// *** COMMON CODE SECTION BEGINS HERE ***
413
414 public:
415
416 // DQ (3/25/3006): I put this back in because it had the logic for where the copy function required
417 // and not required which is required to match the other aspects of the copy mechanism code generation.
418 // Specifically it is a problem to declare the copy function everywhere because it is not implemented
419 // for the SgSymbol IR nodes. I'm not clear why it is not implemented for these IR nodes.
420 /* \brief Copies AST (whole subtree, depending on the SgCopyHelp class */
421 // virtual SgNode* copy ( const SgCopyHelp & help) const;
422
424 virtual std::string class_name() const override;
425
427 virtual VariantT variantT() const override; // MS: new variant used in tree traversal
428
430 // King84 (2010.08.16): Moved this to an enum to save space, since it's only used at compiler-time anyway.
431 // static const VariantT static_variant = V_SgAsmExecutableFileFormat;
432 enum { static_variant = V_SgAsmExecutableFileFormat };
433
434 /* the generated cast function */
436 ROSE_DLL_API friend SgAsmExecutableFileFormat* isSgAsmExecutableFileFormat( SgNode * s );
437
439 ROSE_DLL_API friend const SgAsmExecutableFileFormat* isSgAsmExecutableFileFormat( const SgNode * s );
440
441 // ******************************************
442 // * Memory Pool / New / Delete
443 // ******************************************
444
445 public:
447 static const unsigned pool_size; //
449 static std::vector<unsigned char *> pools; //
451 static SgAsmExecutableFileFormat * next_node; //
452
454 static unsigned long initializeStorageClassArray(SgAsmExecutableFileFormatStorageClass *); //
455
457 static void clearMemoryPool(); //
458 static void deleteMemoryPool(); //
459
461 static void extendMemoryPoolForFileIO(); //
462
464 static SgAsmExecutableFileFormat * getPointerFromGlobalIndex(unsigned long); //
466 static SgAsmExecutableFileFormat * getPointerFromGlobalIndex(AstSpecificDataManagingClass *, unsigned long); //
467
469 static unsigned long getNumberOfValidNodesAndSetGlobalIndexInFreepointer(unsigned long); //
471 static void resetValidFreepointers(); //
473 static unsigned long getNumberOfLastValidPointer(); //
474
475
476#if defined(INLINE_FUNCTIONS)
478 inline void *operator new (size_t size);
479#else
481 void *operator new (size_t size);
482#endif
484 void operator delete (void* pointer, size_t size);
485
486 // DQ (4/5/2007): This is not the correct operator that we want, but appears to be required to compile ROSE with ROSE.
487 void operator delete (void* pointer)
488 {
489 // This is the generated delete operator...
490 SgAsmExecutableFileFormat::operator delete (pointer,sizeof(SgAsmExecutableFileFormat));
491 }
492
494 static size_t numberOfNodes();
495
497 static size_t memoryUsage();
498
499 // End of scope which started in IR nodes specific code
500 /* */
501
502 /* name Internal Functions
503 \brief Internal functions ... incomplete-documentation
504
505 These functions have been made public as part of the design, but they are suggested for internal use
506 or by particularly knowledgeable users for specialized tools or applications.
507
508 \internal We could not make these private because they are required by user for special purposes. And
509 it would be unwieldy to have many of the internal classes in ROSE be explicitly defined as friends.
510
511 */
512
513 // MS: 02/12/02 container of pointers to AST successor nodes used in the traversal
514 // overridden in every class by *generated* implementation
516 virtual std::vector<SgNode*> get_traversalSuccessorContainer() override;
517 // MS: 06/28/02 container of names of variables or container indices
518 // used used in the traversal to access AST successor nodes
519 // overridden in every class by *generated* implementation
522 virtual std::vector<std::string> get_traversalSuccessorNamesContainer() override;
523
524 // GB (09/25/2007): Functions for index-based access to traversal successors; these are hopefully a lot faster
525 // than all the vector copies. The implementation for these functions is generated for each class.
527 virtual size_t get_numberOfTraversalSuccessors() override;
529 virtual SgNode *get_traversalSuccessorByIndex(size_t idx) override;
531 virtual size_t get_childIndex(SgNode *child) override;
532
533#ifndef ROSE_USE_INTERNAL_FRONTEND_DEVELOPMENT
534 // MS: 08/16/2002 method for generating RTI information
536 virtual RTIReturnType roseRTI() override;
537#endif
538 /* */
539
540
541
542 /* name Deprecated Functions
543 \brief Deprecated functions ... incomplete-documentation
544
545 These functions have been deprecated from use.
546 */
547 /* */
548
550 virtual const char* sage_class_name() const override ROSE_DEPRECATED_FUNCTION;
551
552 // JJW (10/16/2008): Changed to a single function in Node.code, and put
553 // getVariant() in #if 0 block to prevent confusing Doxygen
554#if 0
556 virtual int variant() const ROSE_DEPRECATED_FUNCTION;
558 // virtual int getVariant() const ROSE_DEPRECATED_FUNCTION;
559#endif
560 /* */
561
562
563
564
565 public:
566 /* name Traversal Support Functions
567 \brief Traversal support functions ... incomplete-documentation
568
569 These functions have been made public as part of the design, but they are suggested for internal use
570 or by particularly knowledgable users for specialized tools or applications.
571 */
572 /* */
573
574 // DQ (11/26/2005): Support for visitor pattern mechanims
575 // (inferior to ROSE traversal mechanism, experimental).
579
580 /* DXN (08/09/2010): support for the classic visitor pattern done in GoF */
582 virtual void accept (ROSE_VisitorPattern & visitor) override;
583
584 // DQ (12/26/2005): Support for traversal based on the memory pool
587 static void traverseMemoryPoolNodes(ROSE_VisitTraversal & visit);
588
592
593 // DQ (2/9/2006): Added to support traversal over single representative of each IR node
594 // This traversal helps support internal tools that call static member functions.
595 // note: this function operates on the memory pools.
598 static void visitRepresentativeNode (ROSE_VisitTraversal & visit);
599 /* */
600
601 public:
602 /* NodeId support functions */
604 static SgNode* getNodeByNodeId(VariantT variantT, size_t poolIdx, size_t itemIdx);
607 static SgAsmExecutableFileFormat* getNodeByNodeIdInternal(size_t poolIdx, size_t itemIdx);
610 static std::string getNodeIdString(SgAsmExecutableFileFormat* sgnode);
611 static std::string getNodeIdStringInternal(SgAsmExecutableFileFormat* sgnode);
612
613 public:
614 /* name Memory Allocation Functions
615 \brief Memory allocations functions ... incomplete-documentation
616
617 These functions have been made public as part of the design, but they are suggested for internal use
618 or by particularly knowledgable users for specialized tools or applications.
619 */
620 /* */
621
632 virtual bool isInMemoryPool() override;
633
644 virtual void checkDataMemberPointersIfInMemoryPool() override;
645
646 // DQ (4/30/2006): Modified to be a const function.
661 virtual std::vector<std::pair<SgNode*,std::string> > returnDataMemberPointers() const override;
662
673
685 virtual long getChildIndex( SgNode* childNode ) const override;
686
687 // DQ (9/2/2015): Since this function is generated by ROSETTA, we can't define the
688 // comment here (changed to be a C style comment and not be a doxygen comment).
689 /* \brief Constructor for use by AST File I/O Mechanism
690
691 This constructor permits the IR node to be rebuilt from the contiguously arranged data in memory
692 which obtained via fast binary file I/O from disk.
693 */
694 // SgAsmExecutableFileFormat( SgAsmExecutableFileFormatStorageClass& source );
695
696
697
698
699
700 // JH (10/24/2005): methods added to support the ast file IO
701 private:
702
703 /* name AST Memory Allocation Support Functions
704 \brief Memory allocations support....
705
706 These functions handle the low leve support of the memory allocation scheme which permits IR nodes to be allocated
707 in large contiguous blocks to reduce memory fragmentation, improve performance, support specialized access (AST traversals),
708 and support the AST File I/O Mechanism.
709 */
710 /* */
711
712 /* JH (10/24/2005): Two typedefs. The TestType notes the type every pointer is cast to before
713 we compare them. Since I had several problems with this, I decided to make a typdef to ensure
714 that I use the same type everywhere, if any changes are made. THe second one declares the type
715 (actually unsigned long) where teh pointer address gets converted to. On 64 bit platforms this
716 might got changed, but unfortunatly, the return types are still unsigned longs. There exists
717 a correspinding one in the AST_FILE_IO class!
718 */
719 // DQ (9/2/2015): This typedef is no longer used, we can't define the
720 // comment here (changed to be a C style comment and not be a doxygen comment).
721 /* \brief Typedef used for low level memory access.
722 */
723 // typedef unsigned char* TestType;
724
725 // DQ (9/2/2015): This typedef is no longer used, we can't define the
726 // comment here (changed to be a C style comment and not be a doxygen comment).
727 /* \brief Typedef used to hold memory addresses as values.
728 */
729 // typedef unsigned long AddressType;
730
731
732
733 // necessary, to have direct access to the p_freepointer and the private methods !
735 friend class AST_FILE_IO;
736
738 friend class SgAsmExecutableFileFormatStorageClass;
739
741 friend class AstSpecificDataManagingClass;
742
744 friend class AstSpecificDataManagingClassStorageClass;
745 public:
747 SgAsmExecutableFileFormat( const SgAsmExecutableFileFormatStorageClass& source );
748
749 // private: // JJW hack
750 /*
751 name AST Memory Allocation Support Variables
752 Memory allocations support variables
753
754 These variables handle the low level support of the memory allocation scheme which permits IR nodes to be allocated
755 in large contiguous blocks to reduce memory fragmentation, improve performance, support specialized access (AST traversals),
756 and support the AST File I/O Mechanism.
757 */
758 /* */
759
760 public:
761
762 // DQ (11/21/2009): Added function to add new Regular Expression attributes and return pointer
763 // to current node (so that it will work cleanly with build functions to specify patterns).
764 // virtual SgNode* addRegExpAttribute();
771
772#ifndef _MSC_VER
773// Rasmussen (04/17/2019): Support for ATerms has been deprecated as it is no longer needed
774// and likely never fully implemented nor tested. Files remain in the src tree but are no
775// longer built.
776#define BUILD_ATERM_SUPPORT 0
777 #if BUILD_ATERM_SUPPORT
778 #ifdef ROSE_USE_ROSE_ATERM_SUPPORT
779 // DQ (10/4/2014): Adding ATerm support to ROSE.
789 // Rasmussen (1/7/2019): Added override to kill warning messages of overridden virtual function
790 virtual ATerm generate_ATerm() override;
791
793 virtual void generate_ATerm_Annotation(ATerm & term) override;
794 #endif
795 #endif // BUILD_ATERM_SUPPORT
796#endif
797 // These can't be virtual functions since we don't yet know what IR node to build (until we have read the aterm).
798 // virtual generate_AST(ATerm & term);
799 // virtual void read_ATerm_Annotation(ATerm & term);
800
801// *** COMMON CODE SECTION ENDS HERE ***
802
803
804// End of memberFunctionString
805// Start of memberFunctionString
806/* #line 706 "/workspace/src/ROSETTA/Grammar/Node.code" */
807
808 // the generated cast function
809 // friend ROSE_DLL_API SgAsmExecutableFileFormat* isSgAsmExecutableFileFormat ( SgNode* s );
810
811 typedef SgAsmNode base_node_type;
812
813
814// End of memberFunctionString
815
816 protected:
817
819
820/* #line 21 "/workspace/src/ROSETTA/Grammar/grammarClassDeclarationMacros.macro" */
821
822
823 };
824#endif
825
826// postdeclarations for SgAsmExecutableFileFormat
827
828/* #line 829 "../../../src/frontend/SageIII//SgAsmExecutableFileFormat.h" */
829
830/* #line 27 "/workspace/src/ROSETTA/Grammar/grammarClassDeclarationMacros.macro after subst for $POSTDECLARATIONS" */
831
832/* #line 28 "/workspace/src/ROSETTA/Grammar/grammarClassDeclarationMacros.macro" */
833
834
835/* #line 836 "../../../src/frontend/SageIII//SgAsmExecutableFileFormat.h" */
836
837#endif // ROSE_SgAsmExecutableFileFormat_H
838
Class holding static data and functions supporting File I/O.
Definition AST_FILE_IO.h:19
Attribute containing a regex expression as a string.
Base class for all ROSE exceptions.
Collection of streams.
Definition Message.h:1606
Base class for many binary analysis nodes.
ExecPurpose
General purpose of a binary executable file.
ExecABI
Application binary interface.
InsSetArchitecture
Instruction sets organized by families.
Base class for binary files.
Contiguous region of a file.
Base class for all binary analysis IR nodes.
void initializeProperties()
Initialize all properties that have explicit initial values.
Supporting class from copy mechanism within ROSE.
Definition sageCopy.h:26
This class represents the base class for all IR nodes within Sage III.
virtual size_t get_numberOfTraversalSuccessors()
return number of children in the traversal successor list
virtual RTIReturnType roseRTI()
return C++ Runtime-Time-Information
virtual std::vector< std::string > get_traversalSuccessorNamesContainer()
container of names of variables or container indices used used in the traversal to access AST success...
virtual void debugSerializationEnd(const char *className)
Called by generated serializers.
static std::string getNodeIdString(SgNode *sgnode)
compute the NodeId for a particular SgNode*.
virtual bool isInMemoryPool()
FOR INTERNAL USE This is used in internal tests to verify that all IR nodes are allocated from the he...
int variant() const
Older version function returns enum value "NODE".
virtual void processDataMemberReferenceToPointers(ReferenceToPointerHandler *)
FOR INTERNAL USE Processes pairs of references to SgNode* and strings for use in AST tools
virtual VariantT variantT() const
returns new style SageIII enum values
virtual long getChildIndex(SgNode *childNode) const
FOR INTERNAL USE Returns a unique index value for the childNode in the list of children at this IR no...
virtual size_t get_childIndex(SgNode *child)
index-based access to traversal successors by child node
virtual void debugSerializationBegin(const char *className)
Called by generated serializers.
virtual std::vector< SgNode * > get_traversalSuccessorContainer()
container of pointers to AST successor nodes used in the traversal overridden in every class by gener...
virtual std::string class_name() const
returns a string representing the class name
static void visitRepresentativeNode(ROSE_VisitTraversal &visit)
FOR INTERNAL USE Support for type-based traversal.
virtual void checkDataMemberPointersIfInMemoryPool()
FOR INTERNAL USE This is used in internal tests to verify that all IR nodes are allocated from the he...
static size_t numberOfNodes()
Returns the total number of IR nodes of this type.
virtual void accept(ROSE_VisitorPattern &visitor)
support for the classic visitor pattern done in GoF
virtual SgNode * get_traversalSuccessorByIndex(size_t idx)
index-based access to traversal successors by index number
static void traverseMemoryPoolVisitorPattern(ROSE_VisitorPattern &visitor)
FOR INTERNAL USE Support for visitor pattern.
void executeVisitorMemberFunction(ROSE_VisitorPattern &visitor)
FOR INTERNAL USE Support for visitor pattern.
static SgNode * getNodeByNodeId(VariantT variantT, size_t poolIdx, size_t itemIdx)
Find a node by its variant type, pool index, and item index.
static size_t memoryUsage()
Returns the size in bytes of the total memory allocated for all IR nodes of this type.
static void traverseMemoryPoolNodes(ROSE_VisitTraversal &visit)
FOR INTERNAL USE Support for visitor pattern over all IR nodes by type of IR node.
virtual const char * sage_class_name() const
generates string representing the class name: (e.g. for SgNode returns "SgNode").
virtual std::vector< std::pair< SgNode *, std::string > > returnDataMemberPointers() const
FOR INTERNAL USE Returns STL vector of pairs of SgNode* and strings for use in AST tools
static SgNode * getNodeByNodeIdInternal(size_t poolIdx, size_t itemIdx)
FOR INTERNAL USE Find an SgNode from its memory pool and location therin.
SgNode * addRegExpAttribute(std::string s, AstRegExAttribute *a)
Support for AST matching using regular expression.
void initDiagnostics()
Initialize diagnostics.
ROSE_DLL_API Sawyer::Message::Facility mlog
Diagnostic facility for the ROSE library as a whole.
ROSE_UTIL_API std::string toString(const Path &)
Convert a path to a string.
void serialize(std::ostream &output, Graph &graph)
Serialize a graph into a stream of bytes.
The ROSE library.
void copy(const Word *src, const BitRange &srcRange, Word *dst, const BitRange &dstRange)
Copy some bits.
const char * ExecABI(int64_t)
Convert SgAsmExecutableFileFormat::ExecABI enum constant to a string.
const char * InsSetArchitecture(int64_t)
Convert SgAsmExecutableFileFormat::InsSetArchitecture enum constant to a string.
const char * ExecPurpose(int64_t)
Convert SgAsmExecutableFileFormat::ExecPurpose enum constant to a string.
const char * ExecFamily(int64_t)
Convert SgAsmExecutableFileFormat::ExecFamily enum constant to a string.