ROSE 0.11.145.247
SgAsmElfRelocSection.h
1
2#ifndef ROSE_SgAsmElfRelocSection_H
3#define ROSE_SgAsmElfRelocSection_H
4#include <RoseFirst.h>
5#include <Cxx_GrammarDeclarations.h>
6#include <SgAsmElfSection.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 SgAsmElfRelocSection
23
24/* #line 25 "../../../src/frontend/SageIII//SgAsmElfRelocSection.h" */
25/* #line 20814 "/workspace/src/ROSETTA/src/binaryInstruction.C" */
26
27#include <Rose/BinaryAnalysis/Address.h>
28
29#ifdef ROSE_SgAsmElfRelocSection_IMPL
30#include <SgAsmElfRelocEntryList.h>
31#endif
32
33
34/* #line 13 "/workspace/src/ROSETTA/Grammar/grammarClassDeclarationMacros.macro after subst for $PREDECLARATIONS" */
35
36/* #line 14 "/workspace/src/ROSETTA/Grammar/grammarClassDeclarationMacros.macro" */
37
38#if !defined(DOCUMENTATION)
39// Class Definition for SgAsmElfRelocSection
40class ROSE_DLL_API SgAsmElfRelocSection : public SgAsmElfSection
41 {
42 public:
43
44
45/* #line 46 "../../../src/frontend/SageIII//SgAsmElfRelocSection.h" */
46
47 virtual SgNode* copy ( SgCopyHelp& help) const override;
48// Start of memberFunctionString
49/* #line 20846 "/workspace/src/ROSETTA/src/binaryInstruction.C" */
50
51
52 //----------------------- Boost serialization for SgAsmElfRelocSection -----------------------
53#ifdef ROSE_ENABLE_BOOST_SERIALIZATION
54private:
55 friend class boost::serialization::access;
56
57 template<class S>
58 void serialize(S &s, const unsigned /*version*/) {
59 debugSerializationBegin("SgAsmElfRelocSection");
60 s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmElfSection);
61 s & BOOST_SERIALIZATION_NVP(p_usesAddend);
62 s & BOOST_SERIALIZATION_NVP(p_targetSection);
63 s & BOOST_SERIALIZATION_NVP(p_entries);
64 debugSerializationEnd("SgAsmElfRelocSection");
65 }
66#endif // ROSE_ENABLE_BOOST_SERIALIZATION
67public:
68public:
72 bool const& get_usesAddend() const;
73 void set_usesAddend(bool const&);
76public:
80 SgAsmElfSection* const& get_targetSection() const;
81 void set_targetSection(SgAsmElfSection* const&);
84public:
90 SgAsmElfRelocEntryList* const& get_entries() const;
91 void set_entries(SgAsmElfRelocEntryList* const&);
93public:
95
98 virtual SgAsmElfRelocSection *parse() override;
99
102 calculateSizes(size_t *total, size_t *required, size_t *optional, size_t *entcount) const override;
103
104 virtual bool reallocate() override;
105
107 virtual void unparse(std::ostream&) const override;
108
110 virtual void dump(FILE*, const char *prefix, ssize_t idx) const override;
111
113 // Deprecated 2023-11
115public:
116 bool get_uses_addend() const ROSE_DEPRECATED("use get_usesAddend");
117 void set_uses_addend(bool) ROSE_DEPRECATED("use set_usesAddend");
118 SgAsmElfSection* get_target_section() const ROSE_DEPRECATED("use get_targetSection");
119 void set_target_section(SgAsmElfSection*) ROSE_DEPRECATED("use set_targetSection");
120 using SgAsmElfSection::calculate_sizes;
121 virtual Rose::BinaryAnalysis::Address calculate_sizes(size_t*, size_t*, size_t*, size_t*) const override
122 ROSE_DEPRECATED("use calculateSizes");
123public:
125 virtual ~SgAsmElfRelocSection();
126
127public:
130
131protected:
138 void initializeProperties();
139
140
141// End of memberFunctionString
142// Start of memberFunctionString
143/* #line 1 "/workspace/src/ROSETTA/Grammar/Common.code" */
144
145// *** COMMON CODE SECTION BEGINS HERE ***
146
147 public:
148
149 // DQ (3/25/3006): I put this back in because it had the logic for where the copy function required
150 // and not required which is required to match the other aspects of the copy mechanism code generation.
151 // Specifically it is a problem to declare the copy function everywhere because it is not implemented
152 // for the SgSymbol IR nodes. I'm not clear why it is not implemented for these IR nodes.
153 /* \brief Copies AST (whole subtree, depending on the SgCopyHelp class */
154 // virtual SgNode* copy ( const SgCopyHelp & help) const;
155
157 virtual std::string class_name() const override;
158
160 virtual VariantT variantT() const override; // MS: new variant used in tree traversal
161
163 // King84 (2010.08.16): Moved this to an enum to save space, since it's only used at compiler-time anyway.
164 // static const VariantT static_variant = V_SgAsmElfRelocSection;
165 enum { static_variant = V_SgAsmElfRelocSection };
166
167 /* the generated cast function */
169 ROSE_DLL_API friend SgAsmElfRelocSection* isSgAsmElfRelocSection( SgNode * s );
170
172 ROSE_DLL_API friend const SgAsmElfRelocSection* isSgAsmElfRelocSection( const SgNode * s );
173
174 // ******************************************
175 // * Memory Pool / New / Delete
176 // ******************************************
177
178 public:
180 static const unsigned pool_size; //
182 static std::vector<unsigned char *> pools; //
184 static SgAsmElfRelocSection * next_node; //
185
187 static unsigned long initializeStorageClassArray(SgAsmElfRelocSectionStorageClass *); //
188
190 static void clearMemoryPool(); //
191 static void deleteMemoryPool(); //
192
194 static void extendMemoryPoolForFileIO(); //
195
197 static SgAsmElfRelocSection * getPointerFromGlobalIndex(unsigned long); //
199 static SgAsmElfRelocSection * getPointerFromGlobalIndex(AstSpecificDataManagingClass *, unsigned long); //
200
202 static unsigned long getNumberOfValidNodesAndSetGlobalIndexInFreepointer(unsigned long); //
204 static void resetValidFreepointers(); //
206 static unsigned long getNumberOfLastValidPointer(); //
207
208
209#if defined(INLINE_FUNCTIONS)
211 inline void *operator new (size_t size);
212#else
214 void *operator new (size_t size);
215#endif
217 void operator delete (void* pointer, size_t size);
218
219 // DQ (4/5/2007): This is not the correct operator that we want, but appears to be required to compile ROSE with ROSE.
220 void operator delete (void* pointer)
221 {
222 // This is the generated delete operator...
223 SgAsmElfRelocSection::operator delete (pointer,sizeof(SgAsmElfRelocSection));
224 }
225
227 static size_t numberOfNodes();
228
230 static size_t memoryUsage();
231
232 // End of scope which started in IR nodes specific code
233 /* */
234
235 /* name Internal Functions
236 \brief Internal functions ... incomplete-documentation
237
238 These functions have been made public as part of the design, but they are suggested for internal use
239 or by particularly knowledgeable users for specialized tools or applications.
240
241 \internal We could not make these private because they are required by user for special purposes. And
242 it would be unwieldy to have many of the internal classes in ROSE be explicitly defined as friends.
243
244 */
245
246 // MS: 02/12/02 container of pointers to AST successor nodes used in the traversal
247 // overridden in every class by *generated* implementation
249 virtual std::vector<SgNode*> get_traversalSuccessorContainer() const override;
250 // MS: 06/28/02 container of names of variables or container indices
251 // used used in the traversal to access AST successor nodes
252 // overridden in every class by *generated* implementation
255 virtual std::vector<std::string> get_traversalSuccessorNamesContainer() const override;
256
257 // GB (09/25/2007): Functions for index-based access to traversal successors; these are hopefully a lot faster
258 // than all the vector copies. The implementation for these functions is generated for each class.
260 virtual size_t get_numberOfTraversalSuccessors() const override;
262 virtual SgNode *get_traversalSuccessorByIndex(size_t idx) const override;
264 virtual size_t get_childIndex(SgNode *child) const override;
265
266#ifndef ROSE_USE_INTERNAL_FRONTEND_DEVELOPMENT
267 // MS: 08/16/2002 method for generating RTI information
269 virtual RTIReturnType roseRTI() override;
270#endif
271 /* */
272
273
274
275 /* name Deprecated Functions
276 \brief Deprecated functions ... incomplete-documentation
277
278 These functions have been deprecated from use.
279 */
280 /* */
281
283 virtual const char* sage_class_name() const override ROSE_DEPRECATED_FUNCTION;
284
285 // JJW (10/16/2008): Changed to a single function in Node.code, and put
286 // getVariant() in #if 0 block to prevent confusing Doxygen
287#if 0
289 virtual int variant() const ROSE_DEPRECATED_FUNCTION;
291 // virtual int getVariant() const ROSE_DEPRECATED_FUNCTION;
292#endif
293 /* */
294
295
296
297
298 public:
299 /* name Traversal Support Functions
300 \brief Traversal support functions ... incomplete-documentation
301
302 These functions have been made public as part of the design, but they are suggested for internal use
303 or by particularly knowledgable users for specialized tools or applications.
304 */
305 /* */
306
307 // DQ (11/26/2005): Support for visitor pattern mechanims
308 // (inferior to ROSE traversal mechanism, experimental).
312
313 /* DXN (08/09/2010): support for the classic visitor pattern done in GoF */
315 virtual void accept (ROSE_VisitorPattern & visitor) override;
316
317 // DQ (12/26/2005): Support for traversal based on the memory pool
320 static void traverseMemoryPoolNodes(ROSE_VisitTraversal & visit);
321
325
326 // DQ (2/9/2006): Added to support traversal over single representative of each IR node
327 // This traversal helps support internal tools that call static member functions.
328 // note: this function operates on the memory pools.
331 static void visitRepresentativeNode (ROSE_VisitTraversal & visit);
332 /* */
333
334 public:
335 /* NodeId support functions */
337 static SgNode* getNodeByNodeId(VariantT variantT, size_t poolIdx, size_t itemIdx);
340 static SgAsmElfRelocSection* getNodeByNodeIdInternal(size_t poolIdx, size_t itemIdx);
343 static std::string getNodeIdString(SgAsmElfRelocSection* sgnode);
344 static std::string getNodeIdStringInternal(SgAsmElfRelocSection* sgnode);
345
346 public:
347 /* name Memory Allocation Functions
348 \brief Memory allocations functions ... incomplete-documentation
349
350 These functions have been made public as part of the design, but they are suggested for internal use
351 or by particularly knowledgable users for specialized tools or applications.
352 */
353 /* */
354
365 virtual bool isInMemoryPool() override;
366
377 virtual void checkDataMemberPointersIfInMemoryPool() override;
378
379 // DQ (4/30/2006): Modified to be a const function.
394 virtual std::vector<std::pair<SgNode*,std::string> > returnDataMemberPointers() const override;
395
406
418 virtual long getChildIndex( SgNode* childNode ) const override;
419
420 // DQ (9/2/2015): Since this function is generated by ROSETTA, we can't define the
421 // comment here (changed to be a C style comment and not be a doxygen comment).
422 /* \brief Constructor for use by AST File I/O Mechanism
423
424 This constructor permits the IR node to be rebuilt from the contiguously arranged data in memory
425 which obtained via fast binary file I/O from disk.
426 */
427 // SgAsmElfRelocSection( SgAsmElfRelocSectionStorageClass& source );
428
429
430
431
432
433 // JH (10/24/2005): methods added to support the ast file IO
434 private:
435
436 /* name AST Memory Allocation Support Functions
437 \brief Memory allocations support....
438
439 These functions handle the low leve support of the memory allocation scheme which permits IR nodes to be allocated
440 in large contiguous blocks to reduce memory fragmentation, improve performance, support specialized access (AST traversals),
441 and support the AST File I/O Mechanism.
442 */
443 /* */
444
445 /* JH (10/24/2005): Two typedefs. The TestType notes the type every pointer is cast to before
446 we compare them. Since I had several problems with this, I decided to make a typdef to ensure
447 that I use the same type everywhere, if any changes are made. THe second one declares the type
448 (actually unsigned long) where teh pointer address gets converted to. On 64 bit platforms this
449 might got changed, but unfortunatly, the return types are still unsigned longs. There exists
450 a correspinding one in the AST_FILE_IO class!
451 */
452 // DQ (9/2/2015): This typedef is no longer used, we can't define the
453 // comment here (changed to be a C style comment and not be a doxygen comment).
454 /* \brief Typedef used for low level memory access.
455 */
456 // typedef unsigned char* TestType;
457
458 // DQ (9/2/2015): This typedef is no longer used, we can't define the
459 // comment here (changed to be a C style comment and not be a doxygen comment).
460 /* \brief Typedef used to hold memory addresses as values.
461 */
462 // typedef unsigned long AddressType;
463
464
465
466 // necessary, to have direct access to the p_freepointer and the private methods !
468 friend class AST_FILE_IO;
469
471 friend class SgAsmElfRelocSectionStorageClass;
472
474 friend class AstSpecificDataManagingClass;
475
477 friend class AstSpecificDataManagingClassStorageClass;
478 public:
480 SgAsmElfRelocSection( const SgAsmElfRelocSectionStorageClass& source );
481
482 // private: // JJW hack
483 /*
484 name AST Memory Allocation Support Variables
485 Memory allocations support variables
486
487 These variables handle the low level support of the memory allocation scheme which permits IR nodes to be allocated
488 in large contiguous blocks to reduce memory fragmentation, improve performance, support specialized access (AST traversals),
489 and support the AST File I/O Mechanism.
490 */
491 /* */
492
493 public:
494
495 // DQ (11/21/2009): Added function to add new Regular Expression attributes and return pointer
496 // to current node (so that it will work cleanly with build functions to specify patterns).
497 // virtual SgNode* addRegExpAttribute();
504
505#ifndef _MSC_VER
506// Rasmussen (04/17/2019): Support for ATerms has been deprecated as it is no longer needed
507// and likely never fully implemented nor tested. Files remain in the src tree but are no
508// longer built.
509#define BUILD_ATERM_SUPPORT 0
510 #if BUILD_ATERM_SUPPORT
511 #ifdef ROSE_USE_ROSE_ATERM_SUPPORT
512 // DQ (10/4/2014): Adding ATerm support to ROSE.
522 // Rasmussen (1/7/2019): Added override to kill warning messages of overridden virtual function
523 virtual ATerm generate_ATerm() override;
524
526 virtual void generate_ATerm_Annotation(ATerm & term) override;
527 #endif
528 #endif // BUILD_ATERM_SUPPORT
529#endif
530 // These can't be virtual functions since we don't yet know what IR node to build (until we have read the aterm).
531 // virtual generate_AST(ATerm & term);
532 // virtual void read_ATerm_Annotation(ATerm & term);
533
534// *** COMMON CODE SECTION ENDS HERE ***
535
536
537// End of memberFunctionString
538// Start of memberFunctionString
539/* #line 710 "/workspace/src/ROSETTA/Grammar/Node.code" */
540
541 // the generated cast function
542 // friend ROSE_DLL_API SgAsmElfRelocSection* isSgAsmElfRelocSection ( SgNode* s );
543
544 typedef SgAsmElfSection base_node_type;
545
546
547// End of memberFunctionString
548
549
550
551
552 protected:
553// Start of memberFunctionString
554bool p_usesAddend;
555
556// End of memberFunctionString
557// Start of memberFunctionString
558SgAsmElfSection* p_targetSection;
559
560// End of memberFunctionString
561// Start of memberFunctionString
562SgAsmElfRelocEntryList* p_entries;
563
564// End of memberFunctionString
565
567 friend struct Rose::Traits::generated::describe_field_t<SgAsmElfRelocSection, bool,&SgAsmElfRelocSection::p_usesAddend>;
568 friend struct Rose::Traits::generated::describe_field_t<SgAsmElfRelocSection, SgAsmElfSection*,&SgAsmElfRelocSection::p_targetSection>;
569 friend struct Rose::Traits::generated::describe_field_t<SgAsmElfRelocSection, SgAsmElfRelocEntryList*,&SgAsmElfRelocSection::p_entries>;
570
571/* #line 21 "/workspace/src/ROSETTA/Grammar/grammarClassDeclarationMacros.macro" */
572
573
574 };
575#endif
576
577// postdeclarations for SgAsmElfRelocSection
578
579/* #line 580 "../../../src/frontend/SageIII//SgAsmElfRelocSection.h" */
580
581/* #line 27 "/workspace/src/ROSETTA/Grammar/grammarClassDeclarationMacros.macro after subst for $POSTDECLARATIONS" */
582
583/* #line 28 "/workspace/src/ROSETTA/Grammar/grammarClassDeclarationMacros.macro" */
584
585
586/* #line 587 "../../../src/frontend/SageIII//SgAsmElfRelocSection.h" */
587
588#endif // ROSE_SgAsmElfRelocSection_H
589
Class holding static data and functions supporting File I/O.
Definition AST_FILE_IO.h:19
Attribute containing a regex expression as a string.
Represents the file header of an ELF binary container.
List of ELF relocation entries.
Represents an ELF relocation section.
Base class for ELF file sections.
Rose::BinaryAnalysis::Address calculateSizes(size_t r32size, size_t r64size, const std::vector< size_t > &optsizes, size_t *entsize, size_t *required, size_t *optional, size_t *entcount) const
Returns info about the size of the entries based on information already available.
virtual void dump(FILE *, const char *prefix, ssize_t idx) const override
Print some debugging info.
virtual bool reallocate() override
Called prior to unparse to make things consistent.
ELF file section containing symbols.
virtual SgAsmGenericSection * parse()
Parse contents of the section.
virtual void unparse(std::ostream &) const
Write a section back to the 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 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
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.