ROSE 0.11.145.192
SgAsmElfSymverNeededEntry.h
1
2#ifndef ROSE_SgAsmElfSymverNeededEntry_H
3#define ROSE_SgAsmElfSymverNeededEntry_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 SgAsmElfSymverNeededEntry
23
24/* #line 25 "../../../src/frontend/SageIII//SgAsmElfSymverNeededEntry.h" */
25/* #line 17614 "/workspace/src/ROSETTA/src/binaryInstruction.C" */
26
27#include <Rose/BinaryAnalysis/ByteOrder.h>
28
29#ifdef ROSE_SgAsmElfSymverNeededEntry_IMPL
30#include <SgAsmElfSymverNeededAuxList.h>
31#include <SgAsmGenericString.h>
32#endif
33
34
35/* #line 13 "/workspace/src/ROSETTA/Grammar/grammarClassDeclarationMacros.macro after subst for $PREDECLARATIONS" */
36
37/* #line 14 "/workspace/src/ROSETTA/Grammar/grammarClassDeclarationMacros.macro" */
38
39#if !defined(DOCUMENTATION)
40// Class Definition for SgAsmElfSymverNeededEntry
42 {
43 public:
44
45
46/* #line 47 "../../../src/frontend/SageIII//SgAsmElfSymverNeededEntry.h" */
47
48 virtual SgNode* copy ( SgCopyHelp& help) const override;
49// Start of memberFunctionString
50/* #line 17647 "/workspace/src/ROSETTA/src/binaryInstruction.C" */
51
52
53 //----------------------- Boost serialization for SgAsmElfSymverNeededEntry -----------------------
54#ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
55private:
56 friend class boost::serialization::access;
57
58 template<class S>
59 void serialize(S &s, const unsigned /*version*/) {
60 debugSerializationBegin("SgAsmElfSymverNeededEntry");
61 s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
62 s & BOOST_SERIALIZATION_NVP(p_version);
63 s & BOOST_SERIALIZATION_NVP(p_fileName);
64 s & BOOST_SERIALIZATION_NVP(p_entries);
65 debugSerializationEnd("SgAsmElfSymverNeededEntry");
66 }
67#endif // ROSE_HAVE_BOOST_SERIALIZATION_LIB
69 // Local types
71public:
72#ifdef _MSC_VER
73# pragma pack (1)
74#endif
75
77 struct ElfSymverNeededEntry_disk {
78 uint16_t vn_version;
79 uint16_t vn_cnt;
80 uint32_t vn_file;
81 uint32_t vn_aux;
82 uint32_t vn_next;
83 }
84#if !defined(SWIG) && !defined(_MSC_VER)
85 __attribute__((packed))
86#endif
87 ;
88
89#ifdef _MSC_VER
90# pragma pack ()
91#endif
92
94 // Properties
96public:
97public:
103 size_t const& get_version() const;
104 void set_version(size_t const&);
107public:
111 SgAsmGenericString* const& get_fileName() const;
112 void set_fileName(SgAsmGenericString* const&);
115public:
122 SgAsmElfSymverNeededAuxList* const& get_entries() const;
123 void set_entries(SgAsmElfSymverNeededAuxList* const&);
126 // Functions
128public:
131
134
137
139 virtual void dump(FILE *f, const char *prefix, ssize_t idx) const;
140
142 // Deprecated 2023-11
144public:
145 SgAsmGenericString* get_file_name() const ROSE_DEPRECATED("use get_fileName");
146 void set_file_name(SgAsmGenericString*) ROSE_DEPRECATED("use set_fileName");
147public:
149 virtual ~SgAsmElfSymverNeededEntry();
150
151public:
154
155protected:
162 void initializeProperties();
163
164
165// End of memberFunctionString
166// Start of memberFunctionString
167/* #line 1 "/workspace/src/ROSETTA/Grammar/Common.code" */
168
169// *** COMMON CODE SECTION BEGINS HERE ***
170
171 public:
172
173 // DQ (3/25/3006): I put this back in because it had the logic for where the copy function required
174 // and not required which is required to match the other aspects of the copy mechanism code generation.
175 // Specifically it is a problem to declare the copy function everywhere because it is not implemented
176 // for the SgSymbol IR nodes. I'm not clear why it is not implemented for these IR nodes.
177 /* \brief Copies AST (whole subtree, depending on the SgCopyHelp class */
178 // virtual SgNode* copy ( const SgCopyHelp & help) const;
179
181 virtual std::string class_name() const override;
182
184 virtual VariantT variantT() const override; // MS: new variant used in tree traversal
185
187 // King84 (2010.08.16): Moved this to an enum to save space, since it's only used at compiler-time anyway.
188 // static const VariantT static_variant = V_SgAsmElfSymverNeededEntry;
189 enum { static_variant = V_SgAsmElfSymverNeededEntry };
190
191 /* the generated cast function */
193 ROSE_DLL_API friend SgAsmElfSymverNeededEntry* isSgAsmElfSymverNeededEntry( SgNode * s );
194
196 ROSE_DLL_API friend const SgAsmElfSymverNeededEntry* isSgAsmElfSymverNeededEntry( const SgNode * s );
197
198 // ******************************************
199 // * Memory Pool / New / Delete
200 // ******************************************
201
202 public:
204 static const unsigned pool_size; //
206 static std::vector<unsigned char *> pools; //
208 static SgAsmElfSymverNeededEntry * next_node; //
209
211 static unsigned long initializeStorageClassArray(SgAsmElfSymverNeededEntryStorageClass *); //
212
214 static void clearMemoryPool(); //
215 static void deleteMemoryPool(); //
216
218 static void extendMemoryPoolForFileIO(); //
219
221 static SgAsmElfSymverNeededEntry * getPointerFromGlobalIndex(unsigned long); //
223 static SgAsmElfSymverNeededEntry * getPointerFromGlobalIndex(AstSpecificDataManagingClass *, unsigned long); //
224
226 static unsigned long getNumberOfValidNodesAndSetGlobalIndexInFreepointer(unsigned long); //
228 static void resetValidFreepointers(); //
230 static unsigned long getNumberOfLastValidPointer(); //
231
232
233#if defined(INLINE_FUNCTIONS)
235 inline void *operator new (size_t size);
236#else
238 void *operator new (size_t size);
239#endif
241 void operator delete (void* pointer, size_t size);
242
243 // DQ (4/5/2007): This is not the correct operator that we want, but appears to be required to compile ROSE with ROSE.
244 void operator delete (void* pointer)
245 {
246 // This is the generated delete operator...
247 SgAsmElfSymverNeededEntry::operator delete (pointer,sizeof(SgAsmElfSymverNeededEntry));
248 }
249
251 static size_t numberOfNodes();
252
254 static size_t memoryUsage();
255
256 // End of scope which started in IR nodes specific code
257 /* */
258
259 /* name Internal Functions
260 \brief Internal functions ... incomplete-documentation
261
262 These functions have been made public as part of the design, but they are suggested for internal use
263 or by particularly knowledgeable users for specialized tools or applications.
264
265 \internal We could not make these private because they are required by user for special purposes. And
266 it would be unwieldy to have many of the internal classes in ROSE be explicitly defined as friends.
267
268 */
269
270 // MS: 02/12/02 container of pointers to AST successor nodes used in the traversal
271 // overridden in every class by *generated* implementation
273 virtual std::vector<SgNode*> get_traversalSuccessorContainer() override;
274 // MS: 06/28/02 container of names of variables or container indices
275 // used used in the traversal to access AST successor nodes
276 // overridden in every class by *generated* implementation
279 virtual std::vector<std::string> get_traversalSuccessorNamesContainer() override;
280
281 // GB (09/25/2007): Functions for index-based access to traversal successors; these are hopefully a lot faster
282 // than all the vector copies. The implementation for these functions is generated for each class.
284 virtual size_t get_numberOfTraversalSuccessors() override;
286 virtual SgNode *get_traversalSuccessorByIndex(size_t idx) override;
288 virtual size_t get_childIndex(SgNode *child) override;
289
290#ifndef ROSE_USE_INTERNAL_FRONTEND_DEVELOPMENT
291 // MS: 08/16/2002 method for generating RTI information
293 virtual RTIReturnType roseRTI() override;
294#endif
295 /* */
296
297
298
299 /* name Deprecated Functions
300 \brief Deprecated functions ... incomplete-documentation
301
302 These functions have been deprecated from use.
303 */
304 /* */
305
307 virtual const char* sage_class_name() const override ROSE_DEPRECATED_FUNCTION;
308
309 // JJW (10/16/2008): Changed to a single function in Node.code, and put
310 // getVariant() in #if 0 block to prevent confusing Doxygen
311#if 0
313 virtual int variant() const ROSE_DEPRECATED_FUNCTION;
315 // virtual int getVariant() const ROSE_DEPRECATED_FUNCTION;
316#endif
317 /* */
318
319
320
321
322 public:
323 /* name Traversal Support Functions
324 \brief Traversal support functions ... incomplete-documentation
325
326 These functions have been made public as part of the design, but they are suggested for internal use
327 or by particularly knowledgable users for specialized tools or applications.
328 */
329 /* */
330
331 // DQ (11/26/2005): Support for visitor pattern mechanims
332 // (inferior to ROSE traversal mechanism, experimental).
336
337 /* DXN (08/09/2010): support for the classic visitor pattern done in GoF */
339 virtual void accept (ROSE_VisitorPattern & visitor) override;
340
341 // DQ (12/26/2005): Support for traversal based on the memory pool
344 static void traverseMemoryPoolNodes(ROSE_VisitTraversal & visit);
345
349
350 // DQ (2/9/2006): Added to support traversal over single representative of each IR node
351 // This traversal helps support internal tools that call static member functions.
352 // note: this function operates on the memory pools.
355 static void visitRepresentativeNode (ROSE_VisitTraversal & visit);
356 /* */
357
358 public:
359 /* NodeId support functions */
361 static SgNode* getNodeByNodeId(VariantT variantT, size_t poolIdx, size_t itemIdx);
364 static SgAsmElfSymverNeededEntry* getNodeByNodeIdInternal(size_t poolIdx, size_t itemIdx);
367 static std::string getNodeIdString(SgAsmElfSymverNeededEntry* sgnode);
368 static std::string getNodeIdStringInternal(SgAsmElfSymverNeededEntry* sgnode);
369
370 public:
371 /* name Memory Allocation Functions
372 \brief Memory allocations functions ... incomplete-documentation
373
374 These functions have been made public as part of the design, but they are suggested for internal use
375 or by particularly knowledgable users for specialized tools or applications.
376 */
377 /* */
378
389 virtual bool isInMemoryPool() override;
390
401 virtual void checkDataMemberPointersIfInMemoryPool() override;
402
403 // DQ (4/30/2006): Modified to be a const function.
418 virtual std::vector<std::pair<SgNode*,std::string> > returnDataMemberPointers() const override;
419
430
442 virtual long getChildIndex( SgNode* childNode ) const override;
443
444 // DQ (9/2/2015): Since this function is generated by ROSETTA, we can't define the
445 // comment here (changed to be a C style comment and not be a doxygen comment).
446 /* \brief Constructor for use by AST File I/O Mechanism
447
448 This constructor permits the IR node to be rebuilt from the contiguously arranged data in memory
449 which obtained via fast binary file I/O from disk.
450 */
451 // SgAsmElfSymverNeededEntry( SgAsmElfSymverNeededEntryStorageClass& source );
452
453
454
455
456
457 // JH (10/24/2005): methods added to support the ast file IO
458 private:
459
460 /* name AST Memory Allocation Support Functions
461 \brief Memory allocations support....
462
463 These functions handle the low leve support of the memory allocation scheme which permits IR nodes to be allocated
464 in large contiguous blocks to reduce memory fragmentation, improve performance, support specialized access (AST traversals),
465 and support the AST File I/O Mechanism.
466 */
467 /* */
468
469 /* JH (10/24/2005): Two typedefs. The TestType notes the type every pointer is cast to before
470 we compare them. Since I had several problems with this, I decided to make a typdef to ensure
471 that I use the same type everywhere, if any changes are made. THe second one declares the type
472 (actually unsigned long) where teh pointer address gets converted to. On 64 bit platforms this
473 might got changed, but unfortunatly, the return types are still unsigned longs. There exists
474 a correspinding one in the AST_FILE_IO class!
475 */
476 // DQ (9/2/2015): This typedef is no longer used, we can't define the
477 // comment here (changed to be a C style comment and not be a doxygen comment).
478 /* \brief Typedef used for low level memory access.
479 */
480 // typedef unsigned char* TestType;
481
482 // DQ (9/2/2015): This typedef is no longer used, we can't define the
483 // comment here (changed to be a C style comment and not be a doxygen comment).
484 /* \brief Typedef used to hold memory addresses as values.
485 */
486 // typedef unsigned long AddressType;
487
488
489
490 // necessary, to have direct access to the p_freepointer and the private methods !
492 friend class AST_FILE_IO;
493
495 friend class SgAsmElfSymverNeededEntryStorageClass;
496
498 friend class AstSpecificDataManagingClass;
499
501 friend class AstSpecificDataManagingClassStorageClass;
502 public:
504 SgAsmElfSymverNeededEntry( const SgAsmElfSymverNeededEntryStorageClass& source );
505
506 // private: // JJW hack
507 /*
508 name AST Memory Allocation Support Variables
509 Memory allocations support variables
510
511 These variables handle the low level support of the memory allocation scheme which permits IR nodes to be allocated
512 in large contiguous blocks to reduce memory fragmentation, improve performance, support specialized access (AST traversals),
513 and support the AST File I/O Mechanism.
514 */
515 /* */
516
517 public:
518
519 // DQ (11/21/2009): Added function to add new Regular Expression attributes and return pointer
520 // to current node (so that it will work cleanly with build functions to specify patterns).
521 // virtual SgNode* addRegExpAttribute();
528
529#ifndef _MSC_VER
530// Rasmussen (04/17/2019): Support for ATerms has been deprecated as it is no longer needed
531// and likely never fully implemented nor tested. Files remain in the src tree but are no
532// longer built.
533#define BUILD_ATERM_SUPPORT 0
534 #if BUILD_ATERM_SUPPORT
535 #ifdef ROSE_USE_ROSE_ATERM_SUPPORT
536 // DQ (10/4/2014): Adding ATerm support to ROSE.
546 // Rasmussen (1/7/2019): Added override to kill warning messages of overridden virtual function
547 virtual ATerm generate_ATerm() override;
548
550 virtual void generate_ATerm_Annotation(ATerm & term) override;
551 #endif
552 #endif // BUILD_ATERM_SUPPORT
553#endif
554 // These can't be virtual functions since we don't yet know what IR node to build (until we have read the aterm).
555 // virtual generate_AST(ATerm & term);
556 // virtual void read_ATerm_Annotation(ATerm & term);
557
558// *** COMMON CODE SECTION ENDS HERE ***
559
560
561// End of memberFunctionString
562// Start of memberFunctionString
563/* #line 706 "/workspace/src/ROSETTA/Grammar/Node.code" */
564
565 // the generated cast function
566 // friend ROSE_DLL_API SgAsmElfSymverNeededEntry* isSgAsmElfSymverNeededEntry ( SgNode* s );
567
568 typedef SgAsmExecutableFileFormat base_node_type;
569
570
571// End of memberFunctionString
572
573
574
575
576 protected:
577// Start of memberFunctionString
578size_t p_version;
579
580// End of memberFunctionString
581// Start of memberFunctionString
582SgAsmGenericString* p_fileName;
583
584// End of memberFunctionString
585// Start of memberFunctionString
587
588// End of memberFunctionString
589
591 friend struct Rose::Traits::generated::describe_field_t<SgAsmElfSymverNeededEntry, size_t,&SgAsmElfSymverNeededEntry::p_version>;
592 friend struct Rose::Traits::generated::describe_field_t<SgAsmElfSymverNeededEntry, SgAsmGenericString*,&SgAsmElfSymverNeededEntry::p_fileName>;
593 friend struct Rose::Traits::generated::describe_field_t<SgAsmElfSymverNeededEntry, SgAsmElfSymverNeededAuxList*,&SgAsmElfSymverNeededEntry::p_entries>;
594
595/* #line 21 "/workspace/src/ROSETTA/Grammar/grammarClassDeclarationMacros.macro" */
596
597
598 };
599#endif
600
601// postdeclarations for SgAsmElfSymverNeededEntry
602
603/* #line 604 "../../../src/frontend/SageIII//SgAsmElfSymverNeededEntry.h" */
604
605/* #line 27 "/workspace/src/ROSETTA/Grammar/grammarClassDeclarationMacros.macro after subst for $POSTDECLARATIONS" */
606
607/* #line 28 "/workspace/src/ROSETTA/Grammar/grammarClassDeclarationMacros.macro" */
608
609
610/* #line 611 "../../../src/frontend/SageIII//SgAsmElfSymverNeededEntry.h" */
611
612#endif // ROSE_SgAsmElfSymverNeededEntry_H
613
Class holding static data and functions supporting File I/O.
Definition AST_FILE_IO.h:19
Attribute containing a regex expression as a string.
Hods a list of symbol version aux entries.
One entry of the ELF symbol version needed table.
GNU symbol version requirements table.
Base class for many binary analysis nodes.
Base class for strings related to binary specimens.
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 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...
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 parse(SgAsmGenericFile *)
Main function to parse DWARF information.
void serialize(std::ostream &output, Graph &graph)
Serialize a graph into a stream of bytes.
void copy(const Word *src, const BitRange &srcRange, Word *dst, const BitRange &dstRange)
Copy some bits.