ROSE 0.11.145.247
SgAsmGenericHeader.h
1
2#ifndef ROSE_SgAsmGenericHeader_H
3#define ROSE_SgAsmGenericHeader_H
4#include <RoseFirst.h>
5#include <Cxx_GrammarDeclarations.h>
6#include <SgAsmGenericSection.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 SgAsmGenericHeader
23
24/* #line 25 "../../../src/frontend/SageIII//SgAsmGenericHeader.h" */
25/* #line 29067 "/workspace/src/ROSETTA/src/binaryInstruction.C" */
26
27#include <Rose/BinaryAnalysis/Address.h>
28#include <Rose/BinaryAnalysis/ByteOrder.h>
29#include <Rose/BinaryAnalysis/RelativeVirtualAddress.h>
30#include <sageContainer.h>
31#include <SgAsmGenericFormat.h>
32
33#ifdef ROSE_SgAsmGenericHeader_IMPL
34#include <SgAsmGenericDLLList.h>
35#include <SgAsmGenericSectionList.h>
36#endif
37
38class SgAsmGenericDLL;
40
41
42/* #line 13 "/workspace/src/ROSETTA/Grammar/grammarClassDeclarationMacros.macro after subst for $PREDECLARATIONS" */
43
44/* #line 14 "/workspace/src/ROSETTA/Grammar/grammarClassDeclarationMacros.macro" */
45
46#if !defined(DOCUMENTATION)
47// Class Definition for SgAsmGenericHeader
48class ROSE_DLL_API SgAsmGenericHeader : public SgAsmGenericSection
49 {
50 public:
51
52
53/* #line 54 "../../../src/frontend/SageIII//SgAsmGenericHeader.h" */
54
55 virtual SgNode* copy ( SgCopyHelp& help) const override;
56// Start of memberFunctionString
57/* #line 29131 "/workspace/src/ROSETTA/src/binaryInstruction.C" */
58
59
60 //----------------------- Boost serialization for SgAsmGenericHeader -----------------------
61#ifdef ROSE_ENABLE_BOOST_SERIALIZATION
62private:
63 friend class boost::serialization::access;
64
65 template<class S>
66 void serialize(S &s, const unsigned /*version*/) {
67 debugSerializationBegin("SgAsmGenericHeader");
68 s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmGenericSection);
69 s & BOOST_SERIALIZATION_NVP(p_executableFormat);
70 s & BOOST_SERIALIZATION_NVP(p_magic);
71 s & BOOST_SERIALIZATION_NVP(p_isa);
72 s & BOOST_SERIALIZATION_NVP(p_baseVa);
73 s & BOOST_SERIALIZATION_NVP(p_entryRvas);
74 s & BOOST_SERIALIZATION_NVP(p_dlls);
75 s & BOOST_SERIALIZATION_NVP(p_sections);
76 debugSerializationEnd("SgAsmGenericHeader");
77 }
78#endif // ROSE_ENABLE_BOOST_SERIALIZATION
79public:
80public:
84 SgAsmGenericFormat* const& get_executableFormat() const;
85 void set_executableFormat(SgAsmGenericFormat* const&);
88public:
92 SgCharList const& get_magic() const;
93 SgCharList& get_magic();
94 void set_magic(SgCharList const&);
97public:
101 SgAsmGenericFormat::InsSetArchitecture const& get_isa() const;
102 void set_isa(SgAsmGenericFormat::InsSetArchitecture const&);
105public:
110 void set_baseVa(Rose::BinaryAnalysis::Address const&);
113public:
117 SgRVAList const& get_entryRvas() const;
118 SgRVAList& get_entryRvas();
119 void set_entryRvas(SgRVAList const&);
122public:
126 SgAsmGenericDLLList* const& get_dlls() const;
127 void set_dlls(SgAsmGenericDLLList* const&);
130public:
134 SgAsmGenericSectionList* const& get_sections() const;
135 void set_sections(SgAsmGenericSectionList* const&);
137public:
146
147 virtual bool reallocate() override;
148
150 virtual void unparse(std::ostream&) const override;
151
153 virtual void dump(FILE*, const char *prefix, ssize_t idx) const override;
154
156 virtual const char *formatName() const;
157
159 void addDll(SgAsmGenericDLL *dll);
160
162 std::vector<SgAsmGenericDLL*>& get_dlls();
163
168 Rose::BinaryAnalysis::Address get_entryRva() const;
169
171 void addEntryRva(const Rose::BinaryAnalysis::RelativeVirtualAddress&);
172
173 /* Convenience functions */
175 size_t get_wordSize() const;
176
180 void addSection(SgAsmGenericSection*);
181
183 void removeSection(SgAsmGenericSection*);
184
186 SgAsmGenericSectionPtrList get_mappedSections() const;
187
189 SgAsmGenericSectionPtrList get_sectionsById(int id) const;
190
194 SgAsmGenericSectionPtrList get_sectionsByName(std::string, char sep=0) const;
195
197 SgAsmGenericSectionPtrList get_sectionsByOffset(Rose::BinaryAnalysis::Address offset, Rose::BinaryAnalysis::Address size) const;
198
200 SgAsmGenericSectionPtrList get_sectionsByRva(Rose::BinaryAnalysis::Address rva) const;
201
208 SgAsmGenericSectionPtrList get_sectionsByVa(Rose::BinaryAnalysis::Address va, bool use_preferred) const;
209
211 SgAsmGenericSection *get_sectionById(int id, size_t *nfound=0) const;
212
214 SgAsmGenericSection *get_sectionByName(const std::string&, char sep=0, size_t *nfound=0) const;
215
218 size_t *nfound=0) const;
219
223 SgAsmGenericSection *get_sectionByRva(Rose::BinaryAnalysis::Address rva, size_t *nfound=0) const;
224
231 SgAsmGenericSection *get_sectionByVa(Rose::BinaryAnalysis::Address va, bool use_preferred, size_t *nfound=0) const;
232
234 SgAsmGenericSection *get_bestSectionByVa(Rose::BinaryAnalysis::Address va, bool use_preferred, size_t *nfound=0) const;
235
237 // Deprecated 2023-11
239public:
240 SgAsmGenericFormat* get_exec_format() const ROSE_DEPRECATED("use get_executableFormat");
241 void set_exec_format(SgAsmGenericFormat*) ROSE_DEPRECATED("use set_executableFormat");
242 Rose::BinaryAnalysis::Address get_base_va() const ROSE_DEPRECATED("use get_baseVa");
243 void set_base_va(Rose::BinaryAnalysis::Address) ROSE_DEPRECATED("use set_baseVa");
244 SgRVAList& get_entry_rvas() ROSE_DEPRECATED("use get_entryRvas");
245 const SgRVAList& get_entry_rvas() const ROSE_DEPRECATED("use get_entryRvas");
246 void set_entry_rvas(const SgRVAList&) ROSE_DEPRECATED("use set_entryRvas");
247 virtual const char *format_name() const ROSE_DEPRECATED("use formatName");
248 void add_dll(SgAsmGenericDLL*) ROSE_DEPRECATED("use addDll");
249 Rose::BinaryAnalysis::Address get_entry_rva() const ROSE_DEPRECATED("use get_entryRva");
250 void add_entry_rva(const Rose::BinaryAnalysis::RelativeVirtualAddress&) ROSE_DEPRECATED("use addEntryRva");
251 size_t get_word_size() const ROSE_DEPRECATED("use get_wordSize");
252 void add_section(SgAsmGenericSection*) ROSE_DEPRECATED("use addSection");
253 void remove_section(SgAsmGenericSection*) ROSE_DEPRECATED("use removeSection");
254 SgAsmGenericSectionPtrList get_mapped_sections() const ROSE_DEPRECATED("use get_mappedSections");
255 SgAsmGenericSectionPtrList get_sections_by_id(int) const ROSE_DEPRECATED("use get_sectionsById");
256 SgAsmGenericSectionPtrList get_sections_by_name(std::string, char=0) const ROSE_DEPRECATED("use get_sectionsByName");
257 SgAsmGenericSectionPtrList get_sections_by_offset(Rose::BinaryAnalysis::Address, Rose::BinaryAnalysis::Address) const
258 ROSE_DEPRECATED("use get_sectionsByOffset");
259 SgAsmGenericSectionPtrList get_sections_by_rva(Rose::BinaryAnalysis::Address) const ROSE_DEPRECATED("use get_sectionsByRva");
260 SgAsmGenericSectionPtrList get_sections_by_va(Rose::BinaryAnalysis::Address, bool) const
261 ROSE_DEPRECATED("use get_sectionsByVa");
262 SgAsmGenericSection *get_section_by_id(int, size_t* = nullptr) const ROSE_DEPRECATED("use get_sectionById");
263 SgAsmGenericSection *get_section_by_name(const std::string&, char=0, size_t* = nullptr) const
264 ROSE_DEPRECATED("use get_sectionByName");
265 SgAsmGenericSection *get_section_by_offset(Rose::BinaryAnalysis::Address, Rose::BinaryAnalysis::Address,
266 size_t* = nullptr) const ROSE_DEPRECATED("use get_sectionByOffset");
267 SgAsmGenericSection *get_section_by_rva(Rose::BinaryAnalysis::Address, size_t* = nullptr) const
268 ROSE_DEPRECATED("use get_sectionByRva");
269 SgAsmGenericSection *get_section_by_va(Rose::BinaryAnalysis::Address, bool, size_t* = nullptr) const
270 ROSE_DEPRECATED("use get_sectionByVa");
271 SgAsmGenericSection *get_best_section_by_va(Rose::BinaryAnalysis::Address, bool, size_t* = nullptr) const
272 ROSE_DEPRECATED("use get_bestSectionByVa");
273public:
275 virtual ~SgAsmGenericHeader();
276
277public:
280
281protected:
288 void initializeProperties();
289
290
291// End of memberFunctionString
292// Start of memberFunctionString
293/* #line 1 "/workspace/src/ROSETTA/Grammar/Common.code" */
294
295// *** COMMON CODE SECTION BEGINS HERE ***
296
297 public:
298
299 // DQ (3/25/3006): I put this back in because it had the logic for where the copy function required
300 // and not required which is required to match the other aspects of the copy mechanism code generation.
301 // Specifically it is a problem to declare the copy function everywhere because it is not implemented
302 // for the SgSymbol IR nodes. I'm not clear why it is not implemented for these IR nodes.
303 /* \brief Copies AST (whole subtree, depending on the SgCopyHelp class */
304 // virtual SgNode* copy ( const SgCopyHelp & help) const;
305
307 virtual std::string class_name() const override;
308
310 virtual VariantT variantT() const override; // MS: new variant used in tree traversal
311
313 // King84 (2010.08.16): Moved this to an enum to save space, since it's only used at compiler-time anyway.
314 // static const VariantT static_variant = V_SgAsmGenericHeader;
315 enum { static_variant = V_SgAsmGenericHeader };
316
317 /* the generated cast function */
319 ROSE_DLL_API friend SgAsmGenericHeader* isSgAsmGenericHeader( SgNode * s );
320
322 ROSE_DLL_API friend const SgAsmGenericHeader* isSgAsmGenericHeader( const SgNode * s );
323
324 // ******************************************
325 // * Memory Pool / New / Delete
326 // ******************************************
327
328 public:
330 static const unsigned pool_size; //
332 static std::vector<unsigned char *> pools; //
334 static SgAsmGenericHeader * next_node; //
335
337 static unsigned long initializeStorageClassArray(SgAsmGenericHeaderStorageClass *); //
338
340 static void clearMemoryPool(); //
341 static void deleteMemoryPool(); //
342
344 static void extendMemoryPoolForFileIO(); //
345
347 static SgAsmGenericHeader * getPointerFromGlobalIndex(unsigned long); //
349 static SgAsmGenericHeader * getPointerFromGlobalIndex(AstSpecificDataManagingClass *, unsigned long); //
350
352 static unsigned long getNumberOfValidNodesAndSetGlobalIndexInFreepointer(unsigned long); //
354 static void resetValidFreepointers(); //
356 static unsigned long getNumberOfLastValidPointer(); //
357
358
359#if defined(INLINE_FUNCTIONS)
361 inline void *operator new (size_t size);
362#else
364 void *operator new (size_t size);
365#endif
367 void operator delete (void* pointer, size_t size);
368
369 // DQ (4/5/2007): This is not the correct operator that we want, but appears to be required to compile ROSE with ROSE.
370 void operator delete (void* pointer)
371 {
372 // This is the generated delete operator...
373 SgAsmGenericHeader::operator delete (pointer,sizeof(SgAsmGenericHeader));
374 }
375
377 static size_t numberOfNodes();
378
380 static size_t memoryUsage();
381
382 // End of scope which started in IR nodes specific code
383 /* */
384
385 /* name Internal Functions
386 \brief Internal functions ... incomplete-documentation
387
388 These functions have been made public as part of the design, but they are suggested for internal use
389 or by particularly knowledgeable users for specialized tools or applications.
390
391 \internal We could not make these private because they are required by user for special purposes. And
392 it would be unwieldy to have many of the internal classes in ROSE be explicitly defined as friends.
393
394 */
395
396 // MS: 02/12/02 container of pointers to AST successor nodes used in the traversal
397 // overridden in every class by *generated* implementation
399 virtual std::vector<SgNode*> get_traversalSuccessorContainer() const override;
400 // MS: 06/28/02 container of names of variables or container indices
401 // used used in the traversal to access AST successor nodes
402 // overridden in every class by *generated* implementation
405 virtual std::vector<std::string> get_traversalSuccessorNamesContainer() const override;
406
407 // GB (09/25/2007): Functions for index-based access to traversal successors; these are hopefully a lot faster
408 // than all the vector copies. The implementation for these functions is generated for each class.
410 virtual size_t get_numberOfTraversalSuccessors() const override;
412 virtual SgNode *get_traversalSuccessorByIndex(size_t idx) const override;
414 virtual size_t get_childIndex(SgNode *child) const override;
415
416#ifndef ROSE_USE_INTERNAL_FRONTEND_DEVELOPMENT
417 // MS: 08/16/2002 method for generating RTI information
419 virtual RTIReturnType roseRTI() override;
420#endif
421 /* */
422
423
424
425 /* name Deprecated Functions
426 \brief Deprecated functions ... incomplete-documentation
427
428 These functions have been deprecated from use.
429 */
430 /* */
431
433 virtual const char* sage_class_name() const override ROSE_DEPRECATED_FUNCTION;
434
435 // JJW (10/16/2008): Changed to a single function in Node.code, and put
436 // getVariant() in #if 0 block to prevent confusing Doxygen
437#if 0
439 virtual int variant() const ROSE_DEPRECATED_FUNCTION;
441 // virtual int getVariant() const ROSE_DEPRECATED_FUNCTION;
442#endif
443 /* */
444
445
446
447
448 public:
449 /* name Traversal Support Functions
450 \brief Traversal support functions ... incomplete-documentation
451
452 These functions have been made public as part of the design, but they are suggested for internal use
453 or by particularly knowledgable users for specialized tools or applications.
454 */
455 /* */
456
457 // DQ (11/26/2005): Support for visitor pattern mechanims
458 // (inferior to ROSE traversal mechanism, experimental).
462
463 /* DXN (08/09/2010): support for the classic visitor pattern done in GoF */
465 virtual void accept (ROSE_VisitorPattern & visitor) override;
466
467 // DQ (12/26/2005): Support for traversal based on the memory pool
470 static void traverseMemoryPoolNodes(ROSE_VisitTraversal & visit);
471
475
476 // DQ (2/9/2006): Added to support traversal over single representative of each IR node
477 // This traversal helps support internal tools that call static member functions.
478 // note: this function operates on the memory pools.
481 static void visitRepresentativeNode (ROSE_VisitTraversal & visit);
482 /* */
483
484 public:
485 /* NodeId support functions */
487 static SgNode* getNodeByNodeId(VariantT variantT, size_t poolIdx, size_t itemIdx);
490 static SgAsmGenericHeader* getNodeByNodeIdInternal(size_t poolIdx, size_t itemIdx);
493 static std::string getNodeIdString(SgAsmGenericHeader* sgnode);
494 static std::string getNodeIdStringInternal(SgAsmGenericHeader* sgnode);
495
496 public:
497 /* name Memory Allocation Functions
498 \brief Memory allocations functions ... incomplete-documentation
499
500 These functions have been made public as part of the design, but they are suggested for internal use
501 or by particularly knowledgable users for specialized tools or applications.
502 */
503 /* */
504
515 virtual bool isInMemoryPool() override;
516
527 virtual void checkDataMemberPointersIfInMemoryPool() override;
528
529 // DQ (4/30/2006): Modified to be a const function.
544 virtual std::vector<std::pair<SgNode*,std::string> > returnDataMemberPointers() const override;
545
556
568 virtual long getChildIndex( SgNode* childNode ) const override;
569
570 // DQ (9/2/2015): Since this function is generated by ROSETTA, we can't define the
571 // comment here (changed to be a C style comment and not be a doxygen comment).
572 /* \brief Constructor for use by AST File I/O Mechanism
573
574 This constructor permits the IR node to be rebuilt from the contiguously arranged data in memory
575 which obtained via fast binary file I/O from disk.
576 */
577 // SgAsmGenericHeader( SgAsmGenericHeaderStorageClass& source );
578
579
580
581
582
583 // JH (10/24/2005): methods added to support the ast file IO
584 private:
585
586 /* name AST Memory Allocation Support Functions
587 \brief Memory allocations support....
588
589 These functions handle the low leve support of the memory allocation scheme which permits IR nodes to be allocated
590 in large contiguous blocks to reduce memory fragmentation, improve performance, support specialized access (AST traversals),
591 and support the AST File I/O Mechanism.
592 */
593 /* */
594
595 /* JH (10/24/2005): Two typedefs. The TestType notes the type every pointer is cast to before
596 we compare them. Since I had several problems with this, I decided to make a typdef to ensure
597 that I use the same type everywhere, if any changes are made. THe second one declares the type
598 (actually unsigned long) where teh pointer address gets converted to. On 64 bit platforms this
599 might got changed, but unfortunatly, the return types are still unsigned longs. There exists
600 a correspinding one in the AST_FILE_IO class!
601 */
602 // DQ (9/2/2015): This typedef is no longer used, we can't define the
603 // comment here (changed to be a C style comment and not be a doxygen comment).
604 /* \brief Typedef used for low level memory access.
605 */
606 // typedef unsigned char* TestType;
607
608 // DQ (9/2/2015): This typedef is no longer used, we can't define the
609 // comment here (changed to be a C style comment and not be a doxygen comment).
610 /* \brief Typedef used to hold memory addresses as values.
611 */
612 // typedef unsigned long AddressType;
613
614
615
616 // necessary, to have direct access to the p_freepointer and the private methods !
618 friend class AST_FILE_IO;
619
621 friend class SgAsmGenericHeaderStorageClass;
622
624 friend class AstSpecificDataManagingClass;
625
627 friend class AstSpecificDataManagingClassStorageClass;
628 public:
630 SgAsmGenericHeader( const SgAsmGenericHeaderStorageClass& source );
631
632 // private: // JJW hack
633 /*
634 name AST Memory Allocation Support Variables
635 Memory allocations support variables
636
637 These variables handle the low level support of the memory allocation scheme which permits IR nodes to be allocated
638 in large contiguous blocks to reduce memory fragmentation, improve performance, support specialized access (AST traversals),
639 and support the AST File I/O Mechanism.
640 */
641 /* */
642
643 public:
644
645 // DQ (11/21/2009): Added function to add new Regular Expression attributes and return pointer
646 // to current node (so that it will work cleanly with build functions to specify patterns).
647 // virtual SgNode* addRegExpAttribute();
654
655#ifndef _MSC_VER
656// Rasmussen (04/17/2019): Support for ATerms has been deprecated as it is no longer needed
657// and likely never fully implemented nor tested. Files remain in the src tree but are no
658// longer built.
659#define BUILD_ATERM_SUPPORT 0
660 #if BUILD_ATERM_SUPPORT
661 #ifdef ROSE_USE_ROSE_ATERM_SUPPORT
662 // DQ (10/4/2014): Adding ATerm support to ROSE.
672 // Rasmussen (1/7/2019): Added override to kill warning messages of overridden virtual function
673 virtual ATerm generate_ATerm() override;
674
676 virtual void generate_ATerm_Annotation(ATerm & term) override;
677 #endif
678 #endif // BUILD_ATERM_SUPPORT
679#endif
680 // These can't be virtual functions since we don't yet know what IR node to build (until we have read the aterm).
681 // virtual generate_AST(ATerm & term);
682 // virtual void read_ATerm_Annotation(ATerm & term);
683
684// *** COMMON CODE SECTION ENDS HERE ***
685
686
687// End of memberFunctionString
688// Start of memberFunctionString
689/* #line 710 "/workspace/src/ROSETTA/Grammar/Node.code" */
690
691 // the generated cast function
692 // friend ROSE_DLL_API SgAsmGenericHeader* isSgAsmGenericHeader ( SgNode* s );
693
694 typedef SgAsmGenericSection base_node_type;
695
696
697// End of memberFunctionString
698
699
700
701
702
703
704
705
706 protected:
707// Start of memberFunctionString
708SgAsmGenericFormat* p_executableFormat;
709
710// End of memberFunctionString
711// Start of memberFunctionString
712SgCharList p_magic;
713
714// End of memberFunctionString
715// Start of memberFunctionString
717
718// End of memberFunctionString
719// Start of memberFunctionString
721
722// End of memberFunctionString
723// Start of memberFunctionString
724SgRVAList p_entryRvas;
725
726// End of memberFunctionString
727// Start of memberFunctionString
728SgAsmGenericDLLList* p_dlls;
729
730// End of memberFunctionString
731// Start of memberFunctionString
732SgAsmGenericSectionList* p_sections;
733
734// End of memberFunctionString
735
737 friend struct Rose::Traits::generated::describe_field_t<SgAsmGenericHeader, SgAsmGenericFormat*,&SgAsmGenericHeader::p_executableFormat>;
738 friend struct Rose::Traits::generated::describe_field_t<SgAsmGenericHeader, SgCharList,&SgAsmGenericHeader::p_magic>;
740 friend struct Rose::Traits::generated::describe_field_t<SgAsmGenericHeader, Rose::BinaryAnalysis::Address,&SgAsmGenericHeader::p_baseVa>;
741 friend struct Rose::Traits::generated::describe_field_t<SgAsmGenericHeader, SgRVAList,&SgAsmGenericHeader::p_entryRvas>;
742 friend struct Rose::Traits::generated::describe_field_t<SgAsmGenericHeader, SgAsmGenericDLLList*,&SgAsmGenericHeader::p_dlls>;
743 friend struct Rose::Traits::generated::describe_field_t<SgAsmGenericHeader, SgAsmGenericSectionList*,&SgAsmGenericHeader::p_sections>;
744
745/* #line 21 "/workspace/src/ROSETTA/Grammar/grammarClassDeclarationMacros.macro" */
746
747
748 };
749#endif
750
751// postdeclarations for SgAsmGenericHeader
752
753/* #line 754 "../../../src/frontend/SageIII//SgAsmGenericHeader.h" */
754
755/* #line 27 "/workspace/src/ROSETTA/Grammar/grammarClassDeclarationMacros.macro after subst for $POSTDECLARATIONS" */
756
757/* #line 28 "/workspace/src/ROSETTA/Grammar/grammarClassDeclarationMacros.macro" */
758
759
760/* #line 761 "../../../src/frontend/SageIII//SgAsmGenericHeader.h" */
761
762#endif // ROSE_SgAsmGenericHeader_H
763
Class holding static data and functions supporting File I/O.
Definition AST_FILE_IO.h:19
Attribute containing a regex expression as a string.
Optionally bound relative virtual address.
InsSetArchitecture
Instruction sets organized by families.
List of pointers to other nodes.
Base class for dynamically linked library information.
Base class for binary files.
Basic information about an executable container.
Base class for container file headers.
List of pointers to file sections.
Contiguous region of a file.
virtual void dump(FILE *, const char *prefix, ssize_t idx) const
Print some debugging info.
Rose::BinaryAnalysis::Address get_baseVa() const
Base virtual address for a section.
virtual bool reallocate()
Called prior to unparse to make things consistent.
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.
const char * InsSetArchitecture(int64_t)
Convert SgAsmExecutableFileFormat::InsSetArchitecture enum constant to a string.