ROSE 0.11.145.247
SgAsmLEEntryPoint.h
1
2#ifndef ROSE_SgAsmLEEntryPoint_H
3#define ROSE_SgAsmLEEntryPoint_H
4#include <RoseFirst.h>
5#include <Cxx_GrammarDeclarations.h>
6#include <SgAsmExecutableFileFormat.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 SgAsmLEEntryPoint
23
24/* #line 25 "../../../src/frontend/SageIII//SgAsmLEEntryPoint.h" */
25/* #line 9172 "/workspace/src/ROSETTA/src/binaryInstruction.C" */
26
27#include <Rose/BinaryAnalysis/Address.h>
28#include <Rose/BinaryAnalysis/ByteOrder.h>
29#include <sageContainer.h>
30
31
32/* #line 13 "/workspace/src/ROSETTA/Grammar/grammarClassDeclarationMacros.macro after subst for $PREDECLARATIONS" */
33
34/* #line 14 "/workspace/src/ROSETTA/Grammar/grammarClassDeclarationMacros.macro" */
35
36#if !defined(DOCUMENTATION)
37// Class Definition for SgAsmLEEntryPoint
38class ROSE_DLL_API SgAsmLEEntryPoint : public SgAsmExecutableFileFormat
39 {
40 public:
41
42
43/* #line 44 "../../../src/frontend/SageIII//SgAsmLEEntryPoint.h" */
44
45 virtual SgNode* copy ( SgCopyHelp& help) const override;
46// Start of memberFunctionString
47/* #line 9219 "/workspace/src/ROSETTA/src/binaryInstruction.C" */
48
49
50 //----------------------- Boost serialization for SgAsmLEEntryPoint -----------------------
51#ifdef ROSE_ENABLE_BOOST_SERIALIZATION
52private:
53 friend class boost::serialization::access;
54
55 template<class S>
56 void serialize(S &s, const unsigned /*version*/) {
57 debugSerializationBegin("SgAsmLEEntryPoint");
58 s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
59 s & BOOST_SERIALIZATION_NVP(p_entries);
60 s & BOOST_SERIALIZATION_NVP(p_flags);
61 s & BOOST_SERIALIZATION_NVP(p_objnum);
62 s & BOOST_SERIALIZATION_NVP(p_entry_type);
63 s & BOOST_SERIALIZATION_NVP(p_res1);
64 s & BOOST_SERIALIZATION_NVP(p_entry_offset);
65 debugSerializationEnd("SgAsmLEEntryPoint");
66 }
67#endif // ROSE_ENABLE_BOOST_SERIALIZATION
69 // Local types
71public:
72#ifdef _MSC_VER
73# pragma pack (1)
74#endif
75 /* If 0x01 bit of "flags" is clear then the remainder (next 9 bytes) of the entry point is not stored in the file and the
76 * next entry point description follows immediately after the flag. */
77 struct LEEntryPoint_disk {
78 uint8_t flags; /* 0x00 Bit flags (0x01=>non-empty bundle; 0x02=>32-bit entry*/
79 uint16_t objnum; /* 0x01 Object number */
80 uint8_t entry_type; /* 0x03 Flags for entry type */
81 uint32_t entry_offset; /* 0x04 Offset of entry point */
82 uint16_t res1; /* 0x08 Reserved */
83 } /* 0x0a */
84// DQ (3/7/2013): Adding support to restrict visability to SWIG.
85#ifndef SWIG
86#ifndef _MSC_VER
87 __attribute__((packed))
88#endif
89#endif
90 ;
91#ifdef _MSC_VER
92# pragma pack ()
93#endif
94
96 // Properties
98public:
99public:
100 SgAsmLEEntryPointPtrList const& get_entries() const;
101 SgAsmLEEntryPointPtrList& get_entries();
102 void set_entries(SgAsmLEEntryPointPtrList const&);
103
104public:
105 unsigned const& get_flags() const;
106 void set_flags(unsigned const&);
107
108public:
109 unsigned const& get_objnum() const;
110 void set_objnum(unsigned const&);
111
112public:
113 unsigned const& get_entry_type() const;
114 void set_entry_type(unsigned const&);
115
116public:
117 unsigned const& get_res1() const;
118 void set_res1(unsigned const&);
119
120public:
121 Rose::BinaryAnalysis::Address const& get_entry_offset() const;
122 void set_entry_offset(Rose::BinaryAnalysis::Address const&);
124 // Functions
126public:
131 void dump(FILE*, const char *prefix, ssize_t idx) const;
132public:
134 virtual ~SgAsmLEEntryPoint();
135
136public:
139
140protected:
148
149
150// End of memberFunctionString
151// Start of memberFunctionString
152/* #line 1 "/workspace/src/ROSETTA/Grammar/Common.code" */
153
154// *** COMMON CODE SECTION BEGINS HERE ***
155
156 public:
157
158 // DQ (3/25/3006): I put this back in because it had the logic for where the copy function required
159 // and not required which is required to match the other aspects of the copy mechanism code generation.
160 // Specifically it is a problem to declare the copy function everywhere because it is not implemented
161 // for the SgSymbol IR nodes. I'm not clear why it is not implemented for these IR nodes.
162 /* \brief Copies AST (whole subtree, depending on the SgCopyHelp class */
163 // virtual SgNode* copy ( const SgCopyHelp & help) const;
164
166 virtual std::string class_name() const override;
167
169 virtual VariantT variantT() const override; // MS: new variant used in tree traversal
170
172 // King84 (2010.08.16): Moved this to an enum to save space, since it's only used at compiler-time anyway.
173 // static const VariantT static_variant = V_SgAsmLEEntryPoint;
174 enum { static_variant = V_SgAsmLEEntryPoint };
175
176 /* the generated cast function */
178 ROSE_DLL_API friend SgAsmLEEntryPoint* isSgAsmLEEntryPoint( SgNode * s );
179
181 ROSE_DLL_API friend const SgAsmLEEntryPoint* isSgAsmLEEntryPoint( const SgNode * s );
182
183 // ******************************************
184 // * Memory Pool / New / Delete
185 // ******************************************
186
187 public:
189 static const unsigned pool_size; //
191 static std::vector<unsigned char *> pools; //
193 static SgAsmLEEntryPoint * next_node; //
194
196 static unsigned long initializeStorageClassArray(SgAsmLEEntryPointStorageClass *); //
197
199 static void clearMemoryPool(); //
200 static void deleteMemoryPool(); //
201
203 static void extendMemoryPoolForFileIO(); //
204
206 static SgAsmLEEntryPoint * getPointerFromGlobalIndex(unsigned long); //
208 static SgAsmLEEntryPoint * getPointerFromGlobalIndex(AstSpecificDataManagingClass *, unsigned long); //
209
211 static unsigned long getNumberOfValidNodesAndSetGlobalIndexInFreepointer(unsigned long); //
213 static void resetValidFreepointers(); //
215 static unsigned long getNumberOfLastValidPointer(); //
216
217
218#if defined(INLINE_FUNCTIONS)
220 inline void *operator new (size_t size);
221#else
223 void *operator new (size_t size);
224#endif
226 void operator delete (void* pointer, size_t size);
227
228 // DQ (4/5/2007): This is not the correct operator that we want, but appears to be required to compile ROSE with ROSE.
229 void operator delete (void* pointer)
230 {
231 // This is the generated delete operator...
232 SgAsmLEEntryPoint::operator delete (pointer,sizeof(SgAsmLEEntryPoint));
233 }
234
236 static size_t numberOfNodes();
237
239 static size_t memoryUsage();
240
241 // End of scope which started in IR nodes specific code
242 /* */
243
244 /* name Internal Functions
245 \brief Internal functions ... incomplete-documentation
246
247 These functions have been made public as part of the design, but they are suggested for internal use
248 or by particularly knowledgeable users for specialized tools or applications.
249
250 \internal We could not make these private because they are required by user for special purposes. And
251 it would be unwieldy to have many of the internal classes in ROSE be explicitly defined as friends.
252
253 */
254
255 // MS: 02/12/02 container of pointers to AST successor nodes used in the traversal
256 // overridden in every class by *generated* implementation
258 virtual std::vector<SgNode*> get_traversalSuccessorContainer() const override;
259 // MS: 06/28/02 container of names of variables or container indices
260 // used used in the traversal to access AST successor nodes
261 // overridden in every class by *generated* implementation
264 virtual std::vector<std::string> get_traversalSuccessorNamesContainer() const override;
265
266 // GB (09/25/2007): Functions for index-based access to traversal successors; these are hopefully a lot faster
267 // than all the vector copies. The implementation for these functions is generated for each class.
269 virtual size_t get_numberOfTraversalSuccessors() const override;
271 virtual SgNode *get_traversalSuccessorByIndex(size_t idx) const override;
273 virtual size_t get_childIndex(SgNode *child) const override;
274
275#ifndef ROSE_USE_INTERNAL_FRONTEND_DEVELOPMENT
276 // MS: 08/16/2002 method for generating RTI information
278 virtual RTIReturnType roseRTI() override;
279#endif
280 /* */
281
282
283
284 /* name Deprecated Functions
285 \brief Deprecated functions ... incomplete-documentation
286
287 These functions have been deprecated from use.
288 */
289 /* */
290
292 virtual const char* sage_class_name() const override ROSE_DEPRECATED_FUNCTION;
293
294 // JJW (10/16/2008): Changed to a single function in Node.code, and put
295 // getVariant() in #if 0 block to prevent confusing Doxygen
296#if 0
298 virtual int variant() const ROSE_DEPRECATED_FUNCTION;
300 // virtual int getVariant() const ROSE_DEPRECATED_FUNCTION;
301#endif
302 /* */
303
304
305
306
307 public:
308 /* name Traversal Support Functions
309 \brief Traversal support functions ... incomplete-documentation
310
311 These functions have been made public as part of the design, but they are suggested for internal use
312 or by particularly knowledgable users for specialized tools or applications.
313 */
314 /* */
315
316 // DQ (11/26/2005): Support for visitor pattern mechanims
317 // (inferior to ROSE traversal mechanism, experimental).
321
322 /* DXN (08/09/2010): support for the classic visitor pattern done in GoF */
324 virtual void accept (ROSE_VisitorPattern & visitor) override;
325
326 // DQ (12/26/2005): Support for traversal based on the memory pool
329 static void traverseMemoryPoolNodes(ROSE_VisitTraversal & visit);
330
334
335 // DQ (2/9/2006): Added to support traversal over single representative of each IR node
336 // This traversal helps support internal tools that call static member functions.
337 // note: this function operates on the memory pools.
340 static void visitRepresentativeNode (ROSE_VisitTraversal & visit);
341 /* */
342
343 public:
344 /* NodeId support functions */
346 static SgNode* getNodeByNodeId(VariantT variantT, size_t poolIdx, size_t itemIdx);
349 static SgAsmLEEntryPoint* getNodeByNodeIdInternal(size_t poolIdx, size_t itemIdx);
352 static std::string getNodeIdString(SgAsmLEEntryPoint* sgnode);
353 static std::string getNodeIdStringInternal(SgAsmLEEntryPoint* sgnode);
354
355 public:
356 /* name Memory Allocation Functions
357 \brief Memory allocations functions ... incomplete-documentation
358
359 These functions have been made public as part of the design, but they are suggested for internal use
360 or by particularly knowledgable users for specialized tools or applications.
361 */
362 /* */
363
374 virtual bool isInMemoryPool() override;
375
386 virtual void checkDataMemberPointersIfInMemoryPool() override;
387
388 // DQ (4/30/2006): Modified to be a const function.
403 virtual std::vector<std::pair<SgNode*,std::string> > returnDataMemberPointers() const override;
404
415
427 virtual long getChildIndex( SgNode* childNode ) const override;
428
429 // DQ (9/2/2015): Since this function is generated by ROSETTA, we can't define the
430 // comment here (changed to be a C style comment and not be a doxygen comment).
431 /* \brief Constructor for use by AST File I/O Mechanism
432
433 This constructor permits the IR node to be rebuilt from the contiguously arranged data in memory
434 which obtained via fast binary file I/O from disk.
435 */
436 // SgAsmLEEntryPoint( SgAsmLEEntryPointStorageClass& source );
437
438
439
440
441
442 // JH (10/24/2005): methods added to support the ast file IO
443 private:
444
445 /* name AST Memory Allocation Support Functions
446 \brief Memory allocations support....
447
448 These functions handle the low leve support of the memory allocation scheme which permits IR nodes to be allocated
449 in large contiguous blocks to reduce memory fragmentation, improve performance, support specialized access (AST traversals),
450 and support the AST File I/O Mechanism.
451 */
452 /* */
453
454 /* JH (10/24/2005): Two typedefs. The TestType notes the type every pointer is cast to before
455 we compare them. Since I had several problems with this, I decided to make a typdef to ensure
456 that I use the same type everywhere, if any changes are made. THe second one declares the type
457 (actually unsigned long) where teh pointer address gets converted to. On 64 bit platforms this
458 might got changed, but unfortunatly, the return types are still unsigned longs. There exists
459 a correspinding one in the AST_FILE_IO class!
460 */
461 // DQ (9/2/2015): This typedef is no longer used, we can't define the
462 // comment here (changed to be a C style comment and not be a doxygen comment).
463 /* \brief Typedef used for low level memory access.
464 */
465 // typedef unsigned char* TestType;
466
467 // DQ (9/2/2015): This typedef is no longer used, we can't define the
468 // comment here (changed to be a C style comment and not be a doxygen comment).
469 /* \brief Typedef used to hold memory addresses as values.
470 */
471 // typedef unsigned long AddressType;
472
473
474
475 // necessary, to have direct access to the p_freepointer and the private methods !
477 friend class AST_FILE_IO;
478
480 friend class SgAsmLEEntryPointStorageClass;
481
483 friend class AstSpecificDataManagingClass;
484
486 friend class AstSpecificDataManagingClassStorageClass;
487 public:
489 SgAsmLEEntryPoint( const SgAsmLEEntryPointStorageClass& source );
490
491 // private: // JJW hack
492 /*
493 name AST Memory Allocation Support Variables
494 Memory allocations support variables
495
496 These variables handle the low level support of the memory allocation scheme which permits IR nodes to be allocated
497 in large contiguous blocks to reduce memory fragmentation, improve performance, support specialized access (AST traversals),
498 and support the AST File I/O Mechanism.
499 */
500 /* */
501
502 public:
503
504 // DQ (11/21/2009): Added function to add new Regular Expression attributes and return pointer
505 // to current node (so that it will work cleanly with build functions to specify patterns).
506 // virtual SgNode* addRegExpAttribute();
513
514#ifndef _MSC_VER
515// Rasmussen (04/17/2019): Support for ATerms has been deprecated as it is no longer needed
516// and likely never fully implemented nor tested. Files remain in the src tree but are no
517// longer built.
518#define BUILD_ATERM_SUPPORT 0
519 #if BUILD_ATERM_SUPPORT
520 #ifdef ROSE_USE_ROSE_ATERM_SUPPORT
521 // DQ (10/4/2014): Adding ATerm support to ROSE.
531 // Rasmussen (1/7/2019): Added override to kill warning messages of overridden virtual function
532 virtual ATerm generate_ATerm() override;
533
535 virtual void generate_ATerm_Annotation(ATerm & term) override;
536 #endif
537 #endif // BUILD_ATERM_SUPPORT
538#endif
539 // These can't be virtual functions since we don't yet know what IR node to build (until we have read the aterm).
540 // virtual generate_AST(ATerm & term);
541 // virtual void read_ATerm_Annotation(ATerm & term);
542
543// *** COMMON CODE SECTION ENDS HERE ***
544
545
546// End of memberFunctionString
547// Start of memberFunctionString
548/* #line 710 "/workspace/src/ROSETTA/Grammar/Node.code" */
549
550 // the generated cast function
551 // friend ROSE_DLL_API SgAsmLEEntryPoint* isSgAsmLEEntryPoint ( SgNode* s );
552
553 typedef SgAsmExecutableFileFormat base_node_type;
554
555
556// End of memberFunctionString
557
558
559
560
561
562
563
564 protected:
565// Start of memberFunctionString
566SgAsmLEEntryPointPtrList p_entries;
567
568// End of memberFunctionString
569// Start of memberFunctionString
570unsigned p_flags;
571
572// End of memberFunctionString
573// Start of memberFunctionString
574unsigned p_objnum;
575
576// End of memberFunctionString
577// Start of memberFunctionString
578unsigned p_entry_type;
579
580// End of memberFunctionString
581// Start of memberFunctionString
582unsigned p_res1;
583
584// End of memberFunctionString
585// Start of memberFunctionString
586Rose::BinaryAnalysis::Address p_entry_offset;
587
588// End of memberFunctionString
589
591 friend struct Rose::Traits::generated::describe_field_t<SgAsmLEEntryPoint, SgAsmLEEntryPointPtrList,&SgAsmLEEntryPoint::p_entries>;
592 friend struct Rose::Traits::generated::describe_field_t<SgAsmLEEntryPoint, unsigned,&SgAsmLEEntryPoint::p_flags>;
593 friend struct Rose::Traits::generated::describe_field_t<SgAsmLEEntryPoint, unsigned,&SgAsmLEEntryPoint::p_objnum>;
594 friend struct Rose::Traits::generated::describe_field_t<SgAsmLEEntryPoint, unsigned,&SgAsmLEEntryPoint::p_entry_type>;
595 friend struct Rose::Traits::generated::describe_field_t<SgAsmLEEntryPoint, unsigned,&SgAsmLEEntryPoint::p_res1>;
596 friend struct Rose::Traits::generated::describe_field_t<SgAsmLEEntryPoint, Rose::BinaryAnalysis::Address,&SgAsmLEEntryPoint::p_entry_offset>;
597
598/* #line 21 "/workspace/src/ROSETTA/Grammar/grammarClassDeclarationMacros.macro" */
599
600
601 };
602#endif
603
604// postdeclarations for SgAsmLEEntryPoint
605
606/* #line 607 "../../../src/frontend/SageIII//SgAsmLEEntryPoint.h" */
607
608/* #line 27 "/workspace/src/ROSETTA/Grammar/grammarClassDeclarationMacros.macro after subst for $POSTDECLARATIONS" */
609
610/* #line 28 "/workspace/src/ROSETTA/Grammar/grammarClassDeclarationMacros.macro" */
611
612
613/* #line 614 "../../../src/frontend/SageIII//SgAsmLEEntryPoint.h" */
614
615#endif // ROSE_SgAsmLEEntryPoint_H
616
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 many binary analysis nodes.
void initializeProperties()
Initialize all properties that have explicit initial values.
Contiguous region of a file.
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 RTIReturnType roseRTI()
return C++ Runtime-Time-Information
virtual size_t get_numberOfTraversalSuccessors() const
return number of children in the traversal successor list
virtual std::vector< std::string > get_traversalSuccessorNamesContainer() const
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 size_t get_childIndex(SgNode *child) const
index-based access to traversal successors by child node
virtual std::vector< SgNode * > get_traversalSuccessorContainer() const
container of pointers to AST successor nodes used in the traversal overridden in every class by gener...
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 void debugSerializationBegin(const char *className)
Called by generated serializers.
virtual SgNode * get_traversalSuccessorByIndex(size_t idx) const
index-based access to traversal successors by index number
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
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.
std::uint64_t Address
Address.
Definition Address.h:11
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.