ROSE 0.11.145.147
SgAsmCilAssembly.h
1
2#ifndef ROSE_SgAsmCilAssembly_H
3#define ROSE_SgAsmCilAssembly_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 SgAsmCilAssembly
23
24/* #line 25 "../../../src/frontend/SageIII//SgAsmCilAssembly.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 SgAsmCilAssembly
32class ROSE_DLL_API SgAsmCilAssembly : public SgAsmCilMetadata
33 {
34 public:
35
36
37/* #line 38 "../../../src/frontend/SageIII//SgAsmCilAssembly.h" */
38
39 virtual SgNode* copy ( SgCopyHelp& help) const override;
40// Start of memberFunctionString
41/* #line 40345 "/workspace/src/ROSETTA/src/binaryInstruction.C" */
42
43
44 //----------------------- Boost serialization for SgAsmCilAssembly -----------------------
45#ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
46private:
47 friend class boost::serialization::access;
48
49 template<class S>
50 void serialize(S &s, const unsigned /*version*/) {
51 debugSerializationBegin("SgAsmCilAssembly");
52 s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmCilMetadata);
53 s & BOOST_SERIALIZATION_NVP(p_HashAlgId);
54 s & BOOST_SERIALIZATION_NVP(p_MajorVersion);
55 s & BOOST_SERIALIZATION_NVP(p_MinorVersion);
56 s & BOOST_SERIALIZATION_NVP(p_BuildNumber);
57 s & BOOST_SERIALIZATION_NVP(p_RevisionNumber);
58 s & BOOST_SERIALIZATION_NVP(p_Flags);
59 s & BOOST_SERIALIZATION_NVP(p_PublicKey);
60 s & BOOST_SERIALIZATION_NVP(p_Name);
61 s & BOOST_SERIALIZATION_NVP(p_Culture);
62 debugSerializationEnd("SgAsmCilAssembly");
63 }
64#endif // ROSE_HAVE_BOOST_SERIALIZATION_LIB
65
66public:
72 uint32_t const& get_HashAlgId() const;
73 void set_HashAlgId(uint32_t const&);
76public:
82 uint16_t const& get_MajorVersion() const;
83 void set_MajorVersion(uint16_t const&);
86public:
92 uint16_t const& get_MinorVersion() const;
93 void set_MinorVersion(uint16_t const&);
96public:
102 uint16_t const& get_BuildNumber() const;
103 void set_BuildNumber(uint16_t const&);
106public:
112 uint16_t const& get_RevisionNumber() const;
113 void set_RevisionNumber(uint16_t const&);
116public:
122 uint32_t const& get_Flags() const;
123 void set_Flags(uint32_t const&);
126public:
132 uint32_t const& get_PublicKey() const;
133 void set_PublicKey(uint32_t const&);
136public:
142 uint32_t const& get_Name() const;
143 void set_Name(uint32_t const&);
146public:
152 uint32_t const& get_Culture() const;
153 void set_Culture(uint32_t const&);
155public:
156 void parse(const std::vector<uint8_t>& buf, size_t& index, uint64_t uses4byteIndexing);
157 void unparse(std::vector<uint8_t>& buf, size_t& index, uint64_t uses4byteIndexing) const;
158 void dump(std::ostream&) const;
159
160 const std::uint8_t* get_PublicKey_blob() const;
161 const std::uint8_t* get_Name_string() const;
162 const std::uint8_t* get_Culture_string() const;
163public:
165 virtual ~SgAsmCilAssembly();
166
167public:
170
171protected:
179
180
181// End of memberFunctionString
182// Start of memberFunctionString
183/* #line 1 "/workspace/src/ROSETTA/Grammar/Common.code" */
184
185// *** COMMON CODE SECTION BEGINS HERE ***
186
187 public:
188
189 // DQ (3/25/3006): I put this back in because it had the logic for where the copy function required
190 // and not required which is required to match the other aspects of the copy mechanism code generation.
191 // Specifically it is a problem to declare the copy function everywhere because it is not implemented
192 // for the SgSymbol IR nodes. I'm not clear why it is not implemented for these IR nodes.
193 /* \brief Copies AST (whole subtree, depending on the SgCopyHelp class */
194 // virtual SgNode* copy ( const SgCopyHelp & help) const;
195
197 virtual std::string class_name() const override;
198
200 virtual VariantT variantT() const override; // MS: new variant used in tree traversal
201
203 // King84 (2010.08.16): Moved this to an enum to save space, since it's only used at compiler-time anyway.
204 // static const VariantT static_variant = V_SgAsmCilAssembly;
205 enum { static_variant = V_SgAsmCilAssembly };
206
207 /* the generated cast function */
209 ROSE_DLL_API friend SgAsmCilAssembly* isSgAsmCilAssembly( SgNode * s );
210
212 ROSE_DLL_API friend const SgAsmCilAssembly* isSgAsmCilAssembly( const SgNode * s );
213
214 // ******************************************
215 // * Memory Pool / New / Delete
216 // ******************************************
217
218 public:
220 static const unsigned pool_size; //
222 static std::vector<unsigned char *> pools; //
224 static SgAsmCilAssembly * next_node; //
225
227 static unsigned long initializeStorageClassArray(SgAsmCilAssemblyStorageClass *); //
228
230 static void clearMemoryPool(); //
231 static void deleteMemoryPool(); //
232
234 static void extendMemoryPoolForFileIO(); //
235
237 static SgAsmCilAssembly * getPointerFromGlobalIndex(unsigned long); //
239 static SgAsmCilAssembly * getPointerFromGlobalIndex(AstSpecificDataManagingClass *, unsigned long); //
240
242 static unsigned long getNumberOfValidNodesAndSetGlobalIndexInFreepointer(unsigned long); //
244 static void resetValidFreepointers(); //
246 static unsigned long getNumberOfLastValidPointer(); //
247
248
249#if defined(INLINE_FUNCTIONS)
251 inline void *operator new (size_t size);
252#else
254 void *operator new (size_t size);
255#endif
257 void operator delete (void* pointer, size_t size);
258
259 // DQ (4/5/2007): This is not the correct operator that we want, but appears to be required to compile ROSE with ROSE.
260 void operator delete (void* pointer)
261 {
262 // This is the generated delete operator...
263 SgAsmCilAssembly::operator delete (pointer,sizeof(SgAsmCilAssembly));
264 }
265
267 static size_t numberOfNodes();
268
270 static size_t memoryUsage();
271
272 // End of scope which started in IR nodes specific code
273 /* */
274
275 /* name Internal Functions
276 \brief Internal functions ... incomplete-documentation
277
278 These functions have been made public as part of the design, but they are suggested for internal use
279 or by particularly knowledgeable users for specialized tools or applications.
280
281 \internal We could not make these private because they are required by user for special purposes. And
282 it would be unwieldy to have many of the internal classes in ROSE be explicitly defined as friends.
283
284 */
285
286 // MS: 02/12/02 container of pointers to AST successor nodes used in the traversal
287 // overridden in every class by *generated* implementation
289 virtual std::vector<SgNode*> get_traversalSuccessorContainer() override;
290 // MS: 06/28/02 container of names of variables or container indices
291 // used used in the traversal to access AST successor nodes
292 // overridden in every class by *generated* implementation
295 virtual std::vector<std::string> get_traversalSuccessorNamesContainer() override;
296
297 // GB (09/25/2007): Functions for index-based access to traversal successors; these are hopefully a lot faster
298 // than all the vector copies. The implementation for these functions is generated for each class.
300 virtual size_t get_numberOfTraversalSuccessors() override;
302 virtual SgNode *get_traversalSuccessorByIndex(size_t idx) override;
304 virtual size_t get_childIndex(SgNode *child) override;
305
306#ifndef ROSE_USE_INTERNAL_FRONTEND_DEVELOPMENT
307 // MS: 08/16/2002 method for generating RTI information
309 virtual RTIReturnType roseRTI() override;
310#endif
311 /* */
312
313
314
315 /* name Deprecated Functions
316 \brief Deprecated functions ... incomplete-documentation
317
318 These functions have been deprecated from use.
319 */
320 /* */
321
323 virtual const char* sage_class_name() const override ROSE_DEPRECATED_FUNCTION;
324
325 // JJW (10/16/2008): Changed to a single function in Node.code, and put
326 // getVariant() in #if 0 block to prevent confusing Doxygen
327#if 0
329 virtual int variant() const ROSE_DEPRECATED_FUNCTION;
331 // virtual int getVariant() const ROSE_DEPRECATED_FUNCTION;
332#endif
333 /* */
334
335
336
337
338 public:
339 /* name Traversal Support Functions
340 \brief Traversal support functions ... incomplete-documentation
341
342 These functions have been made public as part of the design, but they are suggested for internal use
343 or by particularly knowledgable users for specialized tools or applications.
344 */
345 /* */
346
347 // DQ (11/26/2005): Support for visitor pattern mechanims
348 // (inferior to ROSE traversal mechanism, experimental).
352
353 /* DXN (08/09/2010): support for the classic visitor pattern done in GoF */
355 virtual void accept (ROSE_VisitorPattern & visitor) override;
356
357 // DQ (12/26/2005): Support for traversal based on the memory pool
360 static void traverseMemoryPoolNodes(ROSE_VisitTraversal & visit);
361
365
366 // DQ (2/9/2006): Added to support traversal over single representative of each IR node
367 // This traversal helps support internal tools that call static member functions.
368 // note: this function operates on the memory pools.
371 static void visitRepresentativeNode (ROSE_VisitTraversal & visit);
372 /* */
373
374 public:
375 /* NodeId support functions */
377 static SgNode* getNodeByNodeId(VariantT variantT, size_t poolIdx, size_t itemIdx);
380 static SgAsmCilAssembly* getNodeByNodeIdInternal(size_t poolIdx, size_t itemIdx);
383 static std::string getNodeIdString(SgAsmCilAssembly* sgnode);
384 static std::string getNodeIdStringInternal(SgAsmCilAssembly* sgnode);
385
386 public:
387 /* name Memory Allocation Functions
388 \brief Memory allocations functions ... incomplete-documentation
389
390 These functions have been made public as part of the design, but they are suggested for internal use
391 or by particularly knowledgable users for specialized tools or applications.
392 */
393 /* */
394
405 virtual bool isInMemoryPool() override;
406
417 virtual void checkDataMemberPointersIfInMemoryPool() override;
418
419 // DQ (4/30/2006): Modified to be a const function.
434 virtual std::vector<std::pair<SgNode*,std::string> > returnDataMemberPointers() const override;
435
446
458 virtual long getChildIndex( SgNode* childNode ) const override;
459
460 // DQ (9/2/2015): Since this function is generated by ROSETTA, we can't define the
461 // comment here (changed to be a C style comment and not be a doxygen comment).
462 /* \brief Constructor for use by AST File I/O Mechanism
463
464 This constructor permits the IR node to be rebuilt from the contiguously arranged data in memory
465 which obtained via fast binary file I/O from disk.
466 */
467 // SgAsmCilAssembly( SgAsmCilAssemblyStorageClass& source );
468
469
470
471
472
473 // JH (10/24/2005): methods added to support the ast file IO
474 private:
475
476 /* name AST Memory Allocation Support Functions
477 \brief Memory allocations support....
478
479 These functions handle the low leve support of the memory allocation scheme which permits IR nodes to be allocated
480 in large contiguous blocks to reduce memory fragmentation, improve performance, support specialized access (AST traversals),
481 and support the AST File I/O Mechanism.
482 */
483 /* */
484
485 /* JH (10/24/2005): Two typedefs. The TestType notes the type every pointer is cast to before
486 we compare them. Since I had several problems with this, I decided to make a typdef to ensure
487 that I use the same type everywhere, if any changes are made. THe second one declares the type
488 (actually unsigned long) where teh pointer address gets converted to. On 64 bit platforms this
489 might got changed, but unfortunatly, the return types are still unsigned longs. There exists
490 a correspinding one in the AST_FILE_IO class!
491 */
492 // DQ (9/2/2015): This typedef is no longer used, we can't define the
493 // comment here (changed to be a C style comment and not be a doxygen comment).
494 /* \brief Typedef used for low level memory access.
495 */
496 // typedef unsigned char* TestType;
497
498 // DQ (9/2/2015): This typedef is no longer used, we can't define the
499 // comment here (changed to be a C style comment and not be a doxygen comment).
500 /* \brief Typedef used to hold memory addresses as values.
501 */
502 // typedef unsigned long AddressType;
503
504
505
506 // necessary, to have direct access to the p_freepointer and the private methods !
508 friend class AST_FILE_IO;
509
511 friend class SgAsmCilAssemblyStorageClass;
512
514 friend class AstSpecificDataManagingClass;
515
517 friend class AstSpecificDataManagingClassStorageClass;
518 public:
520 SgAsmCilAssembly( const SgAsmCilAssemblyStorageClass& source );
521
522 // private: // JJW hack
523 /*
524 name AST Memory Allocation Support Variables
525 Memory allocations support variables
526
527 These variables handle the low level support of the memory allocation scheme which permits IR nodes to be allocated
528 in large contiguous blocks to reduce memory fragmentation, improve performance, support specialized access (AST traversals),
529 and support the AST File I/O Mechanism.
530 */
531 /* */
532
533 public:
534
535 // DQ (11/21/2009): Added function to add new Regular Expression attributes and return pointer
536 // to current node (so that it will work cleanly with build functions to specify patterns).
537 // virtual SgNode* addRegExpAttribute();
544
545#ifndef _MSC_VER
546// Rasmussen (04/17/2019): Support for ATerms has been deprecated as it is no longer needed
547// and likely never fully implemented nor tested. Files remain in the src tree but are no
548// longer built.
549#define BUILD_ATERM_SUPPORT 0
550 #if BUILD_ATERM_SUPPORT
551 #ifdef ROSE_USE_ROSE_ATERM_SUPPORT
552 // DQ (10/4/2014): Adding ATerm support to ROSE.
562 // Rasmussen (1/7/2019): Added override to kill warning messages of overridden virtual function
563 virtual ATerm generate_ATerm() override;
564
566 virtual void generate_ATerm_Annotation(ATerm & term) override;
567 #endif
568 #endif // BUILD_ATERM_SUPPORT
569#endif
570 // These can't be virtual functions since we don't yet know what IR node to build (until we have read the aterm).
571 // virtual generate_AST(ATerm & term);
572 // virtual void read_ATerm_Annotation(ATerm & term);
573
574// *** COMMON CODE SECTION ENDS HERE ***
575
576
577// End of memberFunctionString
578// Start of memberFunctionString
579/* #line 706 "/workspace/src/ROSETTA/Grammar/Node.code" */
580
581 // the generated cast function
582 // friend ROSE_DLL_API SgAsmCilAssembly* isSgAsmCilAssembly ( SgNode* s );
583
584 typedef SgAsmCilMetadata base_node_type;
585
586
587// End of memberFunctionString
588
589
590
591
592
593
594
595
596
597
598 protected:
599// Start of memberFunctionString
600uint32_t p_HashAlgId;
601
602// End of memberFunctionString
603// Start of memberFunctionString
604uint16_t p_MajorVersion;
605
606// End of memberFunctionString
607// Start of memberFunctionString
608uint16_t p_MinorVersion;
609
610// End of memberFunctionString
611// Start of memberFunctionString
612uint16_t p_BuildNumber;
613
614// End of memberFunctionString
615// Start of memberFunctionString
616uint16_t p_RevisionNumber;
617
618// End of memberFunctionString
619// Start of memberFunctionString
620uint32_t p_Flags;
621
622// End of memberFunctionString
623// Start of memberFunctionString
624uint32_t p_PublicKey;
625
626// End of memberFunctionString
627// Start of memberFunctionString
628uint32_t p_Name;
629
630// End of memberFunctionString
631// Start of memberFunctionString
632uint32_t p_Culture;
633
634// End of memberFunctionString
635
637 friend struct Rose::Traits::generated::describe_field_t<SgAsmCilAssembly, uint32_t,&SgAsmCilAssembly::p_HashAlgId>;
638 friend struct Rose::Traits::generated::describe_field_t<SgAsmCilAssembly, uint16_t,&SgAsmCilAssembly::p_MajorVersion>;
639 friend struct Rose::Traits::generated::describe_field_t<SgAsmCilAssembly, uint16_t,&SgAsmCilAssembly::p_MinorVersion>;
640 friend struct Rose::Traits::generated::describe_field_t<SgAsmCilAssembly, uint16_t,&SgAsmCilAssembly::p_BuildNumber>;
641 friend struct Rose::Traits::generated::describe_field_t<SgAsmCilAssembly, uint16_t,&SgAsmCilAssembly::p_RevisionNumber>;
642 friend struct Rose::Traits::generated::describe_field_t<SgAsmCilAssembly, uint32_t,&SgAsmCilAssembly::p_Flags>;
643 friend struct Rose::Traits::generated::describe_field_t<SgAsmCilAssembly, uint32_t,&SgAsmCilAssembly::p_PublicKey>;
644 friend struct Rose::Traits::generated::describe_field_t<SgAsmCilAssembly, uint32_t,&SgAsmCilAssembly::p_Name>;
645 friend struct Rose::Traits::generated::describe_field_t<SgAsmCilAssembly, uint32_t,&SgAsmCilAssembly::p_Culture>;
646
647/* #line 21 "/workspace/src/ROSETTA/Grammar/grammarClassDeclarationMacros.macro" */
648
649
650 };
651#endif
652
653// postdeclarations for SgAsmCilAssembly
654
655/* #line 656 "../../../src/frontend/SageIII//SgAsmCilAssembly.h" */
656
657/* #line 27 "/workspace/src/ROSETTA/Grammar/grammarClassDeclarationMacros.macro after subst for $POSTDECLARATIONS" */
658
659/* #line 28 "/workspace/src/ROSETTA/Grammar/grammarClassDeclarationMacros.macro" */
660
661
662/* #line 663 "../../../src/frontend/SageIII//SgAsmCilAssembly.h" */
663
664#endif // ROSE_SgAsmCilAssembly_H
665
Class holding static data and functions supporting File I/O.
Definition AST_FILE_IO.h:19
Attribute containing a regex expression as a string.
CIL Assembly node (II.22.2).
Base class for CIL branch of binary analysis IR nodes.
void initializeProperties()
Initialize all properties that have explicit initial values.
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 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 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...
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
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.