ROSE 2.1.0
Loading...
Searching...
No Matches
SgAsmCilTypeDef.h
1
2#ifndef ROSE_SgAsmCilTypeDef_H
3#define ROSE_SgAsmCilTypeDef_H
4#include <RoseFirst.h>
5#include <Cxx_GrammarDeclarations.h>
6#include <SgAsmCilMetadata.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 SgAsmCilTypeDef
23
24/* #line 25 "../../../src/frontend/SageIII//SgAsmCilTypeDef.h" */
25
26/* #line 13 "/workspace/src/ROSETTA/Grammar/grammarClassDeclarationMacros.macro after subst for $PREDECLARATIONS" */
27
28/* #line 14 "/workspace/src/ROSETTA/Grammar/grammarClassDeclarationMacros.macro" */
29
30#if !defined(DOCUMENTATION)
31// Class Definition for SgAsmCilTypeDef
32class ROSE_DLL_API SgAsmCilTypeDef : public SgAsmCilMetadata
33 {
34 public:
35
36
37/* #line 38 "../../../src/frontend/SageIII//SgAsmCilTypeDef.h" */
38
39 virtual SgNode* copy(SgCopyHelp& help) const override;
40// Start of memberFunctionString
41/* #line 33376 "/workspace/src/ROSETTA/src/binaryInstruction.C" */
42
43
44 //----------------------- Boost serialization for SgAsmCilTypeDef -----------------------
45#ifdef ROSE_ENABLE_BOOST_SERIALIZATION
46private:
47 friend class boost::serialization::access;
48
49 template<class S>
50 void serialize(S &s, const unsigned /*version*/) {
51 debugSerializationBegin("SgAsmCilTypeDef");
52 s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmCilMetadata);
53 s & BOOST_SERIALIZATION_NVP(p_Flags);
54 s & BOOST_SERIALIZATION_NVP(p_TypeName);
55 s & BOOST_SERIALIZATION_NVP(p_TypeNamespace);
56 s & BOOST_SERIALIZATION_NVP(p_Extends);
57 s & BOOST_SERIALIZATION_NVP(p_FieldList);
58 s & BOOST_SERIALIZATION_NVP(p_MethodList);
59 debugSerializationEnd("SgAsmCilTypeDef");
60 }
61#endif // ROSE_ENABLE_BOOST_SERIALIZATION
62 public:
64 using TypeFlags = std::uint32_t;
65
66 enum : TypeFlags
67 {
68 // Visibility attributes
69 FLG_VISIBILITY_MASK = 0x00000007,
71 FLG_NOT_PUBLIC = 0x00000000,
72 FLG_PUBLIC = 0x00000001,
73 FLG_NESTED_PUBLIC = 0x00000002,
74 FLG_NESTED_PRIVATE = 0x00000003,
75 FLG_NESTED_FAMILY = 0x00000004,
76 FLG_NESTED_ASSEMBLY = 0x00000005,
77 FLG_NESTED_FAM_AND_ASSEM = 0x00000006,
78 FLG_NESTED_FAM_OR_ASSEM = 0x00000007,
79 // class layout attributes
80 FLG_LAYOUT_MASK = 0x00000018,
82 FLG_AUTO_LAYOUT = 0x00000000,
83 FLG_SEQUENTIAL_LAYOUT = 0x00000008,
84 FLG_EXPLICIT_LAYOUT = 0x00000010,
85 // class semantics attributes
86 FLG_CLASS_SEMANTICS_MASK = 0x00000020,
88 FLG_CLASS = 0x00000000,
89 FLG_INTERFACE = 0x00000020,
90 // special semantics in addition to class semantics
91 FLG_ABSTRACT = 0x00000080,
92 FLG_SEALED = 0x00000100,
93 FLG_SPECIAL_NAME = 0x00000400,
94 // implementation attributes
95 FLG_IMPORT = 0x00001000,
96 FLG_SERIALIZABLE = 0x00002000,
97 // string formatting attributes
98 FLG_STRING_FORMAT_MASK = 0x00030000,
100 FLG_ANSI_CLASS = 0x00000000,
101 FLG_UNICODE_CLASS = 0x00010000,
102 FLG_AUTO_CLASS = 0x00020000,
103 FLG_CUSTOM_FORMAT_CLASS = 0x00030000,
104 FLG_CUSTOM_STRING_FORMAT_MASK = 0x00C00000,
106 // class initialization attributes
107 FLG_BEFORE_FIELD_INIT = 0x00100000,
108 // additional flags
109 FLG_RT_SPECIAL_NAME = 0x00000800,
110 FLG_HAS_SECURITY = 0x00040000,
111 FLG_IS_TYPE_FORWARDER = 0x00200000,
112 };
113
114 private:
115public:
121 uint32_t const& get_Flags() const;
122 void set_Flags(uint32_t const&);
125public:
131 uint32_t const& get_TypeName() const;
132 void set_TypeName(uint32_t const&);
135public:
141 uint32_t const& get_TypeNamespace() const;
142 void set_TypeNamespace(uint32_t const&);
145public:
151 uint32_t const& get_Extends() const;
152 void set_Extends(uint32_t const&);
155public:
161 uint32_t const& get_FieldList() const;
162 void set_FieldList(uint32_t const&);
165public:
171 uint32_t const& get_MethodList() const;
172 void set_MethodList(uint32_t const&);
174public:
175 void parse(const std::vector<uint8_t>& buf, size_t& index, uint64_t uses4byteIndexing);
176 void unparse(std::vector<uint8_t>& buf, size_t& index, uint64_t uses4byteIndexing) const;
177 void dump(std::ostream&) const;
178
179 const std::uint8_t* get_TypeName_string() const;
180 const std::uint8_t* get_TypeNamespace_string() const;
181 const SgAsmCilMetadata* get_Extends_object() const;
182 const SgAsmCilMetadata* get_FieldList_object() const;
183 const SgAsmCilMetadata* get_MethodList_object() const;
184 const SgAsmCilMetadata* get_MethodList_object(const SgAsmCilMethodDef*) const;
185public:
187 virtual ~SgAsmCilTypeDef();
188
189public:
192
193protected:
201
202
203// End of memberFunctionString
204// Start of memberFunctionString
205/* #line 1 "/workspace/src/ROSETTA/Grammar/Common.code" */
206
207// *** COMMON CODE SECTION BEGINS HERE ***
208
209 public:
210
211 // DQ (3/25/3006): I put this back in because it had the logic for where the copy function required
212 // and not required which is required to match the other aspects of the copy mechanism code generation.
213 // Specifically it is a problem to declare the copy function everywhere because it is not implemented
214 // for the SgSymbol IR nodes. I'm not clear why it is not implemented for these IR nodes.
215 /* \brief Copies AST (whole subtree, depending on the SgCopyHelp class */
216 // virtual SgNode* copy ( const SgCopyHelp & help) const;
217
219 virtual std::string class_name() const override;
220
222 virtual VariantT variantT() const override; // MS: new variant used in tree traversal
223
225 // King84 (2010.08.16): Moved this to an enum to save space, since it's only used at compiler-time anyway.
226 // static const VariantT static_variant = V_SgAsmCilTypeDef;
227 enum { static_variant = V_SgAsmCilTypeDef };
228
229 /* the generated cast function */
231 ROSE_DLL_API friend SgAsmCilTypeDef* isSgAsmCilTypeDef( SgNode * s );
232
234 ROSE_DLL_API friend const SgAsmCilTypeDef* isSgAsmCilTypeDef( const SgNode * s );
235
236 // ******************************************
237 // * Memory Pool / New / Delete
238 // ******************************************
239
240 public:
242 static const unsigned pool_size; //
244 static std::vector<unsigned char *> pools; //
246 static SgAsmCilTypeDef * next_node; //
247
249 static unsigned long initializeStorageClassArray(SgAsmCilTypeDefStorageClass *); //
250
252 static void clearMemoryPool(); //
253 static void deleteMemoryPool(); //
254
256 static void extendMemoryPoolForFileIO(); //
257
259 static SgAsmCilTypeDef * getPointerFromGlobalIndex(unsigned long); //
261 static SgAsmCilTypeDef * getPointerFromGlobalIndex(AstSpecificDataManagingClass *, unsigned long); //
262
264 static unsigned long getNumberOfValidNodesAndSetGlobalIndexInFreepointer(unsigned long); //
266 static void resetValidFreepointers(); //
268 static unsigned long getNumberOfLastValidPointer(); //
269
270
271#if defined(INLINE_FUNCTIONS)
273 inline void *operator new (size_t size);
274#else
276 void *operator new (size_t size);
277#endif
279 void operator delete (void* pointer, size_t size);
280
281 // DQ (4/5/2007): This is not the correct operator that we want, but appears to be required to compile ROSE with ROSE.
282 void operator delete (void* pointer)
283 {
284 // This is the generated delete operator...
285 SgAsmCilTypeDef::operator delete (pointer,sizeof(SgAsmCilTypeDef));
286 }
287
289 static size_t numberOfNodes();
290
292 static size_t memoryUsage();
293
294 // End of scope which started in IR nodes specific code
295 /* */
296
297 /* name Internal Functions
298 \brief Internal functions ... incomplete-documentation
299
300 These functions have been made public as part of the design, but they are suggested for internal use
301 or by particularly knowledgeable users for specialized tools or applications.
302
303 \internal We could not make these private because they are required by user for special purposes. And
304 it would be unwieldy to have many of the internal classes in ROSE be explicitly defined as friends.
305
306 */
307
308 // MS: 02/12/02 container of pointers to AST successor nodes used in the traversal
309 // overridden in every class by *generated* implementation
311 virtual std::vector<SgNode*> get_traversalSuccessorContainer() const override;
312 // MS: 06/28/02 container of names of variables or container indices
313 // used used in the traversal to access AST successor nodes
314 // overridden in every class by *generated* implementation
317 virtual std::vector<std::string> get_traversalSuccessorNamesContainer() const override;
318
319 // GB (09/25/2007): Functions for index-based access to traversal successors; these are hopefully a lot faster
320 // than all the vector copies. The implementation for these functions is generated for each class.
322 virtual size_t get_numberOfTraversalSuccessors() const override;
324 virtual SgNode *get_traversalSuccessorByIndex(size_t idx) const override;
326 virtual size_t get_childIndex(SgNode *child) const override;
327
328#ifndef ROSE_USE_INTERNAL_FRONTEND_DEVELOPMENT
329 // MS: 08/16/2002 method for generating RTI information
331 virtual RTIReturnType roseRTI() override;
332#endif
333 /* */
334
335
336
337 /* name Deprecated Functions
338 \brief Deprecated functions ... incomplete-documentation
339
340 These functions have been deprecated from use.
341 */
342 /* */
343
345 virtual const char* sage_class_name() const override ROSE_DEPRECATED_FUNCTION;
346
347 // JJW (10/16/2008): Changed to a single function in Node.code, and put
348 // getVariant() in #if 0 block to prevent confusing Doxygen
349#if 0
351 virtual int variant() const ROSE_DEPRECATED_FUNCTION;
353 // virtual int getVariant() const ROSE_DEPRECATED_FUNCTION;
354#endif
355 /* */
356
357
358
359
360 public:
361 /* name Traversal Support Functions
362 \brief Traversal support functions ... incomplete-documentation
363
364 These functions have been made public as part of the design, but they are suggested for internal use
365 or by particularly knowledgable users for specialized tools or applications.
366 */
367 /* */
368
369 // DQ (11/26/2005): Support for visitor pattern mechanims
370 // (inferior to ROSE traversal mechanism, experimental).
374
375 /* DXN (08/09/2010): support for the classic visitor pattern done in GoF */
377 virtual void accept (ROSE_VisitorPattern & visitor) override;
378
379 // DQ (12/26/2005): Support for traversal based on the memory pool
382 static void traverseMemoryPoolNodes(ROSE_VisitTraversal & visit);
383
387
388 // DQ (2/9/2006): Added to support traversal over single representative of each IR node
389 // This traversal helps support internal tools that call static member functions.
390 // note: this function operates on the memory pools.
393 static void visitRepresentativeNode (ROSE_VisitTraversal & visit);
394 /* */
395
396 public:
397 /* NodeId support functions */
399 static SgNode* getNodeByNodeId(VariantT variantT, size_t poolIdx, size_t itemIdx);
402 static SgAsmCilTypeDef* getNodeByNodeIdInternal(size_t poolIdx, size_t itemIdx);
405 static std::string getNodeIdString(SgAsmCilTypeDef* sgnode);
406 static std::string getNodeIdStringInternal(SgAsmCilTypeDef* sgnode);
407
408 public:
409 /* name Memory Allocation Functions
410 \brief Memory allocations functions ... incomplete-documentation
411
412 These functions have been made public as part of the design, but they are suggested for internal use
413 or by particularly knowledgable users for specialized tools or applications.
414 */
415 /* */
416
427 virtual bool isInMemoryPool() override;
428
439 virtual void checkDataMemberPointersIfInMemoryPool() override;
440
441 // DQ (4/30/2006): Modified to be a const function.
456 virtual std::vector<std::pair<SgNode*,std::string> > returnDataMemberPointers() const override;
457
468
480 virtual long getChildIndex( SgNode* childNode ) const override;
481
482 // DQ (9/2/2015): Since this function is generated by ROSETTA, we can't define the
483 // comment here (changed to be a C style comment and not be a doxygen comment).
484 /* \brief Constructor for use by AST File I/O Mechanism
485
486 This constructor permits the IR node to be rebuilt from the contiguously arranged data in memory
487 which obtained via fast binary file I/O from disk.
488 */
489 // SgAsmCilTypeDef( SgAsmCilTypeDefStorageClass& source );
490
491
492
493
494
495 // JH (10/24/2005): methods added to support the ast file IO
496 private:
497
498 /* name AST Memory Allocation Support Functions
499 \brief Memory allocations support....
500
501 These functions handle the low leve support of the memory allocation scheme which permits IR nodes to be allocated
502 in large contiguous blocks to reduce memory fragmentation, improve performance, support specialized access (AST traversals),
503 and support the AST File I/O Mechanism.
504 */
505 /* */
506
507 /* JH (10/24/2005): Two typedefs. The TestType notes the type every pointer is cast to before
508 we compare them. Since I had several problems with this, I decided to make a typdef to ensure
509 that I use the same type everywhere, if any changes are made. THe second one declares the type
510 (actually unsigned long) where teh pointer address gets converted to. On 64 bit platforms this
511 might got changed, but unfortunatly, the return types are still unsigned longs. There exists
512 a correspinding one in the AST_FILE_IO class!
513 */
514 // DQ (9/2/2015): This typedef is no longer used, we can't define the
515 // comment here (changed to be a C style comment and not be a doxygen comment).
516 /* \brief Typedef used for low level memory access.
517 */
518 // typedef unsigned char* TestType;
519
520 // DQ (9/2/2015): This typedef is no longer used, we can't define the
521 // comment here (changed to be a C style comment and not be a doxygen comment).
522 /* \brief Typedef used to hold memory addresses as values.
523 */
524 // typedef unsigned long AddressType;
525
526
527
528 // necessary, to have direct access to the p_freepointer and the private methods !
530 friend class AST_FILE_IO;
531
533 friend class SgAsmCilTypeDefStorageClass;
534
536 friend class AstSpecificDataManagingClass;
537
539 friend class AstSpecificDataManagingClassStorageClass;
540 public:
542 SgAsmCilTypeDef( const SgAsmCilTypeDefStorageClass& source );
543
544 // private: // JJW hack
545 /*
546 name AST Memory Allocation Support Variables
547 Memory allocations support variables
548
549 These variables handle the low level support of the memory allocation scheme which permits IR nodes to be allocated
550 in large contiguous blocks to reduce memory fragmentation, improve performance, support specialized access (AST traversals),
551 and support the AST File I/O Mechanism.
552 */
553 /* */
554
555 public:
556
557 // DQ (11/21/2009): Added function to add new Regular Expression attributes and return pointer
558 // to current node (so that it will work cleanly with build functions to specify patterns).
559 // virtual SgNode* addRegExpAttribute();
566
567#ifndef _MSC_VER
568// Rasmussen (04/17/2019): Support for ATerms has been deprecated as it is no longer needed
569// and likely never fully implemented nor tested. Files remain in the src tree but are no
570// longer built.
571#define BUILD_ATERM_SUPPORT 0
572 #if BUILD_ATERM_SUPPORT
573 #ifdef ROSE_USE_ROSE_ATERM_SUPPORT
574 // DQ (10/4/2014): Adding ATerm support to ROSE.
584 // Rasmussen (1/7/2019): Added override to kill warning messages of overridden virtual function
585 virtual ATerm generate_ATerm() override;
586
588 virtual void generate_ATerm_Annotation(ATerm & term) override;
589 #endif
590 #endif // BUILD_ATERM_SUPPORT
591#endif
592 // These can't be virtual functions since we don't yet know what IR node to build (until we have read the aterm).
593 // virtual generate_AST(ATerm & term);
594 // virtual void read_ATerm_Annotation(ATerm & term);
595
596// *** COMMON CODE SECTION ENDS HERE ***
597
598
599// End of memberFunctionString
600// Start of memberFunctionString
601/* #line 638 "/workspace/src/ROSETTA/Grammar/Node.code" */
602
603 // the generated cast function
604 // friend ROSE_DLL_API SgAsmCilTypeDef* isSgAsmCilTypeDef ( SgNode* s );
605
606 typedef SgAsmCilMetadata base_node_type;
607
608
609// End of memberFunctionString
610
611
612
613
614
615
616
617 protected:
618// Start of memberFunctionString
619uint32_t p_Flags;
620
621// End of memberFunctionString
622// Start of memberFunctionString
623uint32_t p_TypeName;
624
625// End of memberFunctionString
626// Start of memberFunctionString
627uint32_t p_TypeNamespace;
628
629// End of memberFunctionString
630// Start of memberFunctionString
631uint32_t p_Extends;
632
633// End of memberFunctionString
634// Start of memberFunctionString
635uint32_t p_FieldList;
636
637// End of memberFunctionString
638// Start of memberFunctionString
639uint32_t p_MethodList;
640
641// End of memberFunctionString
642
644 friend struct Rose::Traits::generated::describe_field_t<SgAsmCilTypeDef, uint32_t,&SgAsmCilTypeDef::p_Flags>;
645 friend struct Rose::Traits::generated::describe_field_t<SgAsmCilTypeDef, uint32_t,&SgAsmCilTypeDef::p_TypeName>;
646 friend struct Rose::Traits::generated::describe_field_t<SgAsmCilTypeDef, uint32_t,&SgAsmCilTypeDef::p_TypeNamespace>;
647 friend struct Rose::Traits::generated::describe_field_t<SgAsmCilTypeDef, uint32_t,&SgAsmCilTypeDef::p_Extends>;
648 friend struct Rose::Traits::generated::describe_field_t<SgAsmCilTypeDef, uint32_t,&SgAsmCilTypeDef::p_FieldList>;
649 friend struct Rose::Traits::generated::describe_field_t<SgAsmCilTypeDef, uint32_t,&SgAsmCilTypeDef::p_MethodList>;
650
651/* #line 21 "/workspace/src/ROSETTA/Grammar/grammarClassDeclarationMacros.macro" */
652
653
654 };
655#endif
656
657// postdeclarations for SgAsmCilTypeDef
658
659/* #line 660 "../../../src/frontend/SageIII//SgAsmCilTypeDef.h" */
660
661/* #line 27 "/workspace/src/ROSETTA/Grammar/grammarClassDeclarationMacros.macro after subst for $POSTDECLARATIONS" */
662
663/* #line 28 "/workspace/src/ROSETTA/Grammar/grammarClassDeclarationMacros.macro" */
664
665
666/* #line 667 "../../../src/frontend/SageIII//SgAsmCilTypeDef.h" */
667
668#endif // ROSE_SgAsmCilTypeDef_H
669
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 CIL branch of binary analysis IR nodes.
void initializeProperties()
Initialize all properties that have explicit initial values.
CIL MethodDef node (II.22.26).
CIL TypeDef node (II.22.37).
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.
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.