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