ROSE 0.11.145.147
SgAsmCoffSymbol.h
1
2#ifndef ROSE_SgAsmCoffSymbol_H
3#define ROSE_SgAsmCoffSymbol_H
4#include <RoseFirst.h>
5#include <Cxx_GrammarDeclarations.h>
6#include <SgAsmGenericSymbol.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 SgAsmCoffSymbol
23
24/* #line 25 "../../../src/frontend/SageIII//SgAsmCoffSymbol.h" */
25/* #line 29880 "/workspace/src/ROSETTA/src/binaryInstruction.C" */
26
27#include <sageContainer.h>
28
29
30/* #line 13 "/workspace/src/ROSETTA/Grammar/grammarClassDeclarationMacros.macro after subst for $PREDECLARATIONS" */
31
32/* #line 14 "/workspace/src/ROSETTA/Grammar/grammarClassDeclarationMacros.macro" */
33
34#if !defined(DOCUMENTATION)
35// Class Definition for SgAsmCoffSymbol
36class ROSE_DLL_API SgAsmCoffSymbol : public SgAsmGenericSymbol
37 {
38 public:
39
40
41/* #line 42 "../../../src/frontend/SageIII//SgAsmCoffSymbol.h" */
42
43 virtual SgNode* copy ( SgCopyHelp& help) const override;
44// Start of memberFunctionString
45/* #line 29932 "/workspace/src/ROSETTA/src/binaryInstruction.C" */
46
47
48 //----------------------- Boost serialization for SgAsmCoffSymbol -----------------------
49#ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
50private:
51 friend class boost::serialization::access;
52
53 template<class S>
54 void serialize(S &s, const unsigned /*version*/) {
55 debugSerializationBegin("SgAsmCoffSymbol");
56 s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmGenericSymbol);
57 s & BOOST_SERIALIZATION_NVP(p_st_name);
58 s & BOOST_SERIALIZATION_NVP(p_st_name_offset);
59 s & BOOST_SERIALIZATION_NVP(p_st_section_num);
60 s & BOOST_SERIALIZATION_NVP(p_st_type);
61 s & BOOST_SERIALIZATION_NVP(p_st_storage_class);
62 s & BOOST_SERIALIZATION_NVP(p_st_num_aux_entries);
63 s & BOOST_SERIALIZATION_NVP(p_auxiliaryData);
64 debugSerializationEnd("SgAsmCoffSymbol");
65 }
66#endif // ROSE_HAVE_BOOST_SERIALIZATION_LIB
68 // Local types
70public:
71#ifdef _MSC_VER
72# pragma pack (1)
73#endif
74 struct COFFSymbol_disk {
75 union {
76 char st_name[8];
77 struct {
78 uint32_t st_zero;
79 uint32_t st_offset;
80 };
81 };
82 uint32_t st_value;
83 int16_t st_section_num;
84 uint16_t st_type;
85 unsigned char st_storage_class;
86 unsigned char st_num_aux_entries;
87 }
88// DQ (3/7/2013): Adding support to restrict visability to SWIG.
89#if !defined(SWIG) && !defined(_MSC_VER)
90 __attribute__((packed))
91#endif
92 ;
93#ifdef _MSC_VER
94# pragma pack ()
95#endif
96
98 // Properties and data members
100public:
101public:
105 std::string const& get_st_name() const;
106 void set_st_name(std::string const&);
109public:
113 rose_addr_t const& get_st_name_offset() const;
114 void set_st_name_offset(rose_addr_t const&);
117public:
121 int const& get_st_section_num() const;
122 void set_st_section_num(int const&);
125public:
129 unsigned const& get_st_type() const;
130 void set_st_type(unsigned const&);
133public:
137 unsigned const& get_st_storage_class() const;
138 void set_st_storage_class(unsigned const&);
141public:
145 unsigned const& get_st_num_aux_entries() const;
146 void set_st_num_aux_entries(unsigned const&);
149public:
153 SgUnsignedCharList const& get_auxiliaryData() const;
154 SgUnsignedCharList& get_auxiliaryData();
155 void set_auxiliaryData(SgUnsignedCharList const&);
157public:
158 static const unsigned int COFFSymbol_disk_size = 18;
159
161 // Functions
163public:
165 void *encode(SgAsmCoffSymbol::COFFSymbol_disk*) const;
166 virtual void dump(FILE *f, const char *prefix, ssize_t idx) const override;
167
169 // Deprecated
171public:
172 const SgUnsignedCharList& get_aux_data() const ROSE_DEPRECATED("use get_auxiliaryData");
173 void set_aux_data(const SgUnsignedCharList&) ROSE_DEPRECATED("use set_auxiliaryData");
174public:
176 virtual ~SgAsmCoffSymbol();
177
178public:
181
182protected:
189 void initializeProperties();
190
191
192// End of memberFunctionString
193// Start of memberFunctionString
194/* #line 1 "/workspace/src/ROSETTA/Grammar/Common.code" */
195
196// *** COMMON CODE SECTION BEGINS HERE ***
197
198 public:
199
200 // DQ (3/25/3006): I put this back in because it had the logic for where the copy function required
201 // and not required which is required to match the other aspects of the copy mechanism code generation.
202 // Specifically it is a problem to declare the copy function everywhere because it is not implemented
203 // for the SgSymbol IR nodes. I'm not clear why it is not implemented for these IR nodes.
204 /* \brief Copies AST (whole subtree, depending on the SgCopyHelp class */
205 // virtual SgNode* copy ( const SgCopyHelp & help) const;
206
208 virtual std::string class_name() const override;
209
211 virtual VariantT variantT() const override; // MS: new variant used in tree traversal
212
214 // King84 (2010.08.16): Moved this to an enum to save space, since it's only used at compiler-time anyway.
215 // static const VariantT static_variant = V_SgAsmCoffSymbol;
216 enum { static_variant = V_SgAsmCoffSymbol };
217
218 /* the generated cast function */
220 ROSE_DLL_API friend SgAsmCoffSymbol* isSgAsmCoffSymbol( SgNode * s );
221
223 ROSE_DLL_API friend const SgAsmCoffSymbol* isSgAsmCoffSymbol( const SgNode * s );
224
225 // ******************************************
226 // * Memory Pool / New / Delete
227 // ******************************************
228
229 public:
231 static const unsigned pool_size; //
233 static std::vector<unsigned char *> pools; //
235 static SgAsmCoffSymbol * next_node; //
236
238 static unsigned long initializeStorageClassArray(SgAsmCoffSymbolStorageClass *); //
239
241 static void clearMemoryPool(); //
242 static void deleteMemoryPool(); //
243
245 static void extendMemoryPoolForFileIO(); //
246
248 static SgAsmCoffSymbol * getPointerFromGlobalIndex(unsigned long); //
250 static SgAsmCoffSymbol * getPointerFromGlobalIndex(AstSpecificDataManagingClass *, unsigned long); //
251
253 static unsigned long getNumberOfValidNodesAndSetGlobalIndexInFreepointer(unsigned long); //
255 static void resetValidFreepointers(); //
257 static unsigned long getNumberOfLastValidPointer(); //
258
259
260#if defined(INLINE_FUNCTIONS)
262 inline void *operator new (size_t size);
263#else
265 void *operator new (size_t size);
266#endif
268 void operator delete (void* pointer, size_t size);
269
270 // DQ (4/5/2007): This is not the correct operator that we want, but appears to be required to compile ROSE with ROSE.
271 void operator delete (void* pointer)
272 {
273 // This is the generated delete operator...
274 SgAsmCoffSymbol::operator delete (pointer,sizeof(SgAsmCoffSymbol));
275 }
276
278 static size_t numberOfNodes();
279
281 static size_t memoryUsage();
282
283 // End of scope which started in IR nodes specific code
284 /* */
285
286 /* name Internal Functions
287 \brief Internal functions ... incomplete-documentation
288
289 These functions have been made public as part of the design, but they are suggested for internal use
290 or by particularly knowledgeable users for specialized tools or applications.
291
292 \internal We could not make these private because they are required by user for special purposes. And
293 it would be unwieldy to have many of the internal classes in ROSE be explicitly defined as friends.
294
295 */
296
297 // MS: 02/12/02 container of pointers to AST successor nodes used in the traversal
298 // overridden in every class by *generated* implementation
300 virtual std::vector<SgNode*> get_traversalSuccessorContainer() override;
301 // MS: 06/28/02 container of names of variables or container indices
302 // used used in the traversal to access AST successor nodes
303 // overridden in every class by *generated* implementation
306 virtual std::vector<std::string> get_traversalSuccessorNamesContainer() override;
307
308 // GB (09/25/2007): Functions for index-based access to traversal successors; these are hopefully a lot faster
309 // than all the vector copies. The implementation for these functions is generated for each class.
311 virtual size_t get_numberOfTraversalSuccessors() override;
313 virtual SgNode *get_traversalSuccessorByIndex(size_t idx) override;
315 virtual size_t get_childIndex(SgNode *child) override;
316
317#ifndef ROSE_USE_INTERNAL_FRONTEND_DEVELOPMENT
318 // MS: 08/16/2002 method for generating RTI information
320 virtual RTIReturnType roseRTI() override;
321#endif
322 /* */
323
324
325
326 /* name Deprecated Functions
327 \brief Deprecated functions ... incomplete-documentation
328
329 These functions have been deprecated from use.
330 */
331 /* */
332
334 virtual const char* sage_class_name() const override ROSE_DEPRECATED_FUNCTION;
335
336 // JJW (10/16/2008): Changed to a single function in Node.code, and put
337 // getVariant() in #if 0 block to prevent confusing Doxygen
338#if 0
340 virtual int variant() const ROSE_DEPRECATED_FUNCTION;
342 // virtual int getVariant() const ROSE_DEPRECATED_FUNCTION;
343#endif
344 /* */
345
346
347
348
349 public:
350 /* name Traversal Support Functions
351 \brief Traversal support functions ... incomplete-documentation
352
353 These functions have been made public as part of the design, but they are suggested for internal use
354 or by particularly knowledgable users for specialized tools or applications.
355 */
356 /* */
357
358 // DQ (11/26/2005): Support for visitor pattern mechanims
359 // (inferior to ROSE traversal mechanism, experimental).
363
364 /* DXN (08/09/2010): support for the classic visitor pattern done in GoF */
366 virtual void accept (ROSE_VisitorPattern & visitor) override;
367
368 // DQ (12/26/2005): Support for traversal based on the memory pool
371 static void traverseMemoryPoolNodes(ROSE_VisitTraversal & visit);
372
376
377 // DQ (2/9/2006): Added to support traversal over single representative of each IR node
378 // This traversal helps support internal tools that call static member functions.
379 // note: this function operates on the memory pools.
382 static void visitRepresentativeNode (ROSE_VisitTraversal & visit);
383 /* */
384
385 public:
386 /* NodeId support functions */
388 static SgNode* getNodeByNodeId(VariantT variantT, size_t poolIdx, size_t itemIdx);
391 static SgAsmCoffSymbol* getNodeByNodeIdInternal(size_t poolIdx, size_t itemIdx);
394 static std::string getNodeIdString(SgAsmCoffSymbol* sgnode);
395 static std::string getNodeIdStringInternal(SgAsmCoffSymbol* sgnode);
396
397 public:
398 /* name Memory Allocation Functions
399 \brief Memory allocations functions ... incomplete-documentation
400
401 These functions have been made public as part of the design, but they are suggested for internal use
402 or by particularly knowledgable users for specialized tools or applications.
403 */
404 /* */
405
416 virtual bool isInMemoryPool() override;
417
428 virtual void checkDataMemberPointersIfInMemoryPool() override;
429
430 // DQ (4/30/2006): Modified to be a const function.
445 virtual std::vector<std::pair<SgNode*,std::string> > returnDataMemberPointers() const override;
446
457
469 virtual long getChildIndex( SgNode* childNode ) const override;
470
471 // DQ (9/2/2015): Since this function is generated by ROSETTA, we can't define the
472 // comment here (changed to be a C style comment and not be a doxygen comment).
473 /* \brief Constructor for use by AST File I/O Mechanism
474
475 This constructor permits the IR node to be rebuilt from the contiguously arranged data in memory
476 which obtained via fast binary file I/O from disk.
477 */
478 // SgAsmCoffSymbol( SgAsmCoffSymbolStorageClass& source );
479
480
481
482
483
484 // JH (10/24/2005): methods added to support the ast file IO
485 private:
486
487 /* name AST Memory Allocation Support Functions
488 \brief Memory allocations support....
489
490 These functions handle the low leve support of the memory allocation scheme which permits IR nodes to be allocated
491 in large contiguous blocks to reduce memory fragmentation, improve performance, support specialized access (AST traversals),
492 and support the AST File I/O Mechanism.
493 */
494 /* */
495
496 /* JH (10/24/2005): Two typedefs. The TestType notes the type every pointer is cast to before
497 we compare them. Since I had several problems with this, I decided to make a typdef to ensure
498 that I use the same type everywhere, if any changes are made. THe second one declares the type
499 (actually unsigned long) where teh pointer address gets converted to. On 64 bit platforms this
500 might got changed, but unfortunatly, the return types are still unsigned longs. There exists
501 a correspinding one in the AST_FILE_IO class!
502 */
503 // DQ (9/2/2015): This typedef is no longer used, we can't define the
504 // comment here (changed to be a C style comment and not be a doxygen comment).
505 /* \brief Typedef used for low level memory access.
506 */
507 // typedef unsigned char* TestType;
508
509 // DQ (9/2/2015): This typedef is no longer used, we can't define the
510 // comment here (changed to be a C style comment and not be a doxygen comment).
511 /* \brief Typedef used to hold memory addresses as values.
512 */
513 // typedef unsigned long AddressType;
514
515
516
517 // necessary, to have direct access to the p_freepointer and the private methods !
519 friend class AST_FILE_IO;
520
522 friend class SgAsmCoffSymbolStorageClass;
523
525 friend class AstSpecificDataManagingClass;
526
528 friend class AstSpecificDataManagingClassStorageClass;
529 public:
531 SgAsmCoffSymbol( const SgAsmCoffSymbolStorageClass& source );
532
533 // private: // JJW hack
534 /*
535 name AST Memory Allocation Support Variables
536 Memory allocations support variables
537
538 These variables handle the low level support of the memory allocation scheme which permits IR nodes to be allocated
539 in large contiguous blocks to reduce memory fragmentation, improve performance, support specialized access (AST traversals),
540 and support the AST File I/O Mechanism.
541 */
542 /* */
543
544 public:
545
546 // DQ (11/21/2009): Added function to add new Regular Expression attributes and return pointer
547 // to current node (so that it will work cleanly with build functions to specify patterns).
548 // virtual SgNode* addRegExpAttribute();
555
556#ifndef _MSC_VER
557// Rasmussen (04/17/2019): Support for ATerms has been deprecated as it is no longer needed
558// and likely never fully implemented nor tested. Files remain in the src tree but are no
559// longer built.
560#define BUILD_ATERM_SUPPORT 0
561 #if BUILD_ATERM_SUPPORT
562 #ifdef ROSE_USE_ROSE_ATERM_SUPPORT
563 // DQ (10/4/2014): Adding ATerm support to ROSE.
573 // Rasmussen (1/7/2019): Added override to kill warning messages of overridden virtual function
574 virtual ATerm generate_ATerm() override;
575
577 virtual void generate_ATerm_Annotation(ATerm & term) override;
578 #endif
579 #endif // BUILD_ATERM_SUPPORT
580#endif
581 // These can't be virtual functions since we don't yet know what IR node to build (until we have read the aterm).
582 // virtual generate_AST(ATerm & term);
583 // virtual void read_ATerm_Annotation(ATerm & term);
584
585// *** COMMON CODE SECTION ENDS HERE ***
586
587
588// End of memberFunctionString
589// Start of memberFunctionString
590/* #line 706 "/workspace/src/ROSETTA/Grammar/Node.code" */
591
592 // the generated cast function
593 // friend ROSE_DLL_API SgAsmCoffSymbol* isSgAsmCoffSymbol ( SgNode* s );
594
595 typedef SgAsmGenericSymbol base_node_type;
596
597
598// End of memberFunctionString
599
600
601
602
603
604
605
606
607 protected:
608// Start of memberFunctionString
609std::string p_st_name;
610
611// End of memberFunctionString
612// Start of memberFunctionString
613rose_addr_t p_st_name_offset;
614
615// End of memberFunctionString
616// Start of memberFunctionString
617int p_st_section_num;
618
619// End of memberFunctionString
620// Start of memberFunctionString
621unsigned p_st_type;
622
623// End of memberFunctionString
624// Start of memberFunctionString
625unsigned p_st_storage_class;
626
627// End of memberFunctionString
628// Start of memberFunctionString
629unsigned p_st_num_aux_entries;
630
631// End of memberFunctionString
632// Start of memberFunctionString
633SgUnsignedCharList p_auxiliaryData;
634
635// End of memberFunctionString
636
638 friend struct Rose::Traits::generated::describe_field_t<SgAsmCoffSymbol, std::string,&SgAsmCoffSymbol::p_st_name>;
639 friend struct Rose::Traits::generated::describe_field_t<SgAsmCoffSymbol, rose_addr_t,&SgAsmCoffSymbol::p_st_name_offset>;
640 friend struct Rose::Traits::generated::describe_field_t<SgAsmCoffSymbol, int,&SgAsmCoffSymbol::p_st_section_num>;
641 friend struct Rose::Traits::generated::describe_field_t<SgAsmCoffSymbol, unsigned,&SgAsmCoffSymbol::p_st_type>;
642 friend struct Rose::Traits::generated::describe_field_t<SgAsmCoffSymbol, unsigned,&SgAsmCoffSymbol::p_st_storage_class>;
643 friend struct Rose::Traits::generated::describe_field_t<SgAsmCoffSymbol, unsigned,&SgAsmCoffSymbol::p_st_num_aux_entries>;
644 friend struct Rose::Traits::generated::describe_field_t<SgAsmCoffSymbol, SgUnsignedCharList,&SgAsmCoffSymbol::p_auxiliaryData>;
645
646/* #line 21 "/workspace/src/ROSETTA/Grammar/grammarClassDeclarationMacros.macro" */
647
648
649 };
650#endif
651
652// postdeclarations for SgAsmCoffSymbol
653
654/* #line 655 "../../../src/frontend/SageIII//SgAsmCoffSymbol.h" */
655
656/* #line 27 "/workspace/src/ROSETTA/Grammar/grammarClassDeclarationMacros.macro after subst for $POSTDECLARATIONS" */
657
658/* #line 28 "/workspace/src/ROSETTA/Grammar/grammarClassDeclarationMacros.macro" */
659
660
661/* #line 662 "../../../src/frontend/SageIII//SgAsmCoffSymbol.h" */
662
663#endif // ROSE_SgAsmCoffSymbol_H
664
Class holding static data and functions supporting File I/O.
Definition AST_FILE_IO.h:19
Attribute containing a regex expression as a string.
Contiguous region of a file.
virtual void dump(FILE *, const char *prefix, ssize_t idx) const
Print some debugging info.
Windows PE file header.
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 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.