ROSE  0.11.109.0
binaryInstruction.C
1 #include <featureTests.h>
2 #ifdef ROSE_ENABLE_BINARY_ANALYSIS
3 
4 /******************************************************************************************************************************
5  * NOTE: For any given IR class, please keep all its parts as close together as possible. Its bad enough that we're
6  * defining classes in a non-C-like language -- and it's painful when a definition is scattered all over this file. We
7  * already have four places to look to get the definition of an IR class:
8  * (1) here, in this source file, built with ROSETTA functions
9  * (2) additional declarations between HEADER_* markers in ../Grammar/BinaryInstruction.code (which we can't
10  * even parse as a C++ file, making IDEs useless there).
11  * (3) function definitions between SOURCE_* markers in ../Grammar/BinaryInstruction.code, which for some
12  * reason are not next to the corresponding HEADER_ markers. Please migrate these definitions to *.C files
13  * whenever you have an opportunity, so that IDEs can see the definitions.
14  * (4) Doxygen documentation in ../../../docs/testDoxygen directory since doxygen can't parse the IR classes
15  * from this source file. Documented entities are marked with a "DOXYGEN" comment here to make it more
16  * obvious when documentation is present.
17  *
18  * NOTE: First part of the file is for classes describing instructions. Middle part is for classes describing binary
19  * containers (organized by container type: ELF, DOS, PE, ...) Last part is the base classes. Unlike C++, the classes
20  * defined in this file need to be defined from the most specific (derived classes) to the most general (base class).
21  *
22  * NOTE: Please use three blank lines between IR node definitions to help make this file more readable. Unless those IR
23  * nodes are so closely related to one another that it's better to keep them close.
24  *
25  * UPDATE: Instead of splitting class declarations into five separate places, we can now use the macros defined below to
26  * put everything but the node name into one place in this file. The node name still needs a line in the
27  * "astNodeList" file. My goal is to eventually remove the src/ROSETTA/Grammar/BinaryInstruction.code file and
28  * the related docs/testDoxygen/xxx.docs files and to add documentation here for all property accessors.
29  *
30  * ROSETTA FAILURE MODES:
31  *
32  * + If you get thousands of compile errors in Cxx_Grammar.h that seem to have absolutely nothing to do with the node
33  * you just added, then double check that the new node type is listed as the descendant of some other node type in a
34  * NEW_NONTERMINAL_MACRO macro expansion.
35  *
36  * + If CxxGrammarMetaProgram uses gigabytes and gigabytes of memory and never terminates then check that all the new
37  * IR node types have a correctly spelled entry in the astNodeList file.
38  *-----------------------------------------------------------------------------------------------------------------------------*/
39 
40 #include "ROSETTA_macros.h"
41 #include "grammar.h"
42 #include "AstNodeClass.h"
43 
44 // The following macros try to make it possile to keep all aspects of a Sage node's declaration in this one file. The old way
45 // of doing things required the class declarations to be split into four places:
46 // (1) The #include files necessary to declare the class were at the top of a src/ROSETTA/Grammar/*.code file
47 // (2) The class declaration and properties were built in src/ROSETTA/src/*.C
48 // (3) The documentation for the class and its properties were in docs/testDoxygen/*.docs files
49 // (4) Additional non-ROSETTA members were in src/ROSETTA/Grammar/*.code files
50 // Implementations were originally also in the src/ROSETTA/Grammar/*.code files but have since been moved to *.C files. The
51 // problem with *.code files is no IDE understands them.
52 //
53 // The following macros take a CLASS_WITHOUT_Sg parameter, which is the name of the Sage node class but without the leading
54 // "Sg". I'm not sure why ROSETTA was written this way. For instance, use "AsmInstruction" instead of "SgAsmInstruction". Most
55 // other things will use the full class name.
56 //
57 // The macros are:
58 // DOCUMENTATION is never defined when compiling, but will be defined when generating documentation and can be used to help
59 // IDE's figure out the indentation and as commentary. We don't use "#if 0" because some IDEs figure out that the code is
60 // never possible and don't indent it properly. For instance, most of the classes are defined like this:
61 // #ifdef DOCUMENTATION
62 // class SgAsmAarch64Instruction: public SgAsmInstruction {
63 // #endif
64 //
65 // ...
66 //
67 // #ifdef DOCUMENTATION
68 // };
69 // #endif
70 //
71 //
72 // DECLARE_LEAF_CLASS is the simpler way to declare a Sage class that has no subclasses. This must be the first macro
73 // invoked when starting a new class declaration. Example, to declare the SgMyClass node, say:
74 // DECLARE_LEAF_CLASS(MyClass);
75 // #ifdef DOCUMENTATION
76 // class SgMyClass: public ...base-classes... {
77 // #endif
78 //
79 //
80 // DECLARE_HEADERS is used to indicate what header files need to be included. Note that due to limitations of ROSETTA
81 // (specifically, not having any portable regular expression library due to prohibition against using boost), the #ifdef and
82 // #endif lines must be *exactly* as written here -- they are sensitive to white space.
83 // DECLARE_HEADERS(MyClass);
84 // #if defined(SgMyClass_HEADERS) || defined(DOCUMENTATION)
85 // #include <someHeader>
86 // #endif // SgMyClass_HEADERS
87 //
88 //
89 // DECLARE_OTHERS is for declaring other class members that don't need to be processed by ROSETTA. Due to limitations of
90 // ROSETTA (specifically, not having any portable regular expression library due to prohibition against using boost), the
91 // #ifdef and #endif lines must be *exactly* as written here -- they are sensitive to white space.
92 // DECLARE_OTHERS(MyClass);
93 // #if defined(SgMyClass_OTHERS) || defined(DOCUMENTATION)
94 // // other declarations here
95 // #endif // SgMyClass_OTHERS
96 
97 //#undef DOCUMENTATION -- commented out so IDEs can't figure it out
98 #ifdef DOCUMENTATION
99 DOCUMENTATION_should_never_be_defined;
100 #endif
101 
102 #ifdef DOCUMENTATION
103 #define DECLARE_LEAF_CLASS(CLASS_WITHOUT_Sg) /*void*/
104 #else
105 #define DECLARE_LEAF_CLASS(CLASS_WITHOUT_Sg) \
106  NEW_TERMINAL_MACRO(CLASS_WITHOUT_Sg, #CLASS_WITHOUT_Sg, #CLASS_WITHOUT_Sg "Tag"); \
107  CLASS_WITHOUT_Sg.setCppCondition("!defined(DOCUMENTATION)")
108 #endif
109 
110 #ifdef DOCUMENTATION
111 #define DECLARE_HEADERS(CLASS_WITHOUT_Sg) /*void*/
112 #else
113 #define DECLARE_HEADERS(CLASS_WITHOUT_Sg) \
114  CLASS_WITHOUT_Sg.setPredeclarationString("Sg" #CLASS_WITHOUT_Sg "_HEADERS", \
115  ROSE_AUTOMAKE_ABSOLUTE_PATH_TOP_SRCDIR + "/src/ROSETTA/src/binaryInstruction.C")
116 #endif
117 
118 #ifdef DOCUMENTATION
119 #define DECLARE_OTHERS(CLASS_WITHOUT_Sg) /*void*/
120 #else
121 #define DECLARE_OTHERS(CLASS_WITHOUT_Sg) \
122  CLASS_WITHOUT_Sg.setFunctionPrototype("Sg" #CLASS_WITHOUT_Sg "_OTHERS", \
123  ROSE_AUTOMAKE_ABSOLUTE_PATH_TOP_SRCDIR + "/src/ROSETTA/src/binaryInstruction.C")
124 #endif
125 
126 #ifdef DOCUMENTATION
127 #define IS_SERIALIZABLE() /*void*/
128 #else
129 #define IS_SERIALIZABLE(CLASS_WITHOUT_Sg) \
130  CLASS_WITHOUT_Sg.isBoostSerializable(true)
131 #endif
132 
133 // Since ROSETTA builds classes from the leaves up to the base, and C++ builds classes from the base down to the leaves, we
134 // need to make sure that doxygen sees the base classes before the derived classes. So just list all the non-leaf classes here.
135 #ifdef DOCUMENTATION
138 class SgAsmDwarfConstruct;
140 class SgAsmElfSection;
142 class SgAsmExpression;
143 class SgAsmGenericHeader;
144 class SgAsmGenericSection;
145 class SgAsmGenericString;
146 class SgAsmGenericStrtab;
147 class SgAsmGenericSymbol;
148 class SgAsmInstruction;
149 class SgAsmNode;
150 class SgAsmPESection;
152 class SgAsmScalarType;
153 class SgAsmStatement;
154 class AsmSynthesizedFieldDeclaration;
155 class SgAsmType;
158 class SgNode;
159 #endif
160 
161 #ifndef DOCUMENTATION
162 void Grammar::setUpBinaryInstructions() {
163 #endif
164 
166 
167  /**************************************************************************************************************************
168  * Instructions.
169  * Base class (SgAsmInstruction) and various subclasses, one per architecture.
170  **************************************************************************************************************************/
171 
173 
174 #ifdef ROSE_ENABLE_ASM_AARCH32
175  DECLARE_LEAF_CLASS(AsmAarch32Instruction);
176  IS_SERIALIZABLE(AsmAarch32Instruction);
177 
178  DECLARE_HEADERS(AsmAarch32Instruction);
179 #if defined(SgAsmAarch32Instruction_HEADERS) || defined(DOCUMENTATION)
180  #include <Rose/BinaryAnalysis/InstructionEnumsAarch32.h>
181 #endif // SgAsmAarch32Instruction_HEADERS
182 
183 #ifdef DOCUMENTATION
184 
185  class SgAsmAarch32Instruction: public SgAsmInstruction {
186  public:
187 #endif
188 
189 #ifdef DOCUMENTATION
190 
196  Rose::BinaryAnalysis::AArch32InstructionKind get_kind() const;
197  void set_kind(Rose::BinaryAnalysis::Aarch32InstructionKind);
199 #else
200  AsmAarch32Instruction.setDataPrototype("Rose::BinaryAnalysis::Aarch32InstructionKind", "kind",
201  "= Rose::BinaryAnalysis::Aarch32InstructionKind::ARM_INS_INVALID",
202  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
203 #endif
204 
205 #ifdef DOCUMENTATION
206 
211  Rose::BinaryAnalysis::Aarch32InstructionCondition get_condition() const;
212  void set_condition(Rose::BinaryAnalysis::Aarch32InstructionCondition);
214 #else
215  AsmAarch32Instruction.setDataPrototype("Rose::BinaryAnalysis::Aarch32InstructionCondition", "condition",
216  "= Rose::BinaryAnalysis::Aarch32InstructionCondition::ARM_CC_INVALID",
217  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
218 #endif
219 
220 #ifdef DOCUMENTATION
221 
224  bool get_updatesFlags() const;
225  void set_updatesFlags(bool);
227 #else
228  AsmAarch32Instruction.setDataPrototype("bool", "updatesFlags", "= false",
229  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
230 #endif
231 
232 #ifdef DOCUMENTATION
233 
236  bool get_writesBack() const;
237  void set_writesBack(bool);
239 #else
240  AsmAarch32Instruction.setDataPrototype("bool", "writesBack", "= false",
241  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
242 #endif
243 
244 #ifdef DOCUMENTATION
245 
251  bool get_writesToIp() const;
252  void set_writesToIp(bool);
254 #else
255  AsmAarch32Instruction.setDataPrototype("bool", "writesToIp", "= false",
256  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
257 #endif
258 
259  DECLARE_OTHERS(AsmAarch32Instruction);
260 #if defined(SgAsmAarch32Instruction_OTHERS) || defined(DOCUMENTATION)
261 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
262  private:
263  friend class boost::serialization::access;
264 
265  template<class S>
266  void serialize(S &s, const unsigned /*version*/) {
267  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmInstruction);
268  s & BOOST_SERIALIZATION_NVP(p_kind);
269  s & BOOST_SERIALIZATION_NVP(p_condition);
270  s & BOOST_SERIALIZATION_NVP(p_updatesFlags);
271  s & BOOST_SERIALIZATION_NVP(p_writesBack);
272  }
273 #endif
274 
275  public:
276  // Overrides are documented in the base class
277  virtual std::string description() const override;
278  virtual bool terminatesBasicBlock() override;
279  virtual Rose::BinaryAnalysis::AddressSet getSuccessors(bool &complete) override;
280  virtual bool isUnknown() const override;
281  virtual unsigned get_anyKind() const override;
282  virtual bool isFunctionCallFast(const std::vector<SgAsmInstruction*>&, rose_addr_t *target,
283  rose_addr_t *return_va) override;
284  virtual bool isFunctionCallSlow(const std::vector<SgAsmInstruction*>&, rose_addr_t *target,
285  rose_addr_t *return_va) override;
286  virtual bool isFunctionReturnFast(const std::vector<SgAsmInstruction*>&) override;
287  virtual bool isFunctionReturnSlow(const std::vector<SgAsmInstruction*>&) override;
288  virtual Sawyer::Optional<rose_addr_t> branchTarget() override;
289 
290 #endif // SgAsmAarch32Instruction_OTHERS
291 #ifdef DOCUMENTATION
292  };
293 #endif
294 #endif
295 
297 
298 #ifdef ROSE_ENABLE_ASM_AARCH64
299  DECLARE_LEAF_CLASS(AsmAarch64Instruction);
300  IS_SERIALIZABLE(AsmAarch64Instruction);
301 
302  DECLARE_HEADERS(AsmAarch64Instruction);
303 #if defined(SgAsmAarch64Instruction_HEADERS) || defined(DOCUMENTATION)
304  #include <Rose/BinaryAnalysis/InstructionEnumsAarch64.h>
305 #endif // SgAsmAarch64Instruction_HEADERS
306 
307 #ifdef DOCUMENTATION
308 
309  class SgAsmAarch64Instruction: public SgAsmInstruction {
310  public:
311 #endif
312 
313 #ifdef DOCUMENTATION
314 
320  Rose::BinaryAnalysis::Aarch64InstructionKind get_kind() const;
321  void set_kind(Rose::BinaryAnalysis::Aarch64InstructionKind);
323 #else
324  AsmAarch64Instruction.setDataPrototype("Rose::BinaryAnalysis::Aarch64InstructionKind", "kind",
325  "= Rose::BinaryAnalysis::Aarch64InstructionKind::ARM64_INS_INVALID",
326  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
327 #endif
328 
329 #ifdef DOCUMENTATION
330 
333  Rose::BinaryAnalysis::Aarch64InstructionCondition get_condition() const;
334  void set_condition(Rose::BinaryAnalysis::Aarch64InstructionCondition);
336 #else
337  AsmAarch64Instruction.setDataPrototype("Rose::BinaryAnalysis::Aarch64InstructionCondition", "condition",
338  "= Rose::BinaryAnalysis::Aarch64InstructionCondition::ARM64_CC_INVALID",
339  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
340 #endif
341 
342 #ifdef DOCUMENTATION
343 
346  bool get_updatesFlags() const;
347  void set_updatesFlags(bool);
349 #else
350  AsmAarch64Instruction.setDataPrototype("bool", "updatesFlags", "= false",
351  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
352 #endif
353 
354  DECLARE_OTHERS(AsmAarch64Instruction);
355 #if defined(SgAsmAarch64Instruction_OTHERS) || defined(DOCUMENTATION)
356 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
357  private:
358  friend class boost::serialization::access;
359 
360  template<class S>
361  void serialize(S &s, const unsigned /*version*/) {
362  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmInstruction);
363  s & BOOST_SERIALIZATION_NVP(p_kind);
364  s & BOOST_SERIALIZATION_NVP(p_condition);
365  }
366 #endif
367 
368  public:
369  // Overrides are documented in the base class
370  virtual std::string description() const override;
371  virtual bool terminatesBasicBlock() override;
372  virtual Rose::BinaryAnalysis::AddressSet getSuccessors(bool &complete) override;
373  virtual bool isUnknown() const override;
374  virtual unsigned get_anyKind() const override;
375  virtual bool isFunctionCallFast(const std::vector<SgAsmInstruction*>&, rose_addr_t *target,
376  rose_addr_t *return_va) override;
377  virtual bool isFunctionCallSlow(const std::vector<SgAsmInstruction*>&, rose_addr_t *target,
378  rose_addr_t *return_va) override;
379  virtual bool isFunctionReturnFast(const std::vector<SgAsmInstruction*>&) override;
380  virtual bool isFunctionReturnSlow(const std::vector<SgAsmInstruction*>&) override;
381  virtual Sawyer::Optional<rose_addr_t> branchTarget() override;
382 
383 #endif // SgAsmAarch64Instruction_OTHERS
384 #ifdef DOCUMENTATION
385  };
386 #endif
387 #endif
388 
390 
391  DECLARE_LEAF_CLASS(AsmX86Instruction);
392  IS_SERIALIZABLE(AsmX86Instruction);
393  DECLARE_HEADERS(AsmX86Instruction);
394 #if defined(SgAsmX86Instruction_HEADERS) || defined(DOCUMENTATION)
395  #include <Rose/BinaryAnalysis/BasicTypes.h>
396  #include <Rose/BinaryAnalysis/InstructionEnumsX86.h>
397 #endif // SgAsmX86Instruction_HEADERS
398 
399 #ifdef DOCUMENTATION
400 
402  public:
403 #endif
404 
405 #ifdef DOCUMENTATION
406 
415 #else
416  AsmX86Instruction.setDataPrototype("Rose::BinaryAnalysis::X86InstructionKind", "kind",
417  "= Rose::BinaryAnalysis::x86_unknown_instruction",
418  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
419 #endif
420 
421 #ifdef DOCUMENTATION
422 
428 #else
429  AsmX86Instruction.setDataPrototype("Rose::BinaryAnalysis::X86InstructionSize", "baseSize",
430  "= Rose::BinaryAnalysis::x86_insnsize_none",
431  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
432 #endif
433 
434 #ifdef DOCUMENTATION
435 
441 #else
442  AsmX86Instruction.setDataPrototype("Rose::BinaryAnalysis::X86InstructionSize", "operandSize",
443  "= Rose::BinaryAnalysis::x86_insnsize_none",
444  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
445 #endif
446 
447 #ifdef DOCUMENTATION
448 
454 #else
455  AsmX86Instruction.setDataPrototype("Rose::BinaryAnalysis::X86InstructionSize", "addressSize",
456  "= Rose::BinaryAnalysis::x86_insnsize_none",
457  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
458 #endif
459 
460 #ifdef DOCUMENTATION
461 
466  bool get_lockPrefix() const;
467  void set_lockPrefix(bool);
469 #else
470  AsmX86Instruction.setDataPrototype("bool", "lockPrefix", "= false",
471  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
472 #endif
473 
474 #ifdef DOCUMENTATION
475 
481 #else
482  AsmX86Instruction.setDataPrototype("Rose::BinaryAnalysis::X86RepeatPrefix", "repeatPrefix",
483  "= Rose::BinaryAnalysis::x86_repeat_none",
484  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
485 #endif
486 
487 #ifdef DOCUMENTATION
488 
494 #else
495  AsmX86Instruction.setDataPrototype("Rose::BinaryAnalysis::X86BranchPrediction", "branchPrediction",
496  "= Rose::BinaryAnalysis::x86_branch_prediction_none",
497  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
498 #endif
499 
500 #ifdef DOCUMENTATION
501 
510 #else
511  AsmX86Instruction.setDataPrototype("Rose::BinaryAnalysis::X86SegmentRegister", "segmentOverride",
512  "= Rose::BinaryAnalysis::x86_segreg_none",
513  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
514 #endif
515 
516 
517  DECLARE_OTHERS(AsmX86Instruction);
518 #if defined(SgAsmX86Instruction_OTHERS) || defined(DOCUMENTATION)
519 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
520  private:
521  friend class boost::serialization::access;
522 
523  template<class S>
524  void serialize(S &s, const unsigned /*version*/) {
525  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmInstruction);
526  s & BOOST_SERIALIZATION_NVP(p_kind);
527  s & BOOST_SERIALIZATION_NVP(p_baseSize);
528  s & BOOST_SERIALIZATION_NVP(p_operandSize);
529  s & BOOST_SERIALIZATION_NVP(p_addressSize);
530  s & BOOST_SERIALIZATION_NVP(p_lockPrefix);
531  s & BOOST_SERIALIZATION_NVP(p_repeatPrefix);
532  s & BOOST_SERIALIZATION_NVP(p_branchPrediction);
533  s & BOOST_SERIALIZATION_NVP(p_segmentOverride);
534  }
535 #endif
536 
537  public:
542 
547 
553 
559 
560  // Overrides are documented in the base class
561  virtual bool terminatesBasicBlock() override;
562  virtual bool isFunctionCallFast(const std::vector<SgAsmInstruction*>&,
563  rose_addr_t *target, rose_addr_t *ret) override;
564  virtual bool isFunctionCallSlow(const std::vector<SgAsmInstruction*>&,
565  rose_addr_t *target, rose_addr_t *ret) override;
566  virtual bool isFunctionReturnFast(const std::vector<SgAsmInstruction*>&) override;
567  virtual bool isFunctionReturnSlow(const std::vector<SgAsmInstruction*>&) override;
568  virtual Sawyer::Optional<rose_addr_t> branchTarget() override;
569  virtual Rose::BinaryAnalysis::AddressSet getSuccessors(bool &complete) override;
570  virtual Rose::BinaryAnalysis::AddressSet getSuccessors(const std::vector<SgAsmInstruction*>&,
571  bool &complete,
572  const Rose::BinaryAnalysis::MemoryMap::Ptr &initial_memory =
574  virtual bool isUnknown() const override;
575  virtual unsigned get_anyKind() const override;
576 #endif // SgAsmX86Instruction_OTHERS
577 #ifdef DOCUMENTATION
578  };
579 #endif
580 
582 
583  DECLARE_LEAF_CLASS(AsmPowerpcInstruction);
584  IS_SERIALIZABLE(AsmPowerpcInstruction);
585  DECLARE_HEADERS(AsmPowerpcInstruction);
586 #if defined(SgAsmPowerpcInstruction_HEADERS) || defined(DOCUMENTATION)
587  #include <Rose/BinaryAnalysis/InstructionEnumsPowerpc.h>
588 #endif // SgAsmPowerpcInstruction_HEADERS
589 
590 #ifdef DOCUMENTATION
591 
593  public:
594 #endif
595 
596 
597 #ifdef DOCUMENTATION
598 
607 #else
608  AsmPowerpcInstruction.setDataPrototype("Rose::BinaryAnalysis::PowerpcInstructionKind", "kind",
609  "= Rose::BinaryAnalysis::powerpc_unknown_instruction",
610  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE,
611  COPY_DATA);
612 #endif
613 
614  DECLARE_OTHERS(AsmPowerpcInstruction);
615 #if defined(SgAsmPowerpcInstruction_OTHERS) || defined(DOCUMENTATION)
616 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
617  private:
618  friend class boost::serialization::access;
619 
620  template<class S>
621  void serialize(S &s, const unsigned /*version*/) {
622  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmInstruction);
623  s & BOOST_SERIALIZATION_NVP(p_kind);
624  }
625 #endif
626 
627  public:
633  std::string conditionalBranchDescription() const;
634 
640 
641  // Overrides are documented in the base class
642  virtual std::string description() const override;
643  virtual bool terminatesBasicBlock() override;
644  virtual Rose::BinaryAnalysis::AddressSet getSuccessors(bool &complete) override;
645  virtual bool isUnknown() const override;
646  virtual unsigned get_anyKind() const override;
647  virtual bool isFunctionCallFast(const std::vector<SgAsmInstruction*>&,
648  rose_addr_t *target, rose_addr_t *retva) override;
649  virtual bool isFunctionCallSlow(const std::vector<SgAsmInstruction*>&,
650  rose_addr_t *target, rose_addr_t *retva) override;
651  virtual bool isFunctionReturnFast(const std::vector<SgAsmInstruction*>&) override;
652  virtual bool isFunctionReturnSlow(const std::vector<SgAsmInstruction*>&) override;
653 #endif // SgAsmPowerpcInstruction_OTHERS
654 #ifdef DOCUMENTATION
655  };
656 #endif
657 
659 
660  DECLARE_LEAF_CLASS(AsmCilInstruction);
661  IS_SERIALIZABLE(AsmCilInstruction);
662  DECLARE_HEADERS(AsmCilInstruction);
663 #if defined(SgAsmCilInstruction_HEADERS) || defined(DOCUMENTATION)
664  #include <Rose/BinaryAnalysis/InstructionEnumsCil.h>
665 #endif // SgAsmCilInstruction_HEADERS
666 
667 #ifdef DOCUMENTATION
669  public:
670 #endif
671 
672 #ifdef DOCUMENTATION
673 
682 #else
683  AsmCilInstruction.setDataPrototype("Rose::BinaryAnalysis::CilInstructionKind", "kind",
684  " = Rose::BinaryAnalysis::Cil_unknown_instruction",
685  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE,
686  COPY_DATA);
687 #endif
688 
689  DECLARE_OTHERS(AsmCilInstruction);
690 #if defined(SgAsmCilInstruction_OTHERS) || defined(DOCUMENTATION)
691 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
692  private:
693  friend class boost::serialization::access;
694 
695  template<class S>
696  void serialize(S &s, const unsigned /*version*/) {
697  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmInstruction);
698  s & BOOST_SERIALIZATION_NVP(p_kind);
699  }
700 #endif
701 
702  public:
703  // Overrides are documented in the base class
704  virtual std::string description() const override;
705  virtual bool terminatesBasicBlock() override;
706  virtual bool isFunctionCallFast(const std::vector<SgAsmInstruction*> &insns,
707  rose_addr_t *target/*out*/, rose_addr_t *ret/*out*/) override;
708  virtual bool isFunctionCallSlow(const std::vector<SgAsmInstruction*>&,
709  rose_addr_t *target, rose_addr_t *ret) override;
710  virtual bool isFunctionReturnFast(const std::vector<SgAsmInstruction*> &insns) override;
711  virtual bool isFunctionReturnSlow(const std::vector<SgAsmInstruction*> &insns) override;
712  virtual Sawyer::Optional<rose_addr_t> branchTarget() override;
713  virtual Rose::BinaryAnalysis::AddressSet getSuccessors(bool &complete) override;
714  virtual Rose::BinaryAnalysis::AddressSet getSuccessors(const std::vector<SgAsmInstruction*>&,
715  bool &complete,
716  const Rose::BinaryAnalysis::MemoryMap::Ptr &initial_memory =
718  virtual bool isUnknown() const override;
719  virtual unsigned get_anyKind() const override;
720 #endif // SgAsmCilInstruction_OTHERS
721 #ifdef DOCUMENTATION
722  };
723 #endif
724 
726 
727  DECLARE_LEAF_CLASS(AsmJvmInstruction);
728  IS_SERIALIZABLE(AsmJvmInstruction);
729  DECLARE_HEADERS(AsmJvmInstruction);
730 #if defined(SgAsmJvmInstruction_HEADERS) || defined(DOCUMENTATION)
731  #include <Rose/BinaryAnalysis/InstructionEnumsJvm.h>
732 #endif // SgAsmJvmInstruction_HEADERS
733 
734 #ifdef DOCUMENTATION
735 
737  public:
738 #endif
739 
740 #ifdef DOCUMENTATION
741 
750 #else
751  AsmJvmInstruction.setDataPrototype("Rose::BinaryAnalysis::JvmInstructionKind", "kind",
752  "= Rose::BinaryAnalysis::JvmInstructionKind::unknown",
753  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE,
754  COPY_DATA);
755 #endif
756 
757 #ifdef DOCUMENTATION
758  protected:
760  public:
761 #endif
762 
763  DECLARE_OTHERS(AsmJvmInstruction);
764 #if defined(SgAsmJvmInstruction_OTHERS) || defined(DOCUMENTATION)
765 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
766  private:
767  friend class boost::serialization::access;
768 
769  template<class S>
770  void serialize(S &s, const unsigned /*version*/) {
771  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmInstruction);
772  s & BOOST_SERIALIZATION_NVP(p_kind);
773  }
774 #endif
775 
776  public:
777  // Overrides are documented in the base class
778  virtual std::string description() const override;
779  virtual bool terminatesBasicBlock() override;
780  virtual bool isFunctionCallFast(const std::vector<SgAsmInstruction*> &insns,
781  rose_addr_t *target/*out*/, rose_addr_t *ret/*out*/) override;
782  virtual bool isFunctionCallSlow(const std::vector<SgAsmInstruction*>&,
783  rose_addr_t *target, rose_addr_t *ret) override;
784  virtual bool isFunctionReturnFast(const std::vector<SgAsmInstruction*> &insns) override;
785  virtual bool isFunctionReturnSlow(const std::vector<SgAsmInstruction*> &insns) override;
786  virtual Rose::BinaryAnalysis::AddressSet getSuccessors(bool &complete) override;
787  virtual bool isUnknown() const override;
788  virtual Sawyer::Optional<rose_addr_t> branchTarget() override;
789  virtual unsigned get_anyKind() const override;
790 #endif // SgAsmJvmInstruction_OTHERS
791 #ifdef DOCUMENTATION
792  };
793 #endif
794 
796 
797  DECLARE_LEAF_CLASS(AsmMipsInstruction);
798  IS_SERIALIZABLE(AsmMipsInstruction);
799  DECLARE_HEADERS(AsmMipsInstruction);
800 #if defined(SgAsmMipsInstruction_HEADERS) || defined(DOCUMENTATION)
801  #include <Rose/BinaryAnalysis/InstructionEnumsMips.h>
802 #endif // SgAsmMipsInstruction_HEADERS
803 
804 #ifdef DOCUMENTATION
805 
807  public:
808 #endif
809 
810 #ifdef DOCUMENTATION
811 
820 #else
821  AsmMipsInstruction.setDataPrototype("Rose::BinaryAnalysis::MipsInstructionKind", "kind",
822  "= Rose::BinaryAnalysis::mips_unknown_instruction",
823  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE,
824  COPY_DATA);
825 #endif
826 
827  DECLARE_OTHERS(AsmMipsInstruction);
828 #if defined(SgAsmMipsInstruction_OTHERS) || defined(DOCUMENTATION)
829 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
830  private:
831  friend class boost::serialization::access;
832 
833  template<class S>
834  void serialize(S &s, const unsigned /*version*/) {
835  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmInstruction);
836  s & BOOST_SERIALIZATION_NVP(p_kind);
837  }
838 #endif
839 
840  public:
841  // Overrides are documented in the base class
842  virtual std::string description() const override;
843  virtual bool terminatesBasicBlock() override;
844  virtual bool isFunctionCallFast(const std::vector<SgAsmInstruction*> &insns,
845  rose_addr_t *target/*out*/, rose_addr_t *ret/*out*/) override;
846  virtual bool isFunctionCallSlow(const std::vector<SgAsmInstruction*>&,
847  rose_addr_t *target, rose_addr_t *ret) override;
848  virtual bool isFunctionReturnFast(const std::vector<SgAsmInstruction*> &insns) override;
849  virtual bool isFunctionReturnSlow(const std::vector<SgAsmInstruction*> &insns) override;
850  virtual Rose::BinaryAnalysis::AddressSet getSuccessors(bool &complete) override;
851  virtual bool isUnknown() const override;
852  virtual Sawyer::Optional<rose_addr_t> branchTarget() override;
853  virtual unsigned get_anyKind() const override;
854 #endif // SgAsmMipsInstruction_OTHERS
855 #ifdef DOCUMENTATION
856  };
857 #endif
858 
860 
861  DECLARE_LEAF_CLASS(AsmM68kInstruction);
862  IS_SERIALIZABLE(AsmM68kInstruction);
863  DECLARE_HEADERS(AsmM68kInstruction);
864 #if defined(SgAsmM68kInstruction_HEADERS) || defined(DOCUMENTATION)
865  #include <Rose/BinaryAnalysis/InstructionEnumsM68k.h>
866 #endif // SgAsmM68kInstruction_HEADERS
867 
868 #ifdef DOCUMENTATION
870  public:
871 #endif
872 
873 #ifdef DOCUMENTATION
874 
883 #else
884  AsmM68kInstruction.setDataPrototype("Rose::BinaryAnalysis::M68kInstructionKind", "kind",
885  " = Rose::BinaryAnalysis::m68k_unknown_instruction",
886  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE,
887  COPY_DATA);
888 #endif
889 
890  DECLARE_OTHERS(AsmM68kInstruction);
891 #if defined(SgAsmM68kInstruction_OTHERS) || defined(DOCUMENTATION)
892 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
893  private:
894  friend class boost::serialization::access;
895 
896  template<class S>
897  void serialize(S &s, const unsigned /*version*/) {
898  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmInstruction);
899  s & BOOST_SERIALIZATION_NVP(p_kind);
900  }
901 #endif
902 
903  public:
904  // Overrides are documented in the base class
905  virtual std::string description() const override;
906  virtual bool terminatesBasicBlock() override;
907  virtual bool isFunctionCallFast(const std::vector<SgAsmInstruction*> &insns,
908  rose_addr_t *target/*out*/, rose_addr_t *ret/*out*/) override;
909  virtual bool isFunctionCallSlow(const std::vector<SgAsmInstruction*>&,
910  rose_addr_t *target, rose_addr_t *ret) override;
911  virtual bool isFunctionReturnFast(const std::vector<SgAsmInstruction*> &insns) override;
912  virtual bool isFunctionReturnSlow(const std::vector<SgAsmInstruction*> &insns) override;
913  virtual Sawyer::Optional<rose_addr_t> branchTarget() override;
914  virtual Rose::BinaryAnalysis::AddressSet getSuccessors(bool &complete) override;
915  virtual Rose::BinaryAnalysis::AddressSet getSuccessors(const std::vector<SgAsmInstruction*>&,
916  bool &complete,
917  const Rose::BinaryAnalysis::MemoryMap::Ptr &initial_memory =
919  virtual bool isUnknown() const override;
920  virtual unsigned get_anyKind() const override;
921 #endif // SgAsmM68kInstruction_OTHERS
922 #ifdef DOCUMENTATION
923  };
924 #endif
925 
927 
928  DECLARE_LEAF_CLASS(AsmNullInstruction);
929  IS_SERIALIZABLE(AsmNullInstruction);
930 
931 #ifdef DOCUMENTATION
933  public:
934 #endif
935 
936  DECLARE_OTHERS(AsmNullInstruction);
937 #if defined(SgAsmNullInstruction_OTHERS) || defined(DOCUMENTATION)
938 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
939  private:
940  friend class boost::serialization::access;
941 
942  template<class S>
943  void serialize(S & s, const unsigned /*version*/) {
944  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmInstruction);
945  }
946 #endif
947 
948  public:
949  // there's only one kind of null instruction
950  enum Kind { null_unknown };
951 
952  public: // overrides
953  virtual bool terminatesBasicBlock() override;
954  virtual bool isFunctionCallFast(const std::vector<SgAsmInstruction*> &insns,
955  rose_addr_t *target/*out*/, rose_addr_t *ret/*out*/) override;
956  virtual bool isFunctionCallSlow(const std::vector<SgAsmInstruction*>&,
957  rose_addr_t *target, rose_addr_t *ret) override;
958  virtual bool isFunctionReturnFast(const std::vector<SgAsmInstruction*> &insns) override;
959  virtual bool isFunctionReturnSlow(const std::vector<SgAsmInstruction*> &insns) override;
960  virtual Sawyer::Optional<rose_addr_t> branchTarget() override;
961  virtual Rose::BinaryAnalysis::AddressSet getSuccessors(bool &complete) override;
962  virtual Rose::BinaryAnalysis::AddressSet getSuccessors(const std::vector<SgAsmInstruction*>&,
963  bool &complete,
964  const Rose::BinaryAnalysis::MemoryMap::Ptr &initial_memory =
966  virtual bool isUnknown() const override;
967  virtual unsigned get_anyKind() const override;
968 #endif // SgAsmNullInstruction_OTHERS
969 #ifdef DOCUMENTATION
970  };
971 #endif
972 
974 
975  /*************************************************************************************************************************
976  * List of SgAsmInstruction nodes
977  *************************************************************************************************************************/
978 
980 
981  DECLARE_LEAF_CLASS(AsmInstructionList);
982  IS_SERIALIZABLE(AsmInstructionList);
983 
984 #ifdef DOCUMENTATION
985 
987  public:
988 #endif
989 
990 #ifdef DOCUMENTATION
991 
997  const SgAsmInstructionPtrList& get_instructions() const;
998  void set_instruction(const SgAsmInstructionPtrList&);
1000 #else
1001  AsmInstructionList.setDataPrototype("SgAsmInstructionPtrList", "instructions", "",
1002  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS,
1003  NO_TRAVERSAL, NO_DELETE);
1004 #endif
1005 
1006  DECLARE_OTHERS(AsmInstructionList);
1007 #if defined(SgAsmInstructionList_OTHERS) || defined(DOCUMENTATION)
1008 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1009  private:
1010  friend class boost::serialization::access;
1011 
1012  template<class S>
1013  void serialize(S &s, const unsigned /*version*/) {
1014  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmNode);
1015  s & BOOST_SERIALIZATION_NVP(p_instructions);
1016  }
1017 #endif
1018 
1019 #endif // SgAsmInstructionList_OTHERS
1020 
1021 #ifdef DOCUMENTATION
1022  };
1023 #endif
1024 
1026 
1027  NEW_NONTERMINAL_MACRO(AsmInstruction,
1028  AsmX86Instruction
1029 #ifdef ROSE_ENABLE_ASM_AARCH32
1030  | AsmAarch32Instruction
1031 #endif
1032 #ifdef ROSE_ENABLE_ASM_AARCH64
1033  | AsmAarch64Instruction
1034 #endif
1035  | AsmPowerpcInstruction | AsmCilInstruction | AsmJvmInstruction | AsmMipsInstruction
1036  | AsmM68kInstruction | AsmNullInstruction,
1037  "AsmInstruction", "AsmInstructionTag", true);
1038  AsmInstruction.setCppCondition("!defined(DOCUMENTATION)");
1039  IS_SERIALIZABLE(AsmInstruction);
1040 
1041  DECLARE_HEADERS(AsmInstruction);
1042 #if defined(SgAsmInstruction_HEADERS) || defined(DOCUMENTATION)
1043  #include <Rose/BinaryAnalysis/MemoryMap.h>
1044 #endif // SgAsmInstruction_HEADERS
1045 
1046 #ifdef DOCUMENTATION
1047 
1069  public:
1070 #endif
1071 
1072 #ifdef DOCUMENTATION
1073 
1081  const std::string& get_mnemonic() const;
1082  void set_mnemonic(const std::string&);
1084 #else
1085  AsmInstruction.setDataPrototype("std::string", "mnemonic", "= \"\"",
1086  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
1087 #endif
1088 
1089 #ifdef DOCUMENTATION
1090 
1095  const SgUnsignedList& get_raw_bytes() const;
1096  void set_raw_bytes(const SgUnsignedList&);
1098 #else
1099  AsmInstruction.setDataPrototype("SgUnsignedCharList", "raw_bytes", "",
1100  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
1101 #endif
1102 
1103 #ifdef DOCUMENTATION
1104 
1113 #else
1114  AsmInstruction.setDataPrototype("SgAsmOperandList*", "operandList", "= NULL",
1115  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE, COPY_DATA);
1116 #endif
1117 
1118 #ifdef DOCUMENTATION
1119  // Documentation is below because it uses different names than normal. Functions are not automatically generated because
1120  // we need to synchronize access to the private p_cacheLockCount data member. However, we still use ROSETTA to generate
1121  // the data member because we need to make sure it gets initialized to zero in the constructors. What a mess.
1122 #else
1123  AsmInstruction.setDataPrototype("size_t", "cacheLockCount", "= 0",
1124  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
1125 #endif
1126 
1127 #ifdef DOCUMENTATION
1128  // FIXME[Robb P Matzke 2017-02-13]: unused?
1129 #else
1130  AsmInstruction.setDataPrototype("SgAsmStatementPtrList", "sources", "",
1131  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
1132 #endif
1133 
1134 #ifdef DOCUMENTATION
1135 
1141  int64_t get_stackDeltaIn() const;
1142  void set_stackDeltaIn(int64_t);
1144 #else
1145  AsmInstruction.setDataPrototype("int64_t", "stackDeltaIn", "= SgAsmInstruction::INVALID_STACK_DELTA",
1146  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
1147 #endif
1148 
1149 #ifdef DOCUMENTATION
1150 
1155 #else
1156  AsmInstruction.setDataPrototype("SgAsmExprListExp*", "semantics", "= NULL",
1157  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE, COPY_DATA);
1158 #endif
1159 
1160  DECLARE_OTHERS(AsmInstruction);
1161 #if defined(SgAsmInstruction_OTHERS) || defined(DOCUMENTATION)
1162 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1163  private:
1164  friend class boost::serialization::access;
1165 
1166  template<class S>
1167  void serialize(S &s, const unsigned version) {
1168  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmStatement);
1169  s & BOOST_SERIALIZATION_NVP(p_mnemonic);
1170  s & BOOST_SERIALIZATION_NVP(p_raw_bytes);
1171  s & BOOST_SERIALIZATION_NVP(p_operandList);
1172  s & BOOST_SERIALIZATION_NVP(p_sources);
1173  if (version >= 1)
1174  s & BOOST_SERIALIZATION_NVP(semanticFailure_);
1175  //s & BOOST_SERIALIZATION_NVP(p_cacheLockCount); -- definitely not!
1176  }
1177 #endif
1178 
1179  private:
1180  struct SemanticFailure {
1181  size_t n;
1182  SemanticFailure(): n(0) {}
1183 
1184 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1185  private:
1186  friend class boost::serialization::access;
1187  template<class S>
1188  void serialize(S &s, const unsigned /*version*/) {
1189  s & BOOST_SERIALIZATION_NVP(n);
1190  }
1191 #endif
1192  };
1193  SemanticFailure semanticFailure_;
1194 
1195  // Synchronized data members. All the following data members (as listed in binaryInstruction.C, not the ROSETTA-generated
1196  // code) should be procted by the mutex_. Additionally, the p_cacheLockCount data member is synchronized.
1197  mutable SAWYER_THREAD_TRAITS::Mutex mutex_;
1198 
1199  public:
1204  static const int64_t INVALID_STACK_DELTA;
1205 
1211  virtual std::string description() const { return ""; }
1212 
1213  // FIXME[Robb P Matzke 2017-02-13]: unused?
1214  void appendSources( SgAsmInstruction* instruction );
1215 
1217  size_t nOperands() const;
1218 
1222  SgAsmExpression* operand(size_t) const;
1223 
1230  virtual bool terminatesBasicBlock();
1231 
1245  virtual bool isFunctionCallFast(const std::vector<SgAsmInstruction*>&, rose_addr_t *target, rose_addr_t *ret);
1246  virtual bool isFunctionCallSlow(const std::vector<SgAsmInstruction*>&, rose_addr_t *target, rose_addr_t *ret);
1258  virtual bool isFunctionReturnFast(const std::vector<SgAsmInstruction*>&);
1259  virtual bool isFunctionReturnSlow(const std::vector<SgAsmInstruction*>&);
1265  bool isFirstInBlock();
1266 
1270  bool isLastInBlock();
1271 
1277 
1278  // FIXME[Robb Matzke 2021-03-02]: deprecated
1279  bool getBranchTarget(rose_addr_t *target /*out*/) ROSE_DEPRECATED("use branchTarget instead");
1280 
1415  virtual bool hasEffect();
1416 
1425  virtual bool hasEffect(const std::vector<SgAsmInstruction*>&, bool allow_branch=false,
1426  bool relax_stack_semantics=false);
1427 
1437  virtual std::vector<std::pair<size_t,size_t> >
1438  findNoopSubsequences(const std::vector<SgAsmInstruction*>& insns, bool allow_branch=false,
1439  bool relax_stack_semantics=false);
1440 
1447  virtual Rose::BinaryAnalysis::AddressSet getSuccessors(bool &complete); /*subclasses must redefine*/
1448 
1457  virtual Rose::BinaryAnalysis::AddressSet getSuccessors(const std::vector<SgAsmInstruction*> &basicBlock,
1458  bool &complete,
1459  const Rose::BinaryAnalysis::MemoryMap::Ptr &initial_memory =
1461 
1467  virtual size_t get_size() const;
1468 
1474  virtual bool isUnknown() const;
1475 
1509  virtual unsigned get_anyKind() const;
1510 
1514  virtual std::string toString() const;
1515 
1520  virtual std::set<rose_addr_t> explicitConstants() const;
1521 
1531  size_t semanticFailure() const;
1532  void semanticFailure(size_t);
1533  void incrementSemanticFailure();
1543  size_t cacheLockCount() const;
1544  void adjustCacheLockCount(int increment);
1546 #endif // SgAsmInstruction_OTHERS
1547 
1548 #ifdef DOCUMENTATION
1549  };
1550 #endif
1551 
1552 
1553 
1555 
1556  /**************************************************************************************************************************
1557  * Instruction Expressions
1558  * Related functions and documentation can be found in src/frontend/Disassemblers/Expressions.C
1559  **************************************************************************************************************************/
1560 
1562 
1563  DECLARE_LEAF_CLASS(AsmOperandList);
1564  IS_SERIALIZABLE(AsmOperandList);
1565 
1566 #ifdef DOCUMENTATION
1567 
1568  class SgAsmOperandList: public SgAsmNode {
1569  public:
1570 #endif
1571 
1572 #ifdef DOCUMENTATION
1573 
1579  const SgAsmExpressionPtrList& get_operands() const;
1580  void set_oerands(const SgAsmExpressionPtrList&);
1582 #else
1583  AsmOperandList.setDataPrototype("SgAsmExpressionPtrList", "operands", "",
1584  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
1585 #endif
1586 
1587  DECLARE_OTHERS(AsmOperandList);
1588 #if defined(SgAsmOperandList_OTHERS) || defined(DOCUMENTATION)
1589 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1590  private:
1591  friend class boost::serialization::access;
1592 
1593  template<class S>
1594  void serialize(S &s, const unsigned /*version*/) {
1595  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmNode);
1596  s & BOOST_SERIALIZATION_NVP(p_operands);
1597  }
1598 #endif
1599 
1600  public:
1602  void append_operand(SgAsmExpression* operand);
1603 #endif // SgAsmOperandList_OTHERS
1604 
1605 #ifdef DOCUMENTATION
1606  };
1607 #endif
1608 
1609  // FIXME[Robb P Matzke 2016-10-31]
1610  AsmOperandList.setFunctionSource("SOURCE_BINARY_OPERAND_LIST", "../Grammar/BinaryInstruction.code");
1611 
1613 
1614  DECLARE_LEAF_CLASS(AsmBinaryAdd);
1615  IS_SERIALIZABLE(AsmBinaryAdd);
1616 
1617 #ifdef DOCUMENTATION
1618 
1620  public:
1621 #endif
1622 
1623  DECLARE_OTHERS(AsmBinaryAdd);
1624 #if defined(SgAsmBinaryAdd_OTHERS) || defined(DOCUMENTATION)
1625 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1626  private:
1627  friend class boost::serialization::access;
1628 
1629  template<class S>
1630  void serialize(S &s, const unsigned /*version*/) {
1631  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmBinaryExpression);
1632  }
1633 #endif
1634 #endif // SgAsmBinaryAdd_OTHERS
1635 
1636 #ifdef DOCUMENTATION
1637  };
1638 #endif
1639 
1641 
1642  DECLARE_LEAF_CLASS(AsmBinarySubtract);
1643  IS_SERIALIZABLE(AsmBinarySubtract);
1644 
1645 #ifdef DOCUMENTATION
1646 
1648  public:
1649 #endif
1650 
1651  DECLARE_OTHERS(AsmBinarySubtract);
1652 #if defined(SgAsmBinarySubtract_OTHERS) || defined(DOCUMENTATION)
1653 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1654  private:
1655  friend class boost::serialization::access;
1656 
1657  template<class S>
1658  void serialize(S &s, const unsigned /*version*/) {
1659  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmBinaryExpression);
1660  }
1661 #endif
1662 #endif // SgAsmBinarySubtract_OTHERS
1663 
1664 #ifdef DOCUMENTATION
1665  };
1666 #endif
1667 
1669 
1670  DECLARE_LEAF_CLASS(AsmBinaryMultiply);
1671  IS_SERIALIZABLE(AsmBinaryMultiply);
1672 
1673 #ifdef DOCUMENTATION
1674 
1676  public:
1677 #endif
1678 
1679  DECLARE_OTHERS(AsmBinaryMultiply);
1680 #if defined(SgAsmBinaryMultiply_OTHERS) || defined(DOCUMENTATION)
1681 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1682  private:
1683  friend class boost::serialization::access;
1684 
1685  template<class S>
1686  void serialize(S &s, const unsigned /*version*/) {
1687  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmBinaryExpression);
1688  }
1689 #endif
1690 #endif // SgAsmBinaryMultiply_OTHERS
1691 
1692 #ifdef DOCUMENTATION
1693  };
1694 #endif
1695 
1697 
1698  DECLARE_LEAF_CLASS(AsmBinaryDivide);
1699  IS_SERIALIZABLE(AsmBinaryDivide);
1700 
1701 #ifdef DOCUMENTATION
1702 
1704  public:
1705 #endif
1706 
1707  DECLARE_OTHERS(AsmBinaryDivide);
1708 #if defined(SgAsmBinaryDivide_OTHERS) || defined(DOCUMENTATION)
1709 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1710  private:
1711  friend class boost::serialization::access;
1712 
1713  template<class S>
1714  void serialize(S &s, const unsigned /*version*/) {
1715  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmBinaryExpression);
1716  }
1717 #endif
1718 #endif // SgAsmBinaryDivide_OTHERS
1719 
1720 #ifdef DOCUMENTATION
1721  };
1722 #endif
1723 
1725 
1726  DECLARE_LEAF_CLASS(AsmBinaryMod);
1727  IS_SERIALIZABLE(AsmBinaryMod);
1728 
1729 #ifdef DOCUMENTATION
1730 
1732  public:
1733 #endif
1734 
1735  DECLARE_OTHERS(AsmBinaryMod);
1736 #if defined(SgAsmBinaryMod_OTHERS) || defined(DOCUMENTATION)
1737 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1738  private:
1739  friend class boost::serialization::access;
1740 
1741  template<class S>
1742  void serialize(S &s, const unsigned /*version*/) {
1743  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmBinaryExpression);
1744  }
1745 #endif
1746 #endif // SgAsmBinaryMod_OTHERS
1747 
1748 #ifdef DOCUMENTATION
1749  };
1750 #endif
1751 
1753 
1754  DECLARE_LEAF_CLASS(AsmBinaryPreupdate);
1755  IS_SERIALIZABLE(AsmBinaryPreupdate);
1756 
1757 #ifdef DOCUMENTATION
1758 
1763  public:
1764 #endif
1765 
1766  DECLARE_OTHERS(AsmBinaryPreupdate);
1767 #if defined(SgAsmBinaryPreupdate_OTHERS) || defined(DOCUMENTATION)
1768 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1769  private:
1770  friend class boost::serialization::access;
1771 
1772  template<class S>
1773  void serialize(S &s, const unsigned /*version*/) {
1774  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmBinaryExpression);
1775  }
1776 #endif
1777 #endif // SgAsmBinaryPreupdate_OTHERS
1778 
1779 #ifdef DOCUMENTATION
1780  };
1781 #endif
1782 
1784 
1785  DECLARE_LEAF_CLASS(AsmBinaryPostupdate);
1786  IS_SERIALIZABLE(AsmBinaryPostupdate);
1787 
1788 #ifdef DOCUMENTATION
1789 
1794  public:
1795 #endif
1796 
1797  DECLARE_OTHERS(AsmBinaryPostupdate);
1798 #if defined(SgAsmBinaryPostupdate_OTHERS) || defined(DOCUMENTATION)
1799 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1800  private:
1801  friend class boost::serialization::access;
1802 
1803  template<class S>
1804  void serialize(S &s, const unsigned /*version*/) {
1805  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmBinaryExpression);
1806  }
1807 #endif
1808 #endif // SgAsmBinaryPostupdate_OTHERS
1809 
1810 #ifdef DOCUMENTATION
1811  };
1812 #endif
1813 
1815 
1816  DECLARE_LEAF_CLASS(AsmBinaryLsl);
1817  IS_SERIALIZABLE(AsmBinaryLsl);
1818 
1819 #ifdef DOCUMENTATION
1820 
1822  public:
1823 #endif
1824 
1825  DECLARE_OTHERS(AsmBinaryLsl);
1826 #if defined(SgAsmBinaryLsl_OTHERS) || defined(DOCUMENTATION)
1827 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1828  private:
1829  friend class boost::serialization::access;
1830 
1831  template<class S>
1832  void serialize(S &s, const unsigned /*version*/) {
1833  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmBinaryExpression);
1834  }
1835 #endif
1836 #endif // SgAsmBinaryLsl_OTHERS
1837 
1838 #ifdef DOCUMENTATION
1839  };
1840 #endif
1841 
1843 
1844  DECLARE_LEAF_CLASS(AsmBinaryMsl);
1845  IS_SERIALIZABLE(AsmBinaryMsl);
1846 
1847 #ifdef DOCUMENTATION
1848 
1852  public:
1853 #endif
1854 
1855  DECLARE_OTHERS(AsmBinaryMsl);
1856 #if defined(SgAsmBinaryMsl_OTHERS) || defined(DOCUMENTATION)
1857 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1858  private:
1859  friend class boost::serialization::access;
1860 
1861  template<class S>
1862  void serialize(S &s, const unsigned /*version*/) {
1863  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmBinaryExpression);
1864  }
1865 #endif
1866 #endif // SgAsmBinaryMsl_OTHERS
1867 
1868 #ifdef DOCUMENTATION
1869  };
1870 #endif
1871 
1873 
1874  DECLARE_LEAF_CLASS(AsmBinaryLsr);
1875  IS_SERIALIZABLE(AsmBinaryLsr);
1876 
1877 #ifdef DOCUMENTATION
1878 
1880  public:
1881 #endif
1882 
1883  DECLARE_OTHERS(AsmBinaryLsr);
1884 #if defined(SgAsmBinaryLsr_OTHERS) || defined(DOCUMENTATION)
1885 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1886  private:
1887  friend class boost::serialization::access;
1888 
1889  template<class S>
1890  void serialize(S &s, const unsigned /*version*/) {
1891  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmBinaryExpression);
1892  }
1893 #endif
1894 #endif // SgAsmBinaryLsr_OTHERS
1895 
1896 #ifdef DOCUMENTATION
1897  };
1898 #endif
1899 
1901 
1902  DECLARE_LEAF_CLASS(AsmBinaryAsr);
1903  IS_SERIALIZABLE(AsmBinaryAsr);
1904 
1905 #ifdef DOCUMENTATION
1906 
1908  public:
1909 #endif
1910 
1911  DECLARE_OTHERS(AsmBinaryAsr);
1912 #if defined(SgAsmBinaryAsr_OTHERS) || defined(DOCUMENTATION)
1913 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1914  private:
1915  friend class boost::serialization::access;
1916 
1917  template<class S>
1918  void serialize(S &s, const unsigned /*version*/) {
1919  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmBinaryExpression);
1920  }
1921 #endif
1922 #endif // SgAsmBinaryAsr_OTHERS
1923 
1924 #ifdef DOCUMENTATION
1925  };
1926 #endif
1927 
1929 
1930  DECLARE_LEAF_CLASS(AsmBinaryRor);
1931  IS_SERIALIZABLE(AsmBinaryRor);
1932 
1933 #ifdef DOCUMENTATION
1934 
1936  public:
1937 #endif
1938 
1939  DECLARE_OTHERS(AsmBinaryRor);
1940 #if defined(SgAsmBinaryRor_OTHERS) || defined(DOCUMENTATION)
1941 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1942  private:
1943  friend class boost::serialization::access;
1944 
1945  template<class S>
1946  void serialize(S &s, const unsigned /*version*/) {
1947  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmBinaryExpression);
1948  }
1949 #endif
1950 #endif // SgAsmBinaryRor_OTHERS
1951 
1952 #ifdef DOCUMENTATION
1953  };
1954 #endif
1955 
1957 
1958  DECLARE_LEAF_CLASS(AsmBinaryConcat);
1959  IS_SERIALIZABLE(AsmBinaryConcat);
1960 
1961 #ifdef DOCUMENTATION
1962 
1964  public:
1965 #endif
1966 
1967  DECLARE_OTHERS(AsmBinaryConcat);
1968 #if defined(SgAsmBinaryConcat_OTHERS) || defined(DOCUMENTATION)
1969 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
1970  private:
1971  friend class boost::serialization::access;
1972 
1973  template<class S>
1974  void serialize(S &s, const unsigned /*version*/) {
1975  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmBinaryExpression);
1976  }
1977 #endif
1978 #endif // SgAsmBinaryConcat_OTHERS
1979 
1980 #ifdef DOCUMENTATION
1981  };
1982 #endif
1983 
1985 
1986  NEW_NONTERMINAL_MACRO(AsmBinaryExpression,
1987  AsmBinaryAdd | AsmBinarySubtract | AsmBinaryMultiply |
1988  AsmBinaryDivide | AsmBinaryMod | AsmBinaryPreupdate |
1989  AsmBinaryPostupdate |
1990  AsmBinaryLsl | AsmBinaryLsr | AsmBinaryAsr |
1991  AsmBinaryRor | AsmBinaryMsl | AsmBinaryConcat,
1992  "AsmBinaryExpression", "AsmBinaryExpressionTag", false);
1993  AsmBinaryExpression.setCppCondition("!defined(DOCUMENTATION)");
1994  IS_SERIALIZABLE(AsmBinaryExpression);
1995 
1996 #ifdef DOCUMENTATION
1997 
1999  public:
2000 #endif
2001 
2002 #ifdef DOCUMENTATION
2003 
2006  SgAsmExpression* get_lhs() const;
2007  void set_lhs(SgAsmExpression*);
2009 #else
2010  AsmBinaryExpression.setDataPrototype("SgAsmExpression*", "lhs", "= NULL",
2011  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
2012 #endif
2013 
2014 #ifdef DOCUMENTATION
2015 
2018  SgAsmExpression* get_rhs() const;
2019  void set_rhs(SgAsmExpression*);
2021 #else
2022  AsmBinaryExpression.setDataPrototype("SgAsmExpression*", "rhs", "= NULL",
2023  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
2024 #endif
2025 
2026  DECLARE_OTHERS(AsmBinaryExpression);
2027 #if defined(SgAsmBinaryExpression_OTHERS) || defined(DOCUMENTATION)
2028 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2029  private:
2030  friend class boost::serialization::access;
2031 
2032  template<class S>
2033  void serialize(S &s, const unsigned /*version*/) {
2034  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExpression);
2035  s & BOOST_SERIALIZATION_NVP(p_lhs);
2036  s & BOOST_SERIALIZATION_NVP(p_rhs);
2037  }
2038 #endif
2039 #endif // SgAsmBinaryExpression_OTHERS
2040 
2041 #ifdef DOCUMENTATION
2042  };
2043 #endif
2044 
2046 
2047  DECLARE_LEAF_CLASS(AsmUnaryPlus);
2048  IS_SERIALIZABLE(AsmUnaryPlus);
2049 
2050 #ifdef DOCUMENTATION
2051 
2053  public:
2054 #endif
2055 
2056  DECLARE_OTHERS(AsmUnaryPlus);
2057 #if defined(SgAsmUnaryPlus_OTHERS) || defined(DOCUMENTATION)
2058 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2059  private:
2060  friend class boost::serialization::access;
2061 
2062  template<class S>
2063  void serialize(S &s, const unsigned /*version*/) {
2064  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmUnaryExpression);
2065  }
2066 #endif
2067 #endif // SgAsmUnaryPlus_OTHERS
2068 
2069 #ifdef DOCUMENTATION
2070  };
2071 #endif
2072 
2074 
2075  DECLARE_LEAF_CLASS(AsmUnaryMinus);
2076  IS_SERIALIZABLE(AsmUnaryMinus);
2077 
2078 #ifdef DOCUMENTATION
2079 
2081  public:
2082 #endif
2083 
2084  DECLARE_OTHERS(AsmUnaryMinus);
2085 #if defined(SgAsmUnaryMinus_OTHERS) || defined(DOCUMENTATION)
2086 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2087  private:
2088  friend class boost::serialization::access;
2089 
2090  template<class S>
2091  void serialize(S &s, const unsigned /*version*/) {
2092  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmUnaryExpression);
2093  }
2094 #endif
2095 #endif // SgAsmUnaryMinus_OTHERS
2096 
2097 #ifdef DOCUMENTATION
2098  };
2099 #endif
2100 
2102 
2103  DECLARE_LEAF_CLASS(AsmUnaryRrx);
2104  IS_SERIALIZABLE(AsmUnaryRrx);
2105 
2106 #ifdef DOCUMENTATION
2107  // FIXME[Robb P Matzke 2016-10-31]: no idea what this is
2109  public:
2110 #endif
2111 
2112  DECLARE_OTHERS(AsmUnaryRrx);
2113 #if defined(SgAsmUnaryRrx_OTHERS) || defined(DOCUMENTATION)
2114 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2115  private:
2116  friend class boost::serialization::access;
2117 
2118  template<class S>
2119  void serialize(S &s, const unsigned /*version*/) {
2120  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmUnaryExpression);
2121  }
2122 #endif
2123 #endif // SgAsmUnaryRrx_OTHERS
2124 
2125 #ifdef DOCUMENTATION
2126  };
2127 #endif
2128 
2130 
2131  DECLARE_LEAF_CLASS(AsmUnaryTruncate);
2132  IS_SERIALIZABLE(AsmUnaryTruncate);
2133 
2134 #ifdef DOCUMENTATION
2135 
2141  public:
2142 #endif
2143 
2144  DECLARE_OTHERS(AsmUnaryTruncate);
2145 #if defined(SgAsmUnaryTruncate_OTHERS) || defined(DOCUMENTATION)
2146 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2147  private:
2148  friend class boost::serialization::access;
2149 
2150  template<class S>
2151  void serialize(S &s, const unsigned /*version*/) {
2152  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmUnaryExpression);
2153  }
2154 #endif
2155 #endif // SgAsmUnaryTruncate_OTHERS
2156 
2157 #ifdef DOCUMENTATION
2158  };
2159 #endif
2160 
2162 
2163  DECLARE_LEAF_CLASS(AsmUnarySignedExtend);
2164  IS_SERIALIZABLE(AsmUnarySignedExtend);
2165 
2166 #ifdef DOCUMENTATION
2167 
2173  public:
2174 #endif
2175 
2176  DECLARE_OTHERS(AsmUnarySignedExtend);
2177 #if defined(SgAsmUnarySignedExtend_OTHERS) || defined(DOCUMENTATION)
2178 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2179  private:
2180  friend class boost::serialization::access;
2181 
2182  template<class S>
2183  void serialize(S &s, const unsigned /*version*/) {
2184  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmUnaryExpression);
2185  }
2186 #endif
2187 #endif // SgAsmUnarySignedExtend_OTHERS
2188 
2189 #ifdef DOCUMENTATION
2190  };
2191 #endif
2192 
2194 
2195  DECLARE_LEAF_CLASS(AsmUnaryUnsignedExtend);
2196  IS_SERIALIZABLE(AsmUnaryUnsignedExtend);
2197 
2198 #ifdef DOCUMENTATION
2199 
2205  public:
2206 #endif
2207 
2208  DECLARE_OTHERS(AsmUnaryUnsignedExtend);
2209 #if defined(SgAsmUnaryUnsignedExtend_OTHERS) || defined(DOCUMENTATION)
2210 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2211  private:
2212  friend class boost::serialization::access;
2213 
2214  template<class S>
2215  void serialize(S &s, const unsigned /*version*/) {
2216  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmUnaryExpression);
2217  }
2218 #endif
2219 #endif // SgAsmUnaryUnsignedExtend_OTHERS
2220 
2221 #ifdef DOCUMENTATION
2222  };
2223 #endif
2224 
2226 
2227 #ifdef ROSE_ENABLE_ASM_AARCH64
2228  DECLARE_LEAF_CLASS(AsmAarch64AtOperand);
2229  IS_SERIALIZABLE(AsmAarch64AtOperand);
2230 
2231 #ifdef DOCUMENTATION
2232 
2233  class SgAsmAarch64AtOperand: public SgAsmExpression {
2234  public:
2235 #endif
2236 
2237  DECLARE_OTHERS(AsmAarch64AtOperand);
2238 #if defined(SgAsmAarch64AtOperand_OTHERS) || defined(DOCUMENTATION)
2239 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2240  private:
2241  friend class boost::serialization::access;
2242 
2243  template<class S>
2244  void serialize(S &s, const unsigned /*version*/) {
2245  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExpression);
2246  s & BOOST_SERIALIZATION_NVP(operation_);
2247  }
2248 #endif
2249 
2250  private:
2251  Rose::BinaryAnalysis::Aarch64AtOperation operation_;
2252 
2253  public:
2255  explicit SgAsmAarch64AtOperand(Rose::BinaryAnalysis::Aarch64AtOperation op)
2256  : operation_(op) {}
2257 
2263  Rose::BinaryAnalysis::Aarch64AtOperation operation() const {
2264  return operation_;
2265  }
2266  void operation(Rose::BinaryAnalysis::Aarch64AtOperation op) {
2267  operation_ = op;
2268  }
2270 #endif // SgAsmAarch64AtOperand_OTHERS
2271 
2272 #ifdef DOCUMENTATION
2273  };
2274 #endif
2275 #endif
2276 
2278 
2279 #ifdef ROSE_ENABLE_ASM_AARCH64
2280  DECLARE_LEAF_CLASS(AsmAarch64PrefetchOperand);
2281  IS_SERIALIZABLE(AsmAarch64PrefetchOperand);
2282 
2283 #ifdef DOCUMENTATION
2284 
2285  class SgAsmAarch64PrefetchOperand: public SgAsmExpression {
2286  public:
2287 #endif
2288 
2289  DECLARE_OTHERS(AsmAarch64PrefetchOperand);
2290 #if defined(SgAsmAarch64PrefetchOperand_OTHERS) || defined(DOCUMENTATION)
2291 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2292  private:
2293  friend class boost::serialization::access;
2294 
2295  template<class S>
2296  void serialize(S &s, const unsigned /*version*/) {
2297  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExpression);
2298  s & BOOST_SERIALIZATION_NVP(operation_);
2299  }
2300 #endif
2301 
2302  private:
2303  Rose::BinaryAnalysis::Aarch64PrefetchOperation operation_;
2304 
2305  public:
2307  explicit SgAsmAarch64PrefetchOperand(Rose::BinaryAnalysis::Aarch64PrefetchOperation op)
2308  : operation_(op) {}
2309 
2315  Rose::BinaryAnalysis::Aarch64PrefetchOperation operation() const {
2316  return operation_;
2317  }
2318  void operation(Rose::BinaryAnalysis::Aarch64PrefetchOperation op) {
2319  operation_ = op;
2320  }
2322 #endif // SgAsmAarch64PrefetchOperand_OTHERS
2323 
2324 #ifdef DOCUMENTATION
2325  };
2326 #endif
2327 #endif
2328 
2330 
2331 #ifdef ROSE_ENABLE_ASM_AARCH64
2332  DECLARE_LEAF_CLASS(AsmAarch64SysMoveOperand);
2333  IS_SERIALIZABLE(AsmAarch64SysMoveOperand);
2334 
2335 #ifdef DOCUMENTATION
2336 
2337  class SgAsmAarch64SysMoveOperand: public SgAsmExpression {
2338  public:
2339 #endif
2340 
2341  DECLARE_OTHERS(AsmAarch64SysMoveOperand);
2342 #if defined(SgAsmAarch64SysMoveOperand_OTHERS) || defined(DOCUMENTATION)
2343 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2344  private:
2345  friend class boost::serialization::access;
2346 
2347  template<class S>
2348  void serialize(S &s, const unsigned /*version*/) {
2349  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExpression);
2350  s & BOOST_SERIALIZATION_NVP(access_);
2351  }
2352 #endif
2353 
2354  private:
2355  unsigned access_;
2356 
2357  public:
2359  explicit SgAsmAarch64SysMoveOperand(unsigned access)
2360  : access_(access) {}
2361 
2367  unsigned access() const {
2368  return access_;
2369  }
2370  void access(unsigned ac) {
2371  access_ = ac;
2372  }
2374 #endif // SgAsmAarch64SysMoveOperand_OTHERS
2375 
2376 #ifdef DOCUMENTATION
2377  };
2378 #endif
2379 #endif
2380 
2382 
2383 #ifdef ROSE_ENABLE_ASM_AARCH64
2384  DECLARE_LEAF_CLASS(AsmAarch64CImmediateOperand);
2385  IS_SERIALIZABLE(AsmAarch64CImmediateOperand);
2386 
2387 #ifdef DOCUMENTATION
2388 
2389  class SgAsmAarch64CImmediateOperand: public SgAsmExpression {
2390  public:
2391 #endif
2392 
2393  DECLARE_OTHERS(AsmAarch64CImmediateOperand);
2394 #if defined(SgAsmAarch64CImmediateOperand_OTHERS) || defined(DOCUMENTATION)
2395 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2396  private:
2397  friend class boost::serialization::access;
2398 
2399  template<class S>
2400  void serialize(S &s, const unsigned /*version*/) {
2401  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExpression);
2402  s & BOOST_SERIALIZATION_NVP(imm_);
2403  }
2404 #endif
2405 
2406  private:
2407  unsigned imm_;
2408 
2409  public:
2411  explicit SgAsmAarch64CImmediateOperand(unsigned imm)
2412  : imm_(imm) {}
2413 
2419  unsigned immediate() const {
2420  return imm_;
2421  }
2422  void immediate(unsigned imm) {
2423  imm_ = imm;
2424  }
2426 #endif // SgAsmAarch64CImmediateOperand_OTHERS
2427 
2428 #ifdef DOCUMENTATION
2429  };
2430 #endif
2431 #endif
2432 
2434 
2435 #ifdef ROSE_ENABLE_ASM_AARCH64
2436  DECLARE_LEAF_CLASS(AsmAarch64BarrierOperand);
2437  IS_SERIALIZABLE(AsmAarch64BarrierOperand);
2438 
2439 #ifdef DOCUMENTATION
2440 
2441  class SgAsmAarch64BarrierOperand: public SgAsmExpression {
2442  public:
2443 #endif
2444 
2445  DECLARE_OTHERS(AsmAarch64BarrierOperand);
2446 #if defined(SgAsmAarch64BarrierOperand_OTHERS) || defined(DOCUMENTATION)
2447 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2448  private:
2449  friend class boost::serialization::access;
2450 
2451  template<class S>
2452  void serialize(S &s, const unsigned /*version*/) {
2453  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExpression);
2454  s & BOOST_SERIALIZATION_NVP(operation_);
2455  }
2456 #endif
2457 
2458  private:
2459  Rose::BinaryAnalysis::Aarch64BarrierOperation operation_;
2460 
2461  public:
2463  explicit SgAsmAarch64BarrierOperand(Rose::BinaryAnalysis::Aarch64BarrierOperation operation)
2464  : operation_(operation) {}
2465 
2469  Rose::BinaryAnalysis::Aarch64BarrierOperation operation() const {
2470  return operation_;
2471  }
2472  void operation(Rose::BinaryAnalysis::Aarch64BarrierOperation op) {
2473  operation_ = op;
2474  }
2476 #endif // SgAsmAarch64BarrierOperand_OTHERS
2477 
2478 #ifdef DOCUMENTATION
2479  };
2480 #endif
2481 #endif
2482 
2484 
2485  NEW_NONTERMINAL_MACRO(AsmUnaryExpression,
2486  AsmUnaryPlus | AsmUnaryMinus | AsmUnaryRrx | AsmUnaryTruncate | AsmUnarySignedExtend
2487  | AsmUnaryUnsignedExtend,
2488  "AsmUnaryExpression", "AsmUnaryExpressionTag", false);
2489  AsmUnaryExpression.setCppCondition("!defined(DOCUMENTATION)");
2490  IS_SERIALIZABLE(AsmUnaryExpression);
2491 
2492 #ifdef DOCUMENTATION
2493 
2495  public:
2496 #endif
2497 
2498 #ifdef DOCUMENTATION
2499 
2502  SgAsmExpression* get_operand() const;
2505 #else
2506  AsmUnaryExpression.setDataPrototype("SgAsmExpression*", "operand", "= NULL",
2507  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
2508 #endif
2509 
2510  DECLARE_OTHERS(AsmUnaryExpression);
2511 #if defined(SgAsmUnaryExpression_OTHERS) || defined(DOCUMENTATION)
2512 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2513  private:
2514  friend class boost::serialization::access;
2515 
2516  template<class S>
2517  void serialize(S &s, const unsigned /*version*/) {
2518  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExpression);
2519  s & BOOST_SERIALIZATION_NVP(p_operand);
2520  }
2521 #endif
2522 #endif // SgAsmUnaryExpression_OTHERS
2523 
2524 #ifdef DOCUMENTATION
2525  };
2526 #endif
2527 
2529 
2530  DECLARE_LEAF_CLASS(AsmDirectRegisterExpression);
2531  IS_SERIALIZABLE(AsmDirectRegisterExpression);
2532 
2533 #ifdef DOCUMENTATION
2534 
2536  public:
2537 #endif
2538 
2539  DECLARE_OTHERS(AsmDirectRegisterExpression);
2540 #if defined(SgAsmDirectRegisterExpression_OTHERS) || defined(DOCUMENTATION)
2541 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2542  private:
2543  friend class boost::serialization::access;
2544 
2545  template<class S>
2546  void serialize(S &s, const unsigned /*version*/) {
2547  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmRegisterReferenceExpression);
2548  }
2549 #endif
2550 
2551  private:
2552  // Default c'tor needed for serialization
2554 #endif // SgAsmDirectRegisterExpression_OTHERS
2555 
2556 #ifdef DOCUMENTATION
2557  };
2558 #endif
2559 
2561 
2562  DECLARE_LEAF_CLASS(AsmIndirectRegisterExpression);
2563  IS_SERIALIZABLE(AsmIndirectRegisterExpression);
2564 
2565 #ifdef DOCUMENTATION
2566 
2583  public:
2584 #endif
2585 
2586 #ifdef DOCUMENTATION
2587 
2595 #else
2596  AsmIndirectRegisterExpression.setDataPrototype("Rose::BinaryAnalysis::RegisterDescriptor", "stride", "",
2597  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2598 #endif
2599 
2600 #ifdef DOCUMENTATION
2601 
2609 #else
2610  AsmIndirectRegisterExpression.setDataPrototype("Rose::BinaryAnalysis::RegisterDescriptor", "offset", "",
2611  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2612 #endif
2613 
2614 #ifdef DOCUMENTATION
2615 
2620  size_t get_index() const;
2621  void set_index(size_t);
2623 #else
2624  AsmIndirectRegisterExpression.setDataPrototype("size_t", "index", "",
2625  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2626 #endif
2627 
2628 #ifdef DOCUMENTATION
2629 
2634  size_t get_modulus() const;
2635  void set_modulus(size_t);
2637 #else
2638  AsmIndirectRegisterExpression.setDataPrototype("size_t", "modulus", "",
2639  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2640 #endif
2641 
2642  DECLARE_OTHERS(AsmIndirectRegisterExpression);
2643 #if defined(SgAsmIndirectRegisterExpression_OTHERS) || defined(DOCUMENTATION)
2644 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2645  private:
2646  friend class boost::serialization::access;
2647 
2648  template<class S>
2649  void serialize(S &s, const unsigned /*version*/) {
2650  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmRegisterReferenceExpression);
2651  s & BOOST_SERIALIZATION_NVP(p_stride);
2652  s & BOOST_SERIALIZATION_NVP(p_offset);
2653  s & BOOST_SERIALIZATION_NVP(p_index);
2654  s & BOOST_SERIALIZATION_NVP(p_modulus);
2655  }
2656 #endif
2657 
2658  private:
2659  // Default c'tor needed for serialization
2661  : p_index(0), p_modulus(0) {}
2662 #endif // SgAsmIndirectRegisterExpression_OTHERS
2663 
2664 #ifdef DOCUMENTATION
2665  };
2666 #endif
2667 
2669 
2670  NEW_NONTERMINAL_MACRO(AsmRegisterReferenceExpression, AsmDirectRegisterExpression|AsmIndirectRegisterExpression,
2671  "AsmRegisterReferenceExpression", "AsmRegisterReferenceExpressionTag", false);
2672  AsmRegisterReferenceExpression.setCppCondition("!defined(DOCUMENTATION)");
2673  IS_SERIALIZABLE(AsmRegisterReferenceExpression);
2674 
2675 #ifdef DOCUMENTATION
2676 
2678  public:
2679 #endif
2680 
2681 #ifdef DOCUMENTATION
2682 
2688 #else
2689  AsmRegisterReferenceExpression.setDataPrototype("Rose::BinaryAnalysis::RegisterDescriptor", "descriptor", "",
2690  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2691 #endif
2692 
2693 #ifdef DOCUMENTATION
2694 
2699  int get_adjustment() const;
2700  void set_adjustment(int);
2702 #else
2703  AsmRegisterReferenceExpression.setDataPrototype("int", "adjustment", "=0",
2704  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL,
2705  NO_DELETE);
2706 #endif
2707 
2708  DECLARE_OTHERS(AsmRegisterReferenceExpression);
2709 #if defined(SgAsmRegisterReferenceExpression_OTHERS) || defined(DOCUMENTATION)
2710 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2711  private:
2712  friend class boost::serialization::access;
2713 
2714  template<class S>
2715  void serialize(S &s, const unsigned /*version*/) {
2716  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExpression);
2717  s & BOOST_SERIALIZATION_NVP(p_descriptor);
2718  s & BOOST_SERIALIZATION_NVP(p_adjustment);
2719  }
2720 #endif
2721 
2722  protected:
2723  // Default c'tor needed for serialization
2725  : p_adjustment(0) {}
2726 #endif // SgAsmRegisterReferenceExpression_OTHERS
2727 
2728 #ifdef DOCUMENTATION
2729  };
2730 #endif
2731 
2733 
2734 // DQ (11/1/2021): Adding support for stack expressions for CIL and JVM.
2735 
2736  DECLARE_LEAF_CLASS(AsmStackExpression);
2737  IS_SERIALIZABLE(AsmStackExpression);
2738 
2739 #ifdef DOCUMENTATION
2740 
2742  public:
2743 #endif
2744 
2745 #ifdef DOCUMENTATION
2746 
2751  int get_stack_position() const;
2752  void set_stack_position(int);
2754 #else
2755  AsmStackExpression.setDataPrototype("int", "stack_position", "= 0", CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2756 #endif
2757 
2758  DECLARE_OTHERS(AsmStackExpression);
2759 #if defined(SgAsmStackExpression_OTHERS) || defined(DOCUMENTATION)
2760 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2761  private:
2762  friend class boost::serialization::access;
2763 
2764  template<class S>
2765  void serialize(S &s, const unsigned /*version*/) {
2766  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExpression);
2767  s & BOOST_SERIALIZATION_NVP(p_stack_position);
2768  }
2769 #endif
2770 
2771 #endif // SgAsmStackExpression_OTHERS
2772 
2773 #ifdef DOCUMENTATION
2774  };
2775 #endif
2776 
2778 
2779  DECLARE_LEAF_CLASS(AsmRegisterNames);
2780  IS_SERIALIZABLE(AsmRegisterNames);
2781 
2782 #ifdef DOCUMENTATION
2783 
2785  public:
2786 #endif
2787 
2788 #ifdef DOCUMENTATION
2789 
2795  const SgAsmRegisterReferenceExpressionPtrList& get_registers() const;
2796  void set_registers(const SgAsmRegisterReferenceExpressionPtrList&);
2798 #else
2799  AsmRegisterNames.setDataPrototype("SgAsmRegisterReferenceExpressionPtrList", "registers", "",
2800  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
2801 #endif
2802 
2803 #ifdef DOCUMENTATION
2804 
2810  unsigned get_mask() const;
2811  void set_mask(unsigned);
2813 #else
2814  AsmRegisterNames.setDataPrototype("unsigned", "mask", "=0",
2815  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2816 #endif
2817 
2818  DECLARE_OTHERS(AsmRegisterNames);
2819 #if defined(SgAsmRegisterNames_OTHERS) || defined(DOCUMENTATION)
2820 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2821  private:
2822  friend class boost::serialization::access;
2823 
2824  template<class S>
2825  void serialize(S &s, const unsigned /*version*/) {
2826  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExpression);
2827  s & BOOST_SERIALIZATION_NVP(p_registers);
2828  s & BOOST_SERIALIZATION_NVP(p_mask);
2829  }
2830 #endif
2831 #endif // SgAsmRegisterNames_OTHERS
2832 
2833 #ifdef DOCUMENTATION
2834  };
2835 #endif
2836 
2838 
2839  DECLARE_LEAF_CLASS(AsmIntegerValueExpression);
2840  IS_SERIALIZABLE(AsmIntegerValueExpression);
2841 
2842 #ifdef DOCUMENTATION
2843 
2859  public:
2860 #endif
2861 
2862 #ifdef DOCUMENTATION
2863 
2873  SgNode* get_baseNode() const;
2874  void set_baseNode(SgNode*);
2876 #else
2877  AsmIntegerValueExpression.setDataPrototype("SgNode*", "baseNode", "=NULL",
2878  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
2879 #endif
2880 
2881  DECLARE_OTHERS(AsmIntegerValueExpression);
2882 #if defined(SgAsmIntegerValueExpression_OTHERS) || defined(DOCUMENTATION)
2883 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
2884  private:
2885  friend class boost::serialization::access;
2886 
2887  template<class S>
2888  void serialize(S &s, const unsigned /*version*/) {
2889  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmConstantExpression);
2890  s & BOOST_SERIALIZATION_NVP(p_baseNode);
2891  }
2892 #endif
2893 
2894  public:
2899  SgAsmIntegerValueExpression(uint64_t n, SgAsmType *type);
2900 
2907 
2909  static uint64_t virtualAddress(SgNode*);
2910 
2930  std::string get_label(bool quiet=false) const;
2931 
2933  size_t get_significantBits() const;
2934 
2940  void makeRelativeTo(SgNode *baseNode);
2941 
2946  uint64_t get_baseAddress() const;
2947 
2953  uint64_t get_absoluteValue(size_t nbits=0) const;
2954 
2958  void set_absoluteValue(uint64_t);
2959 
2961  int64_t get_signedValue() const;
2962 
2966  int64_t get_relativeValue() const;
2967 
2972  void set_relativeValue(int64_t v, size_t nbits=64);
2973 
2974  uint64_t get_value() const { return get_absoluteValue(); }
2975 
2976 #endif // SgAsmIntegerValueExpression_OTHERS
2977 
2978 #ifdef DOCUMENTATION
2979  };
2980 #endif
2981 
2983 
2984  DECLARE_LEAF_CLASS(AsmFloatValueExpression);
2985  IS_SERIALIZABLE(AsmFloatValueExpression);
2986 
2987 #ifdef DOCUMENTATION
2988 
2993  public:
2994 #endif
2995 
2996  AsmFloatValueExpression.setAutomaticGenerationOfConstructor(false); // so p_nativeValue cache can be initialized
2997 
2998  DECLARE_OTHERS(AsmFloatValueExpression);
2999 #if defined(SgAsmFloatValueExpression_OTHERS) || defined(DOCUMENTATION)
3000  private:
3001  // This node stores its primary representation of the value in the p_bitVector of a parent class. However, since we
3002  // often access the value as a native "double", and since converting to/from a bit vector is costly, we want to cache
3003  // the native double value whenever we compute it. ROSETTA does not need to be aware of the cached value since it can
3004  // be recomputed from the bit vector, and in fact, ROSETTA can't handle cache data members because it doesn't
3005  // understand "mutable".
3006  mutable double p_nativeValue;
3007  mutable bool p_nativeValueIsValid;
3008 
3009 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
3010  private:
3011  friend class boost::serialization::access;
3012 
3013  template<class S>
3014  void serialize(S &s, const unsigned /*version*/) {
3015  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmConstantExpression);
3016  s & BOOST_SERIALIZATION_NVP(p_nativeValue);
3017  s & BOOST_SERIALIZATION_NVP(p_nativeValueIsValid);
3018  }
3019 #endif
3020 
3021  public:
3026  SgAsmFloatValueExpression(): p_nativeValue(0.0), p_nativeValueIsValid(true) {}
3027 
3033  SgAsmFloatValueExpression(double nativeValue, SgAsmType*);
3034 
3041 
3043  void set_nativeValue(double);
3044 
3046  double get_nativeValue() const;
3047 
3052  void updateBitVector();
3053 
3058  void updateNativeValue() const;
3059 #endif // SgAsmFloatValueExpression_OTHERS
3060 
3061 #ifdef DOCUMENTATION
3062  };
3063 #endif
3064 
3066 #ifdef ROSE_ENABLE_ASM_AARCH32
3067  DECLARE_LEAF_CLASS(AsmAarch32Coprocessor);
3068  IS_SERIALIZABLE(AsmAarch32Coprocessor);
3069 
3070 #ifdef DOCUMENTATION
3071 
3072  class SgAsmAarch32Coprocessor: public SgAsmExpression {
3073  public:
3074 #endif
3075 
3076  DECLARE_OTHERS(AsmAarch32Coprocessor);
3077 #if defined(SgAsmAarch32Coprocessor_OTHERS) || defined(DOCUMENTATION)
3078 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
3079  private:
3080  friend class boost::serialization::access;
3081 
3082  template<class S>
3083  void serialize(S & s, const unsigned /*version*/) {
3084  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExpression);
3085  s & BOOST_SERIALIZATION_NVP(coprocessor_);
3086  }
3087 #endif
3088 
3089  private:
3090  int coprocessor_;
3091 
3092  public:
3093  explicit SgAsmAarch32Coprocessor(int coprocessor)
3094  : coprocessor_(coprocessor) {}
3095 
3099  int coprocessor() const { return coprocessor_; }
3100  void coprocessor(int n) { coprocessor_ = n; }
3102 #endif // SgAsmAarch32Coprocessor_OTHERS
3103 
3104 #ifdef DOCUMENTATION
3105  };
3106 #endif
3107 #endif
3108 
3110  DECLARE_LEAF_CLASS(AsmByteOrder);
3111  IS_SERIALIZABLE(AsmByteOrder);
3112 
3113 #ifdef DOCUMENTATION
3114 
3116  public:
3117 #endif
3118 
3119  DECLARE_OTHERS(AsmByteOrder);
3120 #if defined(SgAsmByteOrder_OTHERS) || defined(DOCUMENTATION)
3121 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
3122  private:
3123  friend class boost::serialization::access;
3124 
3125  template<class S>
3126  void serialize(S & s, const unsigned /*version*/) {
3127  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExpression);
3128  s & BOOST_SERIALIZATION_NVP(byteOrder_);
3129  }
3130 #endif
3131 
3132  private:
3133  ByteOrder::Endianness byteOrder_;
3134 
3135  public:
3136  explicit SgAsmByteOrder(ByteOrder::Endianness byteOrder)
3137  : byteOrder_(byteOrder) {}
3138 
3142  ByteOrder::Endianness byteOrder() const { return byteOrder_; }
3143  void byteOrder(ByteOrder::Endianness sex) { byteOrder_ = sex; }
3145 #endif // SgAsmByteOrder_OTHERS
3146 
3147 #ifdef DOCUMENTATION
3148  };
3149 #endif
3150 
3152 
3153  NEW_NONTERMINAL_MACRO(AsmConstantExpression,
3154  AsmIntegerValueExpression | AsmFloatValueExpression,
3155  "AsmConstantExpression", "AsmConstantExpressionTag", false);
3156  AsmConstantExpression.setCppCondition("!defined(DOCUMENTATION)");
3157  IS_SERIALIZABLE(AsmConstantExpression);
3158 
3159  DECLARE_HEADERS(AsmConstantExpression);
3160 #if defined(SgAsmConstantExpression_HEADERS) || defined(DOCUMENTATION)
3161  #include <Sawyer/BitVector.h>
3162 #endif // SgAsmConstantExpression_HEADERS
3163 
3164 #ifdef DOCUMENTATION
3165 
3170  public:
3171 #endif
3172 
3173 #ifndef DOCUMENTATION
3174  // Documented below. Implemented below due to ROSETTA limitations.
3175  AsmConstantExpression.setDataPrototype("Sawyer::Container::BitVector", "bitVector", "",
3176  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3177 #endif
3178 
3179  DECLARE_OTHERS(AsmConstantExpression);
3180 #if defined(SgAsmConstantExpression_OTHERS) || defined(DOCUMENTATION)
3181 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
3182  private:
3183  friend class boost::serialization::access;
3184 
3185  template<class S>
3186  void serialize(S &s, const unsigned /*version*/) {
3187  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmValueExpression);
3188  s & BOOST_SERIALIZATION_NVP(p_bitVector);
3189  }
3190 #endif
3191 
3192  public:
3198  const Sawyer::Container::BitVector& get_bitVector() const { return p_bitVector; }
3199  Sawyer::Container::BitVector& get_bitVector() { return p_bitVector; }
3200  void set_bitVector(const Sawyer::Container::BitVector &bv) { p_bitVector = bv; }
3202 #endif // SgAsmConstantExpression_OTHERS
3203 
3204 #ifdef DOCUMENTATION
3205  };
3206 #endif
3207 
3209 
3210  NEW_NONTERMINAL_MACRO(AsmValueExpression,
3211  AsmConstantExpression,
3212  "AsmValueExpression", "AsmValueExpressionTag", false);
3213  AsmValueExpression.setCppCondition("!defined(DOCUMENTATION)");
3214  IS_SERIALIZABLE(AsmValueExpression);
3215 
3216 #ifdef DOCUMENTATION
3217 
3225  public:
3226 #endif
3227 
3228 #ifdef DOCUMENTATION
3229 
3239 #else
3240  AsmValueExpression.setDataPrototype("SgAsmValueExpression*", "unfolded_expression_tree", "= NULL",
3241  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
3242 #endif
3243 
3244 #ifdef DOCUMENTATION
3245 
3253  unsigned short get_bit_offset() const;
3254  void set_bit_offset(unsigned short);
3256 #else
3257  AsmValueExpression.setDataPrototype("unsigned short", "bit_offset", "= 0", // DOXYGEN
3258  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3259 #endif
3260 
3261 #ifdef DOCUMENTATION
3262 
3268  unsigned short get_bit_size() const;
3269  void set_bit_size(unsigned short);
3271 #else
3272  AsmValueExpression.setDataPrototype("unsigned short", "bit_size", "= 0", // DOXYGEN
3273  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3274 #endif
3275 
3276 #ifdef DOCUMENTATION
3277 
3283  SgSymbol* get_symbol() const;
3284  void set_symbol(SgSymbol*);
3286 #else
3287  AsmValueExpression.setDataPrototype("SgSymbol*", "symbol", "= NULL",
3288  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3289 #endif
3290 
3291  DECLARE_OTHERS(AsmValueExpression);
3292 #if defined(SgAsmValueExpression_OTHERS) || defined(DOCUMENTATION)
3293 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
3294  private:
3295  friend class boost::serialization::access;
3296 
3297  template<class S>
3298  void serialize(S &s, const unsigned /*version*/) {
3299  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExpression);
3300  s & BOOST_SERIALIZATION_NVP(p_unfolded_expression_tree);
3301  s & BOOST_SERIALIZATION_NVP(p_bit_offset);
3302  s & BOOST_SERIALIZATION_NVP(p_bit_size);
3303 #if 1
3304  ASSERT_require2(p_symbol == NULL, "not implemented yet");
3305 #else
3306  s & BOOST_SERIALIZATION_NVP(p_symbol);
3307 #endif
3308  }
3309 #endif
3310 #endif // SgAsmValueExpression_OTHERS
3311 
3312 #ifdef DOCUMENTATION
3313  };
3314 #endif
3315 
3317 
3318  DECLARE_LEAF_CLASS(AsmMemoryReferenceExpression);
3319  IS_SERIALIZABLE(AsmMemoryReferenceExpression);
3320 
3321 #ifdef DOCUMENTATION
3322 
3324  public:
3325 #endif
3326 
3327 #ifdef DOCUMENTATION
3328 
3335  SgAsmExpression* get_address() const;
3338 #else
3339  AsmMemoryReferenceExpression.setDataPrototype("SgAsmExpression*", "address", "= NULL",
3340  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
3341 #endif
3342 
3343 #ifdef DOCUMENTATION
3344 
3351  SgAsmExpression* get_segment() const;
3354 #else
3355  AsmMemoryReferenceExpression.setDataPrototype("SgAsmExpression*", "segment", "= NULL",
3356  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
3357 #endif
3358 
3359  DECLARE_OTHERS(AsmMemoryReferenceExpression);
3360 #if defined(SgAsmMemoryReferenceExpression_OTHERS) || defined(DOCUMENTATION)
3361 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
3362  private:
3363  friend class boost::serialization::access;
3364 
3365  template<class S>
3366  void serialize(S &s, const unsigned /*version*/) {
3367  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExpression);
3368  s & BOOST_SERIALIZATION_NVP(p_address);
3369  s & BOOST_SERIALIZATION_NVP(p_segment);
3370  }
3371 #endif
3372 #endif // SgAsmMemoryReferenceExpression_OTHERS
3373 
3374 #ifdef DOCUMENTATION
3375  };
3376 #endif
3377 
3379 
3380  DECLARE_LEAF_CLASS(AsmControlFlagsExpression);
3381  IS_SERIALIZABLE(AsmControlFlagsExpression);
3382 
3383 #ifdef DOCUMENTATION
3384  // FIXME[Robb P Matzke 2016-10-31]: no idea what this is
3386  public:
3387 #endif
3388 
3389 #ifndef DOCUMENTATION
3390  AsmControlFlagsExpression.setDataPrototype("unsigned long", "bit_flags", "= 0",
3391  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3392 #endif
3393 
3394  DECLARE_OTHERS(AsmControlFlagsExpression);
3395 #if defined(SgAsmControlFlagsExpression_OTHERS) || defined(DOCUMENTATION)
3396 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
3397  private:
3398  friend class boost::serialization::access;
3399 
3400  template<class S>
3401  void serialize(S &s, const unsigned /*version*/) {
3402  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExpression);
3403  s & BOOST_SERIALIZATION_NVP(p_bit_flags);
3404  }
3405 #endif
3406 #endif // SgAsmControlFlagsExpression_OTHERS
3407 
3408 #ifdef DOCUMENTATION
3409  };
3410 #endif
3411 
3413 
3414  DECLARE_LEAF_CLASS(AsmCommonSubExpression);
3415  IS_SERIALIZABLE(AsmCommonSubExpression);
3416 
3417 #ifdef DOCUMENTATION
3418  // FIXME[Robb P Matzke 2016-10-31]: no idea what this is
3420  public:
3421 #endif
3422 
3423 #ifndef DOCUMENTATION
3424  AsmCommonSubExpression.setDataPrototype("SgAsmExpression*", "subexpression", "= 0",
3425  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
3426 #endif
3427 
3428  DECLARE_OTHERS(AsmCommonSubExpression);
3429 #if defined(SgAsmCommonSubExpression_OTHERS) || defined(DOCUMENTATION)
3430 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
3431  private:
3432  friend class boost::serialization::access;
3433 
3434  template<class S>
3435  void serialize(S &s, const unsigned /*version*/) {
3436  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExpression);
3437  s & BOOST_SERIALIZATION_NVP(p_subexpression);
3438  }
3439 #endif
3440 #endif // SgAsmCommonSubExpression_OTHERS
3441 
3442 #ifdef DOCUMENTATION
3443  };
3444 #endif
3445 
3447 
3448  DECLARE_LEAF_CLASS(AsmRiscOperation);
3449  IS_SERIALIZABLE(AsmRiscOperation);
3450 
3451 #ifdef DOCUMENTATION
3452 
3461  public:
3462 #endif
3463 
3464 #ifdef DOCUMENTATION
3465 
3474 #else
3475  AsmRiscOperation.setDataPrototype("SgAsmRiscOperation::RiscOperator", "riscOperator", "= SgAsmRiscOperation::OP_NONE",
3476  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
3477 #endif
3478 
3479 #ifdef DOCUMENTATION
3480 
3486  SgAsmExprListExp* get_operands() const;
3489 #else
3490  AsmRiscOperation.setDataPrototype("SgAsmExprListExp*", "operands", "= NULL",
3491  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
3492 #endif
3493 
3494  DECLARE_OTHERS(AsmRiscOperation);
3495 #if defined(SgAsmRiscOperation_OTHERS) || defined(DOCUMENTATION)
3496  public:
3503  OP_NONE,
3504  OP_bottom,
3505  OP_undefined,
3506  OP_unspecified,
3507  OP_filterCallTarget,
3508  OP_filterReturnTarget,
3509  OP_filterIndirectJumpTarget,
3510  OP_hlt,
3511  OP_cpuid,
3512  OP_rdtsc,
3513  OP_and_,
3514  OP_or_,
3515  OP_xor_,
3516  OP_invert,
3517  OP_extract,
3518  OP_concat,
3519  OP_leastSignificantSetBit,
3520  OP_mostSignificantSetBit,
3521  OP_rotateLeft,
3522  OP_rotateRight,
3523  OP_shiftLeft,
3524  OP_shiftRight,
3525  OP_shiftRightArithmetic,
3526  OP_equalToZero,
3527  OP_ite,
3528  OP_isEqual,
3529  OP_isNotEqual,
3530  OP_isUnsignedLessThan,
3531  OP_isUnsignedLessThanOrEqual,
3532  OP_isUnsignedGreaterThan,
3533  OP_isUnsignedGreaterThanOrEqual,
3534  OP_isSignedLessThan,
3535  OP_isSignedLessThanOrEqual,
3536  OP_isSignedGreaterThan,
3537  OP_isSignedGreaterThanOrEqual,
3538  OP_unsignedExtend,
3539  OP_signExtend,
3542  OP_subtract,
3543  OP_negate,
3544  OP_signedDivide,
3545  OP_signedModulo,
3546  OP_signedMultiply,
3547  OP_unsignedDivide,
3548  OP_unsignedModulo,
3549  OP_unsignedMultiply,
3550  OP_interrupt,
3551  OP_readRegister,
3552  OP_peekRegister,
3553  OP_writeRegister,
3555  OP_peekMemory,
3557  OP_N_OPERATORS // MUST BE LAST!
3558  };
3559 
3560 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
3561  private:
3562  friend class boost::serialization::access;
3563 
3564  template<class S>
3565  void serialize(S &s, const unsigned /*version*/) {
3566  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExpression);
3567  s & BOOST_SERIALIZATION_NVP(p_riscOperator);
3568  s & BOOST_SERIALIZATION_NVP(p_operands);
3569  }
3570 #endif
3571 #endif // SgAsmRiscOperation_OTHERS
3572 
3573 #ifdef DOCUMENTATION
3574  };
3575 #endif
3576 
3578 
3579  DECLARE_LEAF_CLASS(AsmExprListExp);
3580  IS_SERIALIZABLE(AsmExprListExp);
3581 
3582 #ifdef DOCUMENTATION
3583 
3585  public:
3586 #endif
3587 
3588 #ifdef DOCUMENTATION
3589 
3595  const SgAsmExpressionPtrList& get_expressions() const;
3596  void set_expressions(const SgAsmExpressionPtrList&);
3598 #else
3599  AsmExprListExp.setDataPrototype("SgAsmExpressionPtrList", "expressions", "",
3600  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
3601 #endif
3602 
3603  DECLARE_OTHERS(AsmExprListExp);
3604 #if defined(SgAsmExprListExp_OTHERS) || defined(DOCUMENTATION)
3605 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
3606  private:
3607  friend class boost::serialization::access;
3608 
3609  template<class S>
3610  void serialize(S &s, const unsigned /*version*/) {
3611  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExpression);
3612  s & BOOST_SERIALIZATION_NVP(p_expressions);
3613  }
3614 #endif
3615 #endif // SgAsmExprListExp_OTHERS
3616 
3617 #ifdef DOCUMENTATION
3618  };
3619 #endif
3620 
3622 
3623  // DQ (11/1/2021): Added AsmStackExpression.
3624  NEW_NONTERMINAL_MACRO(AsmExpression,
3625  AsmValueExpression | AsmBinaryExpression | AsmUnaryExpression |
3626  AsmMemoryReferenceExpression | AsmRegisterReferenceExpression | AsmControlFlagsExpression |
3627  AsmCommonSubExpression | AsmExprListExp | AsmRegisterNames |
3628  AsmRiscOperation | AsmStackExpression
3629 #ifdef ROSE_ENABLE_ASM_AARCH64
3630  | AsmAarch64AtOperand | AsmAarch64PrefetchOperand | AsmAarch64SysMoveOperand
3631  | AsmAarch64CImmediateOperand | AsmAarch64BarrierOperand
3632 #endif
3633 #ifdef ROSE_ENABLE_ASM_AARCH32
3634  | AsmAarch32Coprocessor
3635 #endif
3636  | AsmByteOrder,
3637  "AsmExpression", "AsmExpressionTag", false);
3638  AsmExpression.setCppCondition("!defined(DOCUMENTATION)");
3639  IS_SERIALIZABLE(AsmExpression);
3640 
3641 #ifdef DOCUMENTATION
3642 
3643  class SgAsmExpression: public SgAsmNode {
3644  public:
3645 #endif
3646 
3647 #ifdef DOCUMENTATION
3648 
3653  SgAsmType* get_type() const;
3654  void set_type(SgAsmType*);
3656 #else
3657  AsmExpression.setDataPrototype("SgAsmType*", "type", "= NULL",
3658  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3659 #endif
3660 
3661 #ifdef DOCUMENTATION
3662 
3667  const std::string& get_comment() const;
3668  void set_comment(const std::string&);
3670 #else
3671  AsmExpression.setDataPrototype("std::string", "comment", "= \"\"",
3672  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3673 #endif
3674 
3675  DECLARE_OTHERS(AsmExpression);
3676 #if defined(SgAsmExpression_OTHERS) || defined(DOCUMENTATION)
3677 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
3678  private:
3679  friend class boost::serialization::access;
3680 
3681  template<class S>
3682  void serialize(S &s, const unsigned /*version*/) {
3683  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmNode);
3684  s & BOOST_SERIALIZATION_NVP(p_type);
3685  s & BOOST_SERIALIZATION_NVP(p_comment);
3686  }
3687 #endif
3688 
3689  public:
3693  size_t get_nBits() const;
3694 
3700 
3706 
3707 #endif // SgAsmExpression_OTHERS
3708 
3709 #ifdef DOCUMENTATION
3710  };
3711 #endif
3712 
3713 
3714 
3715 
3717 
3718  /***************************************************************************************************************************
3719  * Data Types (new interface 2014-07)
3720  *
3721  * Data types are generally read-only objects because we need to be able to test type equality by testing pointer
3722  * equality. This is a basic features of ROSE: two types are equal if their pointers are equal. The inverse should also
3723  * be true, which means that when we ask for a particular type we get the same pointer as before. This can only work if we
3724  * don't allow types to be modified after they're created.
3725  ***************************************************************************************************************************/
3726 
3728 
3729  DECLARE_LEAF_CLASS(AsmIntegerType);
3730  IS_SERIALIZABLE(AsmIntegerType);
3731 
3732 #ifdef DOCUMENTATION
3733 
3735  public:
3736 #endif
3737 
3738 #ifndef DOCUMENTATION
3739  // Documented below due to ROSETTA limitations
3740  AsmIntegerType.setDataPrototype("bool", "isSigned", "=false", // read-only
3741  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3742 #endif
3743 
3744  DECLARE_OTHERS(AsmIntegerType);
3745 #if defined(SgAsmIntegerType_OTHERS) || defined(DOCUMENTATION)
3746 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
3747  private:
3748  friend class boost::serialization::access;
3749 
3750  template<class S>
3751  void serialize(S &s, const unsigned /*version*/) {
3752  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmScalarType);
3753  s & BOOST_SERIALIZATION_NVP(p_isSigned);
3754  }
3755 #endif
3756 
3757  public:
3761  SgAsmIntegerType(ByteOrder::Endianness, size_t nBits, bool isSigned);
3762 
3766  bool get_isSigned() const;
3767 
3768  // Overrides documented in base class
3769  virtual void check() const override;
3770  virtual std::string toString() const override;
3771 #endif // SgAsmIntegerType_OTHERS
3772 
3773 #ifdef DOCUMENTATION
3774  };
3775 #endif
3776 
3778 
3779  DECLARE_LEAF_CLASS(AsmFloatType);
3780  IS_SERIALIZABLE(AsmFloatType);
3781 
3782  DECLARE_HEADERS(AsmFloatType);
3783 #if defined(SgAsmFloatType_HEADERS) || defined(DOCUMENTATION)
3784  #include <Sawyer/BitVector.h>
3785  #include <Rose/BitFlags.h>
3786 #endif // SgAsmFloatType_HEADERS
3787 
3788 #ifdef DOCUMENTATION
3789 
3791  public:
3792 #endif
3793 
3794 #ifndef DOCUMENTATION
3795  // Documented below because of ROSETTA limitations (they're read-only)
3796  AsmFloatType.setDataPrototype("size_t", "significandOffset", "=(size_t)(-1)", // read-only
3797  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3798  AsmFloatType.setDataPrototype("size_t", "significandNBits", "=(size_t)(-1)", // read-only
3799  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3800  AsmFloatType.setDataPrototype("size_t", "signBitOffset", "=(size_t)(-1)", // read-only
3801  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3802  AsmFloatType.setDataPrototype("size_t", "exponentOffset", "=(size_t)(-1)", // read-only
3803  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3804  AsmFloatType.setDataPrototype("size_t", "exponentNBits", "=(size_t)(-1)", // read-only
3805  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3806  AsmFloatType.setDataPrototype("uint64_t", "exponentBias", "=0", // read-only
3807  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3808  AsmFloatType.setDataPrototype("unsigned", "flags", "=0", // read-only
3809  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3810 #endif
3811 
3812  DECLARE_OTHERS(AsmFloatType);
3813 #if defined(SgAsmFloatType_OTHERS) || defined(DOCUMENTATION)
3814 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
3815  private:
3816  friend class boost::serialization::access;
3817 
3818  template<class S>
3819  void serialize(S &s, const unsigned /*version*/) {
3820  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmScalarType);
3821  s & BOOST_SERIALIZATION_NVP(p_significandOffset);
3822  s & BOOST_SERIALIZATION_NVP(p_significandNBits);
3823  s & BOOST_SERIALIZATION_NVP(p_signBitOffset);
3824  s & BOOST_SERIALIZATION_NVP(p_exponentOffset);
3825  s & BOOST_SERIALIZATION_NVP(p_exponentNBits);
3826  s & BOOST_SERIALIZATION_NVP(p_exponentBias);
3827  s & BOOST_SERIALIZATION_NVP(p_flags);
3828  }
3829 #endif
3830 
3831  public:
3833  enum Flag {
3834  GRADUAL_UNDERFLOW = 0x00000001,
3836  };
3837 
3840 
3843 
3845  SgAsmFloatType(ByteOrder::Endianness, size_t nBits,
3846  const BitRange &significandBits, const BitRange exponentBits, size_t signBit,
3847  uint64_t exponentBias, Flags flags);
3848 
3850  BitRange significandBits() const;
3851 
3853  BitRange exponentBits() const;
3854 
3856  size_t signBit() const;
3857 
3859  uint64_t exponentBias() const;
3860 
3862  Flags flags() const;
3863 
3868  static Flags ieeeFlags();
3869 
3875  bool gradualUnderflow() const;
3876 
3884  bool implicitBitConvention() const;
3885 
3888  // Overrides documented in base class
3889  virtual void check() const override;
3890  virtual std::string toString() const override;
3891 #endif // SgAsmFloatType_OTHERS
3892 
3893 #ifdef DOCUMENTATION
3894  };
3895 #endif
3896 
3898 
3899  NEW_NONTERMINAL_MACRO(AsmScalarType,
3900  AsmIntegerType | AsmFloatType,
3901  "AsmScalarType", "AsmScalarTypeTag", false);
3902  AsmScalarType.setCppCondition("!defined(DOCUMENTATION)");
3903  IS_SERIALIZABLE(AsmScalarType);
3904 
3905 #ifdef DOCUMENTATION
3906 
3907  class SgAsmScalarType: public SgAsmType {
3908  public:
3909 #endif
3910 
3911 #ifndef DOCUMENTATION
3912  // Documented below due to ROSETTA limitations (read-only)
3913  AsmScalarType.setDataPrototype("ByteOrder::Endianness", "minorOrder", "= ByteOrder::ORDER_UNSPECIFIED", // read-only
3914  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3915  AsmScalarType.setDataPrototype("ByteOrder::Endianness", "majorOrder", "= ByteOrder::ORDER_UNSPECIFIED", // read-only
3916  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3917  AsmScalarType.setDataPrototype("size_t", "majorNBytes", "=0", // read-only
3918  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3919  AsmScalarType.setDataPrototype("size_t", "nBits", "=0", // read-only
3920  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3921 #endif
3922 
3923  DECLARE_OTHERS(AsmScalarType);
3924 #if defined(SgAsmScalarType_OTHERS) || defined(DOCUMENTATION)
3925 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
3926  private:
3927  friend class boost::serialization::access;
3928 
3929  template<class S>
3930  void serialize(S &s, const unsigned /*version*/) {
3931  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmType);
3932  s & BOOST_SERIALIZATION_NVP(p_minorOrder);
3933  s & BOOST_SERIALIZATION_NVP(p_majorOrder);
3934  s & BOOST_SERIALIZATION_NVP(p_majorNBytes);
3935  s & BOOST_SERIALIZATION_NVP(p_nBits);
3936  }
3937 #endif
3938 
3939  protected:
3944  SgAsmScalarType(ByteOrder::Endianness, size_t nBits);
3945 
3946  public:
3948  virtual size_t get_nBits() const override;
3949 
3951  ByteOrder::Endianness get_minorOrder() const;
3952 
3954  ByteOrder::Endianness get_majorOrder() const;
3955 
3957  size_t get_majorNBytes() const;
3958 
3959  // Overrides documented in base class
3960  virtual void check() const override;
3961  virtual std::string toString() const override;
3962 #endif // SgAsmScalarType_OTHERS
3963 
3964 #ifdef DOCUMENTATION
3965  };
3966 #endif
3967 
3969 
3970  DECLARE_LEAF_CLASS(AsmVectorType);
3971  IS_SERIALIZABLE(AsmVectorType);
3972 
3973 #ifdef DOCUMENTATION
3974 
3975  class SgAsmVectorType: public SgAsmType {
3976  public:
3977 #endif
3978 
3979 #ifndef DOCUMENTATION
3980  // Documented below due to ROSETTA limitations (read-only)
3981  AsmVectorType.setDataPrototype("size_t", "nElmts", "=0", // read-only
3982  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3983  AsmVectorType.setDataPrototype("SgAsmType*", "elmtType", "=NULL", // read-only
3984  NO_CONSTRUCTOR_PARAMETER, NO_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
3985 #endif
3986 
3987  DECLARE_OTHERS(AsmVectorType);
3988 #if defined(SgAsmVectorType_OTHERS) || defined(DOCUMENTATION)
3989 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
3990  private:
3991  friend class boost::serialization::access;
3992 
3993  template<class S>
3994  void serialize(S &s, const unsigned /*version*/) {
3995  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmType);
3996  s & BOOST_SERIALIZATION_NVP(p_nElmts);
3997  s & BOOST_SERIALIZATION_NVP(p_elmtType);
3998  }
3999 #endif
4000 
4001  public:
4003  SgAsmVectorType(size_t nElmts, SgAsmType *elmtType);
4004 
4006  size_t get_nElmts() const;
4007 
4009  SgAsmType* get_elmtType() const;
4010 
4011  // Overrides documented in base class
4012  virtual void check() const override;
4013  virtual std::string toString() const override;
4014  virtual size_t get_nBits() const override;
4015 #endif // SgAsmVectorType_OTHERS
4016 
4017 #ifdef DOCUMENTATION
4018  };
4019 #endif
4020 
4022 
4023  NEW_NONTERMINAL_MACRO(AsmType, AsmScalarType | AsmVectorType, "AsmType", "AsmTypeTag", false);
4024  AsmType.setCppCondition("!defined(DOCUMENTATION)");
4025  IS_SERIALIZABLE(AsmType);
4026 
4027 #ifdef DOCUMENTATION
4028 
4029  class SgAsmType: public SgAsmNode {
4030  public:
4031 #endif
4032 
4033  DECLARE_OTHERS(AsmType);
4034 #if defined(SgAsmType_OTHERS) || defined(DOCUMENTATION)
4035  private:
4037 
4038 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
4039  private:
4040  friend class boost::serialization::access;
4041 
4042  template<class S>
4043  void serialize(S &s, const unsigned /*version*/) {
4044  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmNode);
4045  }
4046 #endif
4047 
4048  public:
4056  virtual void check() const;
4057 
4063  virtual std::string toString() const {
4064  abort(); // ROSETTA limitation: intended pure virtual
4065  return NULL; // Windows limitation: return value required [Too, 2014-08-11]
4066  }
4067 
4069  virtual size_t get_nBits() const {
4070  abort(); // ROSETTA limitation: intended pure virtual
4071  return (size_t)-1; // Windows limitation: return value required [Too, 2014-08-11]
4072  }
4073 
4075  virtual size_t get_nBytes() const;
4076 
4082  template<class Type> // Type is a subclass of SgAsmType
4083  static Type* registerOrDelete(Type *toInsert) {
4084  ASSERT_not_null(toInsert);
4085  std::string key = toInsert->toString();
4086  Type *retval = dynamic_cast<Type*>(p_typeRegistry.insertMaybe(key, toInsert));
4087  ASSERT_not_null(retval);
4088  if (retval!=toInsert)
4089  delete toInsert;
4090  return retval;
4091  }
4092 #endif // SgAsmType_OTHERS
4093 
4094 #ifdef DOCUMENTATION
4095  };
4096 #endif
4097 
4098 
4099 
4101 
4102  /**************************************************************************************************************************
4103  * Collections of Instructions
4104  **************************************************************************************************************************/
4105 
4107 
4108  DECLARE_LEAF_CLASS(AsmFunction);
4109  IS_SERIALIZABLE(AsmFunction);
4110 
4111 #ifdef DOCUMENTATION
4112 
4128  public:
4129 #endif
4130 
4131 #ifdef DOCUMENTATION
4132 
4137  const std::string& get_name() const;
4138  void set_name(const std::string&);
4140 #else
4141  AsmFunction.setDataPrototype("std::string", "name", "= \"\"",
4142  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4143 #endif
4144 
4145 #ifdef DOCUMENTATION
4146 
4152  unsigned get_reason() const;
4153  void set_reason(unsigned);
4155 #else
4156  AsmFunction.setDataPrototype("unsigned", "reason", "= SgAsmFunction::FUNC_NONE", /*bit flags*/
4157  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4158 #endif
4159 
4160 #ifdef DOCUMENTATION
4161 
4168  const std::string& get_reasonComment() const;
4169  void set_reasonComment(const std::string&);
4171 #else
4172  AsmFunction.setDataPrototype("std::string", "reasonComment", "",
4173  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4174 #endif
4175 
4176 #ifdef DOCUMENTATION
4177 
4185 #else
4186  AsmFunction.setDataPrototype("SgAsmFunction::function_kind_enum", "function_kind", "= SgAsmFunction::e_unknown",
4187  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
4188 #endif
4189 
4190 #ifdef DOCUMENTATION
4191 
4194  MayReturn get_may_return() const;
4195  void set_may_return(MayReturn);
4197 #else
4198  AsmFunction.setDataPrototype("SgAsmFunction::MayReturn", "may_return", "= SgAsmFunction::RET_UNKNOWN",
4199  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4200 #endif
4201 
4202 #ifdef DOCUMENTATION
4203 
4208  const std::string& get_name_md5() const;
4209  void set_name_md5(const std::string&);
4211 #else
4212  AsmFunction.setDataPrototype("std::string", "name_md5", "= \"\"",
4213  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4214 #endif
4215 
4216 #ifdef DOCUMENTATION
4217 
4222  const SgAsmStatementPtrList& get_statementList() const;
4223  void set_statementList(const SgAsmStatementPtrList&);
4225 #else
4226  AsmFunction.setDataPrototype("SgAsmStatementPtrList", "statementList", "",
4227  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
4228 #endif
4229 
4230 #ifdef DOCUMENTATION
4231  // FIXME[Robb P Matzke 2017-02-13]: unused?
4232 #else
4233  AsmFunction.setDataPrototype("SgAsmStatementPtrList", "dest", "",
4234  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4235 #endif
4236 
4237 #ifdef DOCUMENTATION
4238 
4244  rose_addr_t get_entry_va() const;
4245  void set_entry_va(rose_addr_t);
4247 #else
4248  AsmFunction.setDataPrototype("rose_addr_t", "entry_va", "= 0",
4249  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4250 #endif
4251 
4252 #ifdef DOCUMENTATION
4253 
4262 #else
4263  AsmFunction.setDataPrototype("SgSymbolTable*", "symbol_table", "= NULL",
4264  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, DEF_DELETE, NO_COPY_DATA);
4265 #endif
4266 
4267 #ifdef DOCUMENTATION
4268  // FIXME[Robb P Matzke 2017-02-13]: what is this?
4269 #else
4270  AsmFunction.setDataPrototype("size_t", "cached_vertex", "= (size_t)(-1)", // see BinaryAnalysis::FunctionCall
4271  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4272 #endif
4273 
4274 #ifdef DOCUMENTATION
4275 
4284  int64_t get_stackDelta() const;
4285  void set_stackDelta(int64_t);
4287 #else
4288  AsmFunction.setDataPrototype("int64_t", "stackDelta", "= SgAsmInstruction::INVALID_STACK_DELTA",
4289  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4290 #endif
4291 
4292 #ifdef DOCUMENTATION
4293 
4301  const std::string& get_callingConvention() const;
4302  void set_callingConvention(const std::string&);
4304 #else
4305  AsmFunction.setDataPrototype("std::string", "callingConvention", "",
4306  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4307 #endif
4308 
4309  DECLARE_OTHERS(AsmFunction);
4310 #if defined(SgAsmFunction_OTHERS) || defined(DOCUMENTATION)
4311 
4312 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
4313  private:
4314  friend class boost::serialization::access;
4315 
4316  template<class S>
4317  void serialize(S &s, const unsigned /*version*/) {
4318  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmSynthesizedDeclaration);
4319  s & BOOST_SERIALIZATION_NVP(p_name);
4320  s & BOOST_SERIALIZATION_NVP(p_reason);
4321  s & BOOST_SERIALIZATION_NVP(p_reasonComment);
4322  s & BOOST_SERIALIZATION_NVP(p_function_kind);
4323  s & BOOST_SERIALIZATION_NVP(p_may_return);
4324  s & BOOST_SERIALIZATION_NVP(p_name_md5);
4325  s & BOOST_SERIALIZATION_NVP(p_statementList);
4326  s & BOOST_SERIALIZATION_NVP(p_dest);
4327  s & BOOST_SERIALIZATION_NVP(p_entry_va);
4328  //s & BOOST_SERIALIZATION_NVP(p_symbol_table); // not implemented yet
4329  s & BOOST_SERIALIZATION_NVP(p_cached_vertex);
4330  s & BOOST_SERIALIZATION_NVP(p_stackDelta);
4331  s & BOOST_SERIALIZATION_NVP(p_callingConvention);
4332  }
4333 #endif
4334 
4335  public:
4338 
4342  void remove_statement(SgAsmStatement* statement);
4343 
4348  SgAsmBlock* get_entry_block() const;
4349 
4351  enum MayReturn {
4356  };
4357 
4362  // NOTE: If you add more here, then fix Partitioner::parse_switches()
4363  // Also fix SgAsmFunction::reason_key()
4364  FUNC_NONE = 0x00000000,
4365  FUNC_THUNK_TARGET= 0x00004000,
4367  = 0x00008000,
4368  FUNC_ENTRY_POINT = 0x00010000,
4369  FUNC_CALL_TARGET = 0x00020000,
4372  FUNC_CALL_INSN = 0x00040000,
4378  FUNC_EH_FRAME = 0x00080000,
4379  FUNC_SYMBOL = 0x00100000,
4380  FUNC_PATTERN = 0x00200000,
4385  FUNC_GRAPH = 0x00400000,
4389  FUNC_USERDEF = 0x00800000,
4390  FUNC_PADDING = 0x01000000,
4395  FUNC_DISCONT = 0x02000000,
4398  FUNC_INSNHEAD = 0x04000000,
4399  FUNC_IMPORT = 0x08000000,
4402  FUNC_LEFTOVERS = 0x10000000,
4406  FUNC_INTRABLOCK = 0x20000000,
4414  FUNC_THUNK = 0x40000000,
4423  FUNC_EXPORT = 0x80000000,
4425  FUNC_DEFAULT = 0xefff80ff,
4427  /*========= Miscellaneous Reasons ===========================================================================
4428  * The first half of the range (1-127, inclusive) is used for algorithms defined by ROSE. The second half is
4429  * availalble for users to use as they see fit. */
4430  FUNC_MISCMASK = 0x000000ff,
4445  };
4446 
4450  static std::string reason_key(const std::string &prefix="");
4451 
4453  std::string reason_str(bool pad) const;
4454 
4458  static std::string reason_str(bool pad, unsigned reason);
4459 
4462  public:
4463  virtual ~NodeSelector() {}
4464  virtual bool operator()(SgNode*) = 0;
4465  };
4466 
4506  size_t get_extent(AddressIntervalSet *emap=NULL, rose_addr_t *lo_addr=NULL, rose_addr_t *hi_addr=NULL,
4507  NodeSelector *selector=NULL);
4508 
4514  bool get_sha1(uint8_t digest[20]/*out*/, NodeSelector *selector=NULL);
4515 
4518  e_unknown = 0,
4519  e_standard = 1,
4520  e_library = 2,
4521  e_imported = 3,
4522  e_thunk = 4,
4523  e_last
4524  };
4525 #endif // SgAsmFunction_OTHERS
4526 
4527 #ifdef DOCUMENTATION
4528  };
4529 #endif
4530 
4532 
4533  DECLARE_LEAF_CLASS(AsmBlock);
4534  IS_SERIALIZABLE(AsmBlock);
4535 
4536 #ifdef DOCUMENTATION
4537 
4557  class SgAsmBlock: public SgAsmStatement {
4558  public:
4559 #endif
4560 
4561 #if 0 // [Robb P Matzke 2017-02-13]: not used anymore? Not serialized.
4562  // [tps 05Apr07] needed for the control_flow_graph
4563  AsmBlock.setDataPrototype("rose_addr_t", "next_block_true_address", "= 0",
4564  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4565 #endif
4566 
4567 #if 0 // [Robb P Matzke 2017-02-13]: not used anymore? Not serialized.
4568  AsmBlock.setDataPrototype("rose_addr_t", "next_block_false_address", "= 0",
4569  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4570 #endif
4571 
4572 #ifdef DOCUMENTATION
4573 
4578  rose_addr_t get_id() const;
4579  void set_id(rose_addr_t);
4581 #else
4582  AsmBlock.setDataPrototype("rose_addr_t", "id", "= 0",
4583  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
4584 #endif
4585 
4586 #ifdef DOCUMENTATION
4587 
4592  unsigned get_reason() const;
4593  void set_reason(unsigned);
4595 #else
4596  AsmBlock.setDataPrototype("unsigned", "reason", "= SgAsmBlock::BLK_NONE",
4597  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4598 #endif
4599 
4600 #ifdef DOCUMENTATION
4601  // statementList and successors should have been pointers to nodes that contain the list rather than being the lists
4602  // themselves because ROSETTA doesn't allow traversals on multiple list data members--we can traverse either one list or
4603  // the other, but not both. It's too late to change how this part of the AST is structured because so much user code
4604  // already depends on it, therefore we can only traverse statementList and not successors. [Robb Matzke 2016-02-25]
4611  const SgAsmStatementPtrList& get_statementList() const;
4612  void set_statementList(const SgAsmStatementPtrList&);
4614 #else
4615  AsmBlock.setDataPrototype("SgAsmStatementPtrList", "statementList", "",
4616  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
4617 #endif
4618 
4619 #ifdef DOCUMENTATION
4620  // statementList and successors should have been pointers to nodes that contain the list rather than being the lists
4621  // themselves because ROSETTA doesn't allow traversals on multiple list data members--we can traverse either one list or
4622  // the other, but not both. It's too late to change how this part of the AST is structured because so much user code
4623  // already depends on it, therefore we can only traverse statementList and not successors. [Robb Matzke 2016-02-25]
4631  const SgAsmIntegerValuePtrList& get_successors() const;
4632  void set_successors(const SgAsmIntegerValuePtrList&);
4634 #else
4635  AsmBlock.setDataPrototype("SgAsmIntegerValuePtrList", "successors", "",
4636  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4637 #endif
4638 
4639 #ifdef DOCUMENTATION
4640 
4650  bool get_successors_complete() const;
4651  void set_successors_complete(bool);
4653 #else
4654  AsmBlock.setDataPrototype("bool", "successors_complete", "= false",
4655  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4656 #endif
4657 
4658 #ifdef DOCUMENTATION
4659 
4671 #else
4672  AsmBlock.setDataPrototype("SgAsmBlock*", "immediate_dominator", "=NULL",
4673  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4674 #endif
4675 
4676 #ifdef DOCUMENTATION
4677 
4685  size_t get_cached_vertex() const;
4686  void set_cached_vertex(size_t);
4688 #else
4689  AsmBlock.setDataPrototype("size_t", "cached_vertex", "= (size_t)(-1)", // see BinaryAnalysis::ControlFlow
4690  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4691 #endif
4692 
4693 #ifdef DOCUMENTATION
4694 
4700  double get_code_likelihood() const;
4701  void set_code_likelihood(double);
4703 #else
4704  AsmBlock.setDataPrototype("double", "code_likelihood", "= 0.0",
4705  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4706 #endif
4707 
4708 #ifdef DOCUMENTATION
4709 
4717  int64_t get_stackDeltaOut() const;
4718  void set_stackDeltaOut(int64_t);
4720 #else
4721  AsmBlock.setDataPrototype("int64_t", "stackDeltaOut", "= SgAsmInstruction::INVALID_STACK_DELTA",
4722  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
4723 #endif
4724 
4725  DECLARE_OTHERS(AsmBlock);
4726 #if defined(SgAsmBlock_OTHERS) || defined(DOCUMENTATION)
4727 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
4728  private:
4729  friend class boost::serialization::access;
4730 
4731  template<class S>
4732  void serialize(S &s, const unsigned /*version*/) {
4733  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmStatement);
4734  s & BOOST_SERIALIZATION_NVP(p_reason);
4735  s & BOOST_SERIALIZATION_NVP(p_statementList);
4736  s & BOOST_SERIALIZATION_NVP(p_successors);
4737  s & BOOST_SERIALIZATION_NVP(p_successors_complete);
4738  s & BOOST_SERIALIZATION_NVP(p_immediate_dominator);
4739  s & BOOST_SERIALIZATION_NVP(p_cached_vertex);
4740  s & BOOST_SERIALIZATION_NVP(p_code_likelihood);
4741  s & BOOST_SERIALIZATION_NVP(p_stackDeltaOut);
4742  }
4743 #endif
4744 
4745  public:
4747  enum Reason {
4748  // Please update SgAsmBlock::reason_str() if you change this enum!
4749  BLK_NONE = 0x00000000,
4750  BLK_ENTRY_POINT = 0x00010000,
4751  BLK_PADDING = 0x00020000,
4752  BLK_FRAGMENT = 0x00080000,
4754  BLK_CFGHEAD = 0x00100000,
4755  BLK_USERDEF = 0x00200000,
4756  BLK_LEFTOVERS = 0x00400000,
4758  BLK_JUMPTABLE = 0x00800000,
4759  BLK_GRAPH1 = 0x01000000,
4760  BLK_GRAPH2 = 0x02000000,
4761  BLK_GRAPH3 = 0x04000000,
4763  BLK_DEFAULT = BLK_NONE, //NO_STRINGIFY
4764 
4765  // ========= Miscellaneous Reasons ===========================================================================
4766  // The first half of the range (1-127, inclusive) is used for algorithms defined by ROSE. The second half is
4767  // availalble for users to use as they see fit.
4768  BLK_MISCMASK = 0x000000ff,
4770  BLK_FINDDATA = 0x00000001,
4772  BLK_POSTFUNC = 0x00000002
4774  };
4775 
4780 
4785 
4786  // FIXME[Robb P Matzke 2017-02-13]: wrong name -- erases only statements, not all children
4791  void remove_children();
4792 
4797  rose_addr_t get_fallthrough_va();
4798 
4803 
4809  bool has_instructions() const;
4810 
4816  bool is_basic_block() const { return has_instructions(); }
4817 
4827  bool is_function_call(rose_addr_t &target_va/*out*/, rose_addr_t &return_va/*out*/);
4828 
4832  static std::string reason_key(const std::string &prefix="");
4833 
4837  std::string reason_str(bool pad) const;
4838 
4844  static std::string reason_str(bool pad, unsigned reason);
4845 #endif // SgAsmBlock_OTHERS
4846 
4847 #ifdef DOCUMENTATION
4848  };
4849 #endif
4850 
4851 
4853 
4854  DECLARE_LEAF_CLASS(AsmStaticData);
4855  IS_SERIALIZABLE(AsmStaticData);
4856 
4857 #ifdef DOCUMENTATION
4858 
4866  public:
4867 #endif
4868 
4869 #ifdef DOCUMENTATION
4870 
4876  const SgUnsignedCharList& get_raw_bytes() const;
4877  void set_raw_bytes(const SgUnsignedCharList&);
4879 #else
4880  AsmStaticData.setDataPrototype("SgUnsignedCharList", "raw_bytes", "",
4881  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
4882 #endif
4883 
4884  DECLARE_OTHERS(AsmStaticData);
4885 #if defined(SgAsmStaticData_OTHERS) || defined(DOCUMENTATION)
4886 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
4887  private:
4888  friend class boost::serialization::access;
4889 
4890  template<class S>
4891  void serialize(S &s, const unsigned /*version*/) {
4892  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmStatement);
4893  s & BOOST_SERIALIZATION_NVP(p_raw_bytes);
4894  }
4895 #endif
4896 
4897  public:
4901  size_t get_size() const { return p_raw_bytes.size(); }
4902 #endif // SgAsmStaticData_OTHERS
4903 
4904 #ifdef DOCUMENTATION
4905  };
4906 #endif
4907 
4908 
4910 
4911  DECLARE_LEAF_CLASS(AsmSynthesizedDataStructureDeclaration);
4912  IS_SERIALIZABLE(AsmSynthesizedDataStructureDeclaration);
4913 
4914 #ifdef DOCUMENTATION
4915 
4926  public:
4927 #endif
4928 
4929  DECLARE_OTHERS(AsmSynthesizedDataStructureDeclaration);
4930 #if defined(SgAsmSynthesizedDataStructureDeclaration_OTHERS) || defined(DOCUMENTATION)
4931 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
4932  private:
4933  friend class boost::serialization::access;
4934 
4935  template<class S>
4936  void serialize(S & s, const unsigned /*version*/) {
4937  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmStatement);
4938  }
4939 #endif
4940  protected:
4941  SgAsmSynthesizedDeclarationPtrList p_declarationList;
4942 
4943  public:
4946  p_declarationList.push_back(declaration);
4947  }
4948 #endif // SgAsmSynthesizedDataStructureDeclaration_OTHERS
4949 
4950 #ifdef DOCUMENTATION
4951  };
4952 #endif
4953 
4954 
4956 
4957  DECLARE_LEAF_CLASS(AsmSynthesizedFieldDeclaration);
4958  IS_SERIALIZABLE(AsmSynthesizedFieldDeclaration);
4959 
4960 #ifdef DOCUMENTATION
4961  // FIXME[Robb P Matzke 2017-02-13]: what is this?
4963  public:
4964 #endif
4965 
4966 #ifdef DOCUMENTATION
4967 
4970  const std::string& get_name() const;
4971  void set_name(const std::string&);
4973 #else
4974  AsmSynthesizedFieldDeclaration.setDataPrototype("std::string","name","= \"\"",
4975  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL,
4976  NO_DELETE);
4977 #endif
4978 
4979 #ifdef DOCUMENTATION
4980  // FIXME[Robb P Matzke 2017-02-13]: Is this bytes, bits, or what?
4984  uint64_t get_offset() const;
4985  void set_ofset(uint64_t);
4987 #else
4988  // Not clear if we want to store the offset explicitly
4989  AsmSynthesizedFieldDeclaration.setDataPrototype("uint64_t","offset","= 0",
4990  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL,
4991  NO_DELETE);
4992 #endif
4993 
4994  DECLARE_OTHERS(AsmSynthesizedFieldDeclaration);
4995 #if defined(SgAsmSynthesizedFieldDeclaration_OTHERS) || defined(DOCUMENTATION)
4996 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
4997  private:
4998  friend class boost::serialization::access;
4999 
5000  template<class S>
5001  void serialize(S &s, const unsigned /*version*/) {
5002  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmSynthesizedDeclaration);
5003  }
5004 #endif
5005 #endif // SgAsmSynthesizedFieldDeclaration_OTHERS
5006 
5007 #ifdef DOCUMENTATION
5008  };
5009 #endif
5010 
5011 
5013 
5014  NEW_NONTERMINAL_MACRO(AsmSynthesizedDeclaration,
5015  AsmSynthesizedDataStructureDeclaration | AsmFunction | AsmSynthesizedFieldDeclaration,
5016  "AsmSynthesizedDeclaration", "AsmSynthesizedDeclarationTag", false );
5017  AsmSynthesizedFieldDeclaration.setCppCondition("!defined(DOCUMENTATION)");
5018  IS_SERIALIZABLE(AsmSynthesizedDeclaration);
5019 
5020 #ifdef DOCUMENTATION
5021 
5028  public:
5029 #endif
5030 
5031  DECLARE_OTHERS(AsmSynthesizedDeclaration);
5032 #if defined(SgAsmSynthesizedDeclaration_OTHERS) || defined(DOCUMENTATION)
5033 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
5034  private:
5035  friend class boost::serialization::access;
5036 
5037  template<class S>
5038  void serialize(S &s, const unsigned /*version*/) {
5039  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmStatement);
5040  };
5041 #endif
5042 #endif // SgAsmSynthesizedDeclaration_OTHERS
5043 
5044 #ifdef DOCUMENTATION
5045  };
5046 #endif
5047 
5048 
5050 
5051  NEW_NONTERMINAL_MACRO(AsmStatement,
5052  AsmSynthesizedDeclaration | AsmBlock | AsmInstruction | AsmStaticData,
5053  "AsmStatement", "AsmStatementTag", false);
5054  AsmStatement.setCppCondition("!defined(DOCUMENTATION)");
5055  IS_SERIALIZABLE(AsmStatement);
5056 
5057 #ifdef DOCUMENTATION
5058 
5062  class SgAsmStatement: public SgAsmNode {
5063  public:
5064 #endif
5065 
5066 #ifdef DOCUMENTATION
5067 
5072  rose_addr_t get_address() const;
5073  void set_address(rose_addr_t);
5075 #else
5076  AsmStatement.setDataPrototype("rose_addr_t", "address", "= 0",
5077  CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
5078 #endif
5079 
5080 
5081 #ifdef DOCUMENTATION
5082 
5085  const std::string& get_comment() const;
5086  void set_comment(const std::string&);
5088 #else
5089  AsmStatement.setDataPrototype("std::string", "comment", "= \"\"",
5090  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE, COPY_DATA);
5091 #endif
5092 
5093  DECLARE_OTHERS(AsmStatement);
5094 #if defined(SgAsmStatement_OTHERS) || defined(DOCUMENTATION)
5095 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
5096  private:
5097  friend class boost::serialization::access;
5098 
5099  template<class S>
5100  void serialize(S &s, const unsigned /*version*/) {
5101  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgNode);
5102  s & BOOST_SERIALIZATION_NVP(p_address);
5103  s & BOOST_SERIALIZATION_NVP(p_comment);
5104  }
5105 #endif
5106 #endif // SgAsmStatement_OTHERS
5107 
5108 #ifdef DOCUMENTATION
5109  };
5110 #endif
5111 
5112 
5113 
5114 
5116 
5117  /*************************************************************************************************************************
5118  * Binary Interpretations
5119  * Some file formats have more than one thing in them: PE files have a DOS and Windows executable both in the same file;
5120  * Apple OS X files can have multiple architectures represented in a single file, etc. The interpretation is the root of
5121  * an AST that represents a single, coherent sub-part of the file.
5122  *************************************************************************************************************************/
5123 
5125 
5126  DECLARE_LEAF_CLASS(AsmInterpretationList);
5127  IS_SERIALIZABLE(AsmInterpretationList);
5128 
5129 #ifdef DOCUMENTATION
5130 
5132  public:
5133 #endif
5134 
5135 #ifdef DOCUMENTATION
5136 
5145 #else
5146  AsmInterpretationList.setDataPrototype("SgAsmInterpretationPtrList", "interpretations", "",
5147  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL,
5148  NO_DELETE);
5149 #endif
5150 
5151  DECLARE_OTHERS(AsmInterpretationList);
5152 #if defined(SgAsmInterpretationList_OTHERS) || defined(DOCUMENTATION)
5153 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
5154  private:
5155  friend class boost::serialization::access;
5156 
5157  template<class S>
5158  void serialize(S &s, const unsigned /*version*/) {
5159  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmNode);
5160  s & BOOST_SERIALIZATION_NVP(p_interpretations);
5161  }
5162 #endif
5163 #endif // SgAsmInterpretationList_OTHERS
5164 
5165 #ifdef DOCUMENTATION
5166  };
5167 #endif
5168 
5170 
5171  DECLARE_LEAF_CLASS(AsmInterpretation);
5172  IS_SERIALIZABLE(AsmInterpretation);
5173 
5174  DECLARE_HEADERS(AsmInterpretation);
5175 #if defined(SgAsmInterpretation_HEADERS) || defined(DOCUMENTATION)
5176  #include <Rose/BinaryAnalysis/BasicTypes.h>
5177  #include <Rose/BinaryAnalysis/MemoryMap.h>
5178 #endif // SgAsmInterpretation_HEADERS
5179 
5180 #ifdef DOCUMENTATION
5181 
5188  public:
5189 #endif
5190 
5191 #ifdef DOCUMENTATION
5192  // documentation and definition are below
5193 #else
5194  AsmInterpretation.setAutomaticGenerationOfConstructor(false);
5195 #endif
5196 
5197 #ifdef DOCUMENTATION
5198 
5209 #else
5210  AsmInterpretation.setDataPrototype("SgAsmGenericHeaderList*", "headers", "= NULL",
5211  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5212 #endif
5213 
5214 #ifdef DOCUMENTATION
5215 
5220  SgAsmBlock* get_global_block() const;
5223 #else
5224  AsmInterpretation.setDataPrototype("SgAsmBlock*", "global_block", "= NULL",
5225  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
5226 #endif
5227 
5228  DECLARE_OTHERS(AsmInterpretation);
5229 #if defined(SgAsmInterpretation_OTHERS) || defined(DOCUMENTATION)
5230  private:
5232  bool coverageComputed; // true iff percentageCoverage has been computed
5233  mutable InstructionMap instruction_map; // cached instruction map
5234 
5236  // disassembly into instructions.
5237  double percentageCoverage;
5238 
5239 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
5240  private:
5241  friend class boost::serialization::access;
5242 
5243  template<class S>
5244  void serialize(S &s, const unsigned /*version*/) {
5245  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmNode);
5246  s & BOOST_SERIALIZATION_NVP(p_headers);
5247  s & BOOST_SERIALIZATION_NVP(p_global_block);
5248  s & BOOST_SERIALIZATION_NVP(p_map);
5249  s & BOOST_SERIALIZATION_NVP(coverageComputed);
5250  s & BOOST_SERIALIZATION_NVP(instruction_map);
5251  s & BOOST_SERIALIZATION_NVP(percentageCoverage);
5252  }
5253 #endif
5254 
5255  public:
5258 
5263  SgAsmGenericFilePtrList get_files() const;
5264 
5281  InstructionMap& get_instruction_map(bool recompute=false);
5282  void set_instruction_map(const InstructionMap&);
5289  void insert_instructions(InstructionMap&/*in,out*/);
5290 
5295  void erase_instructions(InstructionMap&/*in,out*/);
5296 
5302  void set_coverageComputed(bool x) { coverageComputed = x; }
5303  void set_percentageCoverage(double x) { percentageCoverage = x; }
5306  private:
5307  void ctor(); // finalize construction
5308 #endif // SgAsmInterpretation_OTHERS
5309 
5310 #ifdef DOCUMENTATION
5311  };
5312 #endif
5313 
5314 
5315 
5317 
5318  /*************************************************************************************************************************
5319  * ELF File Header
5320  *************************************************************************************************************************/
5321 
5323 
5324  DECLARE_LEAF_CLASS(AsmElfFileHeader);
5325  IS_SERIALIZABLE(AsmElfFileHeader);
5326 
5327 #ifdef DOCUMENTATION
5328 
5337  public:
5338 #endif
5339 
5340 #ifdef DOCUMENTATION
5341 
5346  unsigned char get_e_ident_file_class() const;
5347  void set_e_ident_file_class(unsigned char);
5349 #else
5350  AsmElfFileHeader.setDataPrototype("unsigned char", "e_ident_file_class", "= 0",
5351  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5352 #endif
5353 
5354 #ifdef DOCUMENTATION
5355 
5360  unsigned char get_e_ident_data_encoding() const;
5361  void set_e_ident_data_encoding(unsigned char);
5363 #else
5364  AsmElfFileHeader.setDataPrototype("unsigned char", "e_ident_data_encoding", "= 0",
5365  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5366 #endif
5367 
5368 #ifdef DOCUMENTATION
5369 
5374  unsigned char get_e_ident_file_version() const;
5375  void set_e_ident_file_version(unsigned char*);
5377 #else
5378  AsmElfFileHeader.setDataPrototype("unsigned char", "e_ident_file_version", "= 0",
5379  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5380 #endif
5381 
5382 #ifdef DOCUMENTATION
5383 
5388  const SgUnsignedCharList& get_e_ident_padding() const;
5389  void set_e_ident_padding(const SgUnsignedCharList&);
5391 #else
5392  AsmElfFileHeader.setDataPrototype("SgUnsignedCharList", "e_ident_padding", "",
5393  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5394 #endif
5395 
5396 #ifdef DOCUMENTATION
5397 
5402  unsigned long get_e_type() const;
5403  void set_e_type(unsigned long);
5405 #else
5406  AsmElfFileHeader.setDataPrototype("unsigned long", "e_type", "= 0",
5407  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5408 #endif
5409 
5410 #ifdef DOCUMENTATION
5411 
5416  unsigned long get_e_machine() const;
5417  void set_e_machine(unsigned long);
5419 #else
5420  AsmElfFileHeader.setDataPrototype("unsigned long", "e_machine", "= 0",
5421  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5422 #endif
5423 
5424 #ifdef DOCUMENTATION
5425 
5430  unsigned long get_e_flags() const;
5431  void set_e_flags(unsigned long);
5433 #else
5434  AsmElfFileHeader.setDataPrototype("unsigned long", "e_flags", "= 0",
5435  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5436 #endif
5437 
5438 #ifdef DOCUMENTATION
5439 
5444  unsigned long get_e_ehsize() const;
5445  void set_e_ehsize(unsigned long);
5447 #else
5448  AsmElfFileHeader.setDataPrototype("unsigned long", "e_ehsize", "= 0",
5449  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5450 #endif
5451 
5452 #ifdef DOCUMENTATION
5453 
5458  unsigned long get_phextrasz() const;
5459  void set_phextrasz(unsigned long);
5461 #else
5462  AsmElfFileHeader.setDataPrototype("unsigned long", "phextrasz", "= 0",
5463  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5464 #endif
5465 
5466 #ifdef DOCUMENTATION
5467 
5472  unsigned long get_e_phnum() const;
5473  void set_e_phnum(unsigned long);
5475 #else
5476  AsmElfFileHeader.setDataPrototype("unsigned long", "e_phnum", "= 0",
5477  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5478 #endif
5479 
5480 #ifdef DOCUMENTATION
5481 
5486  unsigned long get_shextrasz() const;
5487  void set_shextrasz(unsigned long);
5489 #else
5490  AsmElfFileHeader.setDataPrototype("unsigned long", "shextrasz", "= 0",
5491  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5492 #endif
5493 
5494 #ifdef DOCUMENTATION
5495 
5500  unsigned long get_e_shnum() const;
5501  void set_e_shnum(unsigned long);
5503 #else
5504  AsmElfFileHeader.setDataPrototype("unsigned long", "e_shnum", "= 0",
5505  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5506 #endif
5507 
5508 #ifdef DOCUMENTATION
5509 
5514  unsigned long get_e_shstrndx() const;
5515  void set_e_shstrndx(unsigned long);
5517 #else
5518  AsmElfFileHeader.setDataPrototype("unsigned long", "e_shstrndx", "= 0",
5519  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5520 #endif
5521 
5522 #ifdef DOCUMENTATION
5523 
5533 #else
5534  AsmElfFileHeader.setDataPrototype("SgAsmElfSectionTable*", "section_table", "= NULL",
5535  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5536 #endif
5537 
5538 #ifdef DOCUMENTATION
5539 
5548 #else
5549  AsmElfFileHeader.setDataPrototype("SgAsmElfSegmentTable*", "segment_table", "= NULL",
5550  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5551 #endif
5552 
5553  DECLARE_OTHERS(AsmElfFileHeader);
5554 #if defined(SgAsmElfFileHeader_OTHERS) || defined(DOCUMENTATION)
5555 
5556 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
5557  private:
5558  friend class boost::serialization::access;
5559 
5560  template<class S>
5561  void serialize(S &s, const unsigned /*version*/) {
5562  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmGenericHeader);
5563  s & BOOST_SERIALIZATION_NVP(p_e_ident_file_class);
5564  s & BOOST_SERIALIZATION_NVP(p_e_ident_data_encoding);
5565  s & BOOST_SERIALIZATION_NVP(p_e_ident_file_version);
5566  s & BOOST_SERIALIZATION_NVP(p_e_ident_padding);
5567  s & BOOST_SERIALIZATION_NVP(p_e_type);
5568  s & BOOST_SERIALIZATION_NVP(p_e_machine);
5569  s & BOOST_SERIALIZATION_NVP(p_e_flags);
5570  s & BOOST_SERIALIZATION_NVP(p_e_ehsize);
5571  s & BOOST_SERIALIZATION_NVP(p_phextrasz);
5572  s & BOOST_SERIALIZATION_NVP(p_e_phnum);
5573  s & BOOST_SERIALIZATION_NVP(p_shextrasz);
5574  s & BOOST_SERIALIZATION_NVP(p_e_shnum);
5575  s & BOOST_SERIALIZATION_NVP(p_e_shstrndx);
5576  s & BOOST_SERIALIZATION_NVP(p_section_table);
5577  s & BOOST_SERIALIZATION_NVP(p_segment_table);
5578  }
5579 #endif
5580 
5581  public:
5583  enum ObjectType {
5584  ET_NONE = 0
5585  ,ET_REL = 1
5586  ,ET_EXEC = 2
5587  ,ET_DYN = 3
5588  ,ET_CORE = 4
5590  ,ET_LOOS = 0xfe00
5591  ,ET_HIOS = 0xfeff
5592  ,ET_LOPROC = 0xff00
5593  ,ET_HIPROC = 0xffff
5594  };
5595 
5596  // Some structures are used to represent certain things whose layout is very precise in binary files, thus we need to
5597  // make sure the compiler doesn't insert alignment padding between the struct members. ROSE can be compiled on an
5598  // architecture that has different alignment constraints than the architecture that these structs describe. GNU
5599  // compilers have long used the attribute mechanism. Microsoft compilers on the other hand use pragmas. GCC versions
5600  // 4.0 and earlier do not recognize the Microsoft pragmas and issue compiler errors when one is encountered.
5601 #ifdef _MSC_VER
5602 # pragma pack (1)
5603 #endif
5604 
5611  unsigned char e_ident_magic[4];
5612  unsigned char e_ident_file_class;
5613  unsigned char e_ident_data_encoding;
5614  unsigned char e_ident_file_version;
5615  unsigned char e_ident_padding[9];
5616  uint16_t e_type;
5617  uint16_t e_machine;
5618  uint32_t e_version;
5619  uint32_t e_entry;
5620  uint32_t e_phoff;
5621  uint32_t e_shoff;
5622  uint32_t e_flags;
5623  uint16_t e_ehsize;
5624  uint16_t e_phentsize;
5625  uint16_t e_phnum;
5626  uint16_t e_shentsize;
5627  uint16_t e_shnum;
5628  uint16_t e_shstrndx;
5629  }
5630 #if !defined(SWIG) && !defined(_MSC_VER)
5631  __attribute__((packed))
5632 #endif
5633  ;
5634 
5636  unsigned char e_ident_magic[4];
5637  unsigned char e_ident_file_class;
5638  unsigned char e_ident_data_encoding;
5639  unsigned char e_ident_file_version;
5640  unsigned char e_ident_padding[9];
5641  uint16_t e_type;
5642  uint16_t e_machine;
5643  uint32_t e_version;
5644  uint64_t e_entry;
5645  uint64_t e_phoff;
5646  uint64_t e_shoff;
5647  uint32_t e_flags;
5648  uint16_t e_ehsize;
5649  uint16_t e_phentsize;
5650  uint16_t e_phnum;
5651  uint16_t e_shentsize;
5652  uint16_t e_shnum;
5653  uint16_t e_shstrndx;
5654  }
5655 #if !defined(SWIG) && !defined(_MSC_VER)
5656  __attribute__((packed))
5657 #endif
5658  ;
5659 
5660 #ifdef _MSC_VER
5661 # pragma pack ()
5662 #endif
5663 
5671  : SgAsmGenericHeader(f) , p_e_ident_file_class(0), p_e_ident_file_version(1), p_e_type(0),
5672  p_e_machine(0), p_e_flags(0), p_e_ehsize(0), p_phextrasz(0), p_e_phnum(0), p_shextrasz(0),
5673  p_e_shnum(0), p_e_shstrndx(0), p_section_table(NULL), p_segment_table(NULL) {
5674  ctor();
5675  }
5676 
5682  uint64_t max_page_size();
5683 
5686 
5689 
5695  virtual SgAsmElfFileHeader *parse() override;
5696 
5698  virtual bool reallocate() override;
5699 
5701  virtual void unparse(std::ostream&) const override;
5702 
5704  virtual void dump(FILE*, const char *prefix, ssize_t idx) const override;
5705 
5707  static bool is_ELF(SgAsmGenericFile*);
5708 
5710  SgAsmGenericSectionPtrList get_sectab_sections();
5711 
5713  SgAsmGenericSectionPtrList get_segtab_sections();
5714 
5715  // Overrides documented in base class
5716  virtual const char *format_name() const override;
5717 
5718  private:
5719  void ctor(); // called by constructors
5720  void *encode(ByteOrder::Endianness, SgAsmElfFileHeader::Elf32FileHeader_disk*) const;
5721  void *encode(ByteOrder::Endianness, SgAsmElfFileHeader::Elf64FileHeader_disk*) const;
5722 #endif // SgAsmElfFileHeader_OTHERS
5723 
5724 #ifdef DOCUMENTATION
5725  };
5726 #endif
5727 
5728 
5729 #undef JVM_IGNORE_SERIALIZATION
5730 
5732 
5733  /*************************************************************************************************************************
5734  * JVM File Header
5735  *************************************************************************************************************************/
5736 
5738 
5739  DECLARE_LEAF_CLASS(AsmJvmFileHeader);
5740  IS_SERIALIZABLE(AsmJvmFileHeader);
5741 
5742 #ifdef DOCUMENTATION
5743 
5750  public:
5751 #endif
5752 
5753 #ifdef DOCUMENTATION
5754 
5759  uint16_t get_minor_version() const;
5760  void set_minor_version(uint16_t);
5762 #else
5763  AsmJvmFileHeader.setDataPrototype("uint16_t", "minor_version", "= 0",
5764  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5765 #endif
5766 
5767 #ifdef DOCUMENTATION
5768 
5773  uint16_t get_major_version() const;
5774  void set_major_version(uint16_t);
5776 #else
5777  AsmJvmFileHeader.setDataPrototype("uint16_t", "major_version", "= 0",
5778  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5779 #endif
5780 
5781 #ifdef DOCUMENTATION
5782 
5787  uint16_t get_access_flags() const;
5788  void set_access_flags(uint16_t);
5790 #else
5791  AsmJvmFileHeader.setDataPrototype("uint16_t", "access_flags", "= 0",
5792  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5793 #endif
5794 
5795 #ifdef DOCUMENTATION
5796 
5801  uint16_t get_this_class() const;
5802  void set_this_class(uint16_t);
5804 #else
5805  AsmJvmFileHeader.setDataPrototype("uint16_t", "this_class", "= 0",
5806  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5807 #endif
5808 
5809 #ifdef DOCUMENTATION
5810 
5815  uint16_t get_super_class() const;
5816  void set_super_class(uint16_t);
5818 #else
5819  AsmJvmFileHeader.setDataPrototype("uint16_t", "super_class", "= 0",
5820  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5821 #endif
5822 
5823 #ifdef DOCUMENTATION
5824 
5832  const SgAsmJvmConstantPool* get_constant_pool() const;
5835 #else
5836  AsmJvmFileHeader.setDataPrototype("SgAsmJvmConstantPool*", "constant_pool", "= nullptr",
5837  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5838 #endif
5839 
5840 #ifdef DOCUMENTATION
5841 
5848  const std::list<uint16_t>& get_interfaces() const;
5849  std::list<uint16_t>& get_interfaces();
5851 #else
5852  AsmJvmFileHeader.setDataPrototype("std::list<uint16_t>", "interfaces", "",
5853  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5854 #endif
5855 
5856 #ifdef DOCUMENTATION
5857 
5865  const SgAsmJvmFieldTable* get_field_table() const;
5868 #else
5869  AsmJvmFileHeader.setDataPrototype("SgAsmJvmFieldTable*", "field_table", "= nullptr",
5870  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5871 #endif
5872 
5873 #ifdef DOCUMENTATION
5874 
5882  const SgAsmJvmMethodTable* get_method_table() const;
5885 #else
5886  AsmJvmFileHeader.setDataPrototype("SgAsmJvmMethodTable*", "method_table", "= nullptr",
5887  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5888 #endif
5889 
5890 #ifdef DOCUMENTATION
5891 
5902 #else
5903  AsmJvmFileHeader.setDataPrototype("SgAsmJvmAttributeTable*", "attribute_table", "= nullptr",
5904  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5905 #endif
5906 
5907 #ifdef DOCUMENTATION
5908  protected:
5909  uint16_t p_minor_version;
5910  uint16_t p_major_version;
5911  uint16_t p_access_flags;
5912  uint16_t p_this_class;
5913  uint16_t p_super_class;
5914  SgAsmJvmConstantPool* p_constant_pool;
5915  std::list<uint16_t>& p_interfaces;
5916  SgAsmJvmFieldTable* p_field_table;
5917  SgAsmJvmMethodTable* p_method_table;
5918  SgAsmJvmAttributeTable* p_attribute_table;
5919  public:
5920 #endif
5921 
5922  DECLARE_OTHERS(AsmJvmFileHeader);
5923 #if defined(SgAsmJvmFileHeader_OTHERS) || defined(DOCUMENTATION)
5924 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
5925  private:
5926  friend class boost::serialization::access;
5927 
5928  template<class S>
5929  void serialize(S &s, const unsigned /*version*/) {
5930  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmGenericHeader);
5931  s & BOOST_SERIALIZATION_NVP(p_minor_version);
5932  s & BOOST_SERIALIZATION_NVP(p_major_version);
5933  s & BOOST_SERIALIZATION_NVP(p_access_flags);
5934  s & BOOST_SERIALIZATION_NVP(p_this_class);
5935  s & BOOST_SERIALIZATION_NVP(p_super_class);
5936  s & BOOST_SERIALIZATION_NVP(p_constant_pool);
5937  s & BOOST_SERIALIZATION_NVP(p_interfaces);
5938  s & BOOST_SERIALIZATION_NVP(p_field_table);
5939  s & BOOST_SERIALIZATION_NVP(p_method_table);
5940  s & BOOST_SERIALIZATION_NVP(p_attribute_table);
5941  }
5942 #endif
5943 
5944  public:
5947 
5953  virtual SgAsmJvmFileHeader* parse() override;
5954 
5956  static bool is_JVM(SgAsmGenericFile*);
5957 
5958 #endif // SgAsmJvmFileHeader_OTHERS
5959 
5960 #ifdef DOCUMENTATION
5961  };
5962 #endif
5963 
5964 
5966 
5967  /*************************************************************************************************************************
5968  * ELF Section Tables
5969  *************************************************************************************************************************/
5970 
5972 
5973  DECLARE_LEAF_CLASS(AsmElfSectionTable);
5974  IS_SERIALIZABLE(AsmElfSectionTable);
5975 
5976 #ifdef DOCUMENTATION
5977 
5983  public:
5984 #endif
5985 
5986  DECLARE_OTHERS(AsmElfSectionTable);
5987 #if defined(SgAsmElfSectionTable_OTHERS) || defined(DOCUMENTATION)
5988 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
5989  private:
5990  friend class boost::serialization::access;
5991 
5992  template<class S>
5993  void serialize(S &s, const unsigned /*version*/) {
5994  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmGenericSection);
5995  }
5996 #endif
5997 
5998  public:
6001  : SgAsmGenericSection(fhdr->get_file(), fhdr) {
6002  ctor();
6003  }
6004 
6010  virtual SgAsmElfSectionTable *parse() override;
6011 
6023 
6027  rose_addr_t calculate_sizes(size_t *entsize, size_t *required, size_t *optional, size_t *entcount) const;
6028 
6030  virtual bool reallocate() override;
6031 
6033  virtual void unparse(std::ostream&) const override;
6034 
6036  virtual void dump(FILE*, const char *prefix, ssize_t idx) const override;
6037 
6038  private:
6039  void ctor();
6040 #endif // SgAsmElfSectionTable_OTHERS
6041 
6042 #ifdef DOCUMENTATION
6043  };
6044 #endif
6045 
6046 
6048 
6049  DECLARE_LEAF_CLASS(AsmElfSectionTableEntry);
6050  IS_SERIALIZABLE(AsmElfSectionTableEntry);
6051 
6052 #ifdef DOCUMENTATION
6053 
6055  public:
6056 #endif
6057 
6058 #ifdef DOCUMENTATION
6059 
6064  unsigned get_sh_name() const;
6065  void set_sh_name(unsigned);
6067 #else
6068  AsmElfSectionTableEntry.setDataPrototype("unsigned", "sh_name", "= 0",
6069  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
6070 #endif
6071 
6072 #ifdef DOCUMENTATION
6073 
6078  SectionType get_sh_type() const;
6079  void set_sh_type(SectionType);
6081 #else
6082  AsmElfSectionTableEntry.setDataPrototype("SgAsmElfSectionTableEntry::SectionType", "sh_type", "= SHT_PROGBITS",
6083  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
6084 #endif
6085 
6086 #ifdef DOCUMENTATION
6087 
6092  unsigned long get_sh_link() const;
6093  void set_sh_link(unsigned long);
6095 #else
6096  AsmElfSectionTableEntry.setDataPrototype("unsigned long", "sh_link", "= 0",
6097  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
6098 #endif
6099 
6100 #ifdef DOCUMENTATION
6101 
6106  unsigned long get_sh_info() const;
6107  void set_sh_info(unsigned long);
6109 #else
6110  AsmElfSectionTableEntry.setDataPrototype("unsigned long", "sh_info", "= 0",
6111  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
6112 #endif
6113 
6114 #ifdef DOCUMENTATION
6115 
6120  uint64_t get_sh_flags() const;
6121  void set_sh_flags(uint64_t);
6123 #else
6124  AsmElfSectionTableEntry.setDataPrototype("uint64_t", "sh_flags", "= 0",
6125  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
6126 #endif
6127 
6128 #ifdef DOCUMENTATION
6129 
6134  rose_addr_t get_sh_addr() const;
6135  void set_sh_addr(rose_addr_t);
6137 #else
6138  AsmElfSectionTableEntry.setDataPrototype("rose_addr_t", "sh_addr", "= 0",
6139  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
6140 #endif
6141 
6142 #ifdef DOCUMENTATION
6143 
6148  rose_addr_t get_sh_offset() const;
6149  void set_sh_offset(rose_addr_t);
6151 #else
6152  AsmElfSectionTableEntry.setDataPrototype("rose_addr_t", "sh_offset", "= 0",
6153  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
6154 #endif
6155 
6156 #ifdef DOCUMENTATION
6157 
6162  rose_addr_t get_sh_size() const;
6163  void set_sh_size(rose_addr_t);
6165 #else
6166  AsmElfSectionTableEntry.setDataPrototype("rose_addr_t", "sh_size", "= 0",
6167  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
6168 #endif
6169 
6170 #ifdef DOCUMENTATION
6171 
6176  rose_addr_t get_sh_addralign() const;
6177  void set_sh_addralign(rose_addr_t);
6179 #else
6180  AsmElfSectionTableEntry.setDataPrototype("rose_addr_t", "sh_addralign", "= 0",
6181  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
6182 #endif
6183 
6184 #ifdef DOCUMENTATION
6185 
6190  rose_addr_t get_sh_entsize() const;
6191  void set_sh_entsize(rose_addr_t);
6193 #else
6194  AsmElfSectionTableEntry.setDataPrototype("rose_addr_t", "sh_entsize", "= 0",
6195  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
6196 #endif
6197 
6198 #ifdef DOCUMENTATION
6199 
6204  const SgUnsignedCharList& get_extra() const;
6205  void set_extra(const SgUnsignedCharLit&);
6207 #else
6208  AsmElfSectionTableEntry.setDataPrototype("SgUnsignedCharList", "extra", "",
6209  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, NO_TRAVERSAL,
6210  NO_DELETE);
6211 #endif
6212 
6213  DECLARE_OTHERS(AsmElfSectionTableEntry);
6214 #if defined(SgAsmElfSectionTableEntry_OTHERS) || defined(DOCUMENTATION)
6215 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
6216  private:
6217  friend class boost::serialization::access;
6218 
6219  template<class S>
6220  void serialize(S &s, const unsigned /*version*/) {
6221  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
6222  s & BOOST_SERIALIZATION_NVP(p_sh_name);
6223  s & BOOST_SERIALIZATION_NVP(p_sh_type);
6224  s & BOOST_SERIALIZATION_NVP(p_sh_link);
6225  s & BOOST_SERIALIZATION_NVP(p_sh_info);
6226  s & BOOST_SERIALIZATION_NVP(p_sh_flags);
6227  s & BOOST_SERIALIZATION_NVP(p_sh_addr);
6228  s & BOOST_SERIALIZATION_NVP(p_sh_offset);
6229  s & BOOST_SERIALIZATION_NVP(p_sh_size);
6230  s & BOOST_SERIALIZATION_NVP(p_sh_addralign);
6231  s & BOOST_SERIALIZATION_NVP(p_sh_entsize);
6232  s & BOOST_SERIALIZATION_NVP(p_extra);
6233  }
6234 #endif
6235 
6236  public:
6239  SHT_NULL = 0,
6243  SHT_RELA = 4,
6244  SHT_HASH = 5,
6246  SHT_NOTE = 7,
6248  SHT_REL = 9,
6249  SHT_SHLIB = 10,
6250  SHT_DYNSYM = 11,
6252  SHT_LOOS = 0x60000000,
6253  SHT_GNU_verdef = 0x6ffffffd,
6254  SHT_GNU_verneed = 0x6ffffffe,
6255  SHT_GNU_versym = 0x6fffffff,
6256  SHT_HIOS = 0x6fffffff, /*NO_STRINGIFY*/
6257 
6258  SHT_LOPROC = 0x70000000, /* Processor specific semantics */
6259  SHT_HIPROC = 0x7fffffff,
6260  SHT_LOUSER = 0x80000000, /* Application specific semantics */
6261  SHT_HIUSER = 0xffffffff
6262  };
6263 
6267  SHF_WRITE= (1 << 0),
6268  SHF_ALLOC= (1 << 1),
6269  SHF_EXECINSTR= (1 << 2),
6270  SHF_MERGE= (1 << 4),
6271  SHF_STRINGS= (1 << 5),
6272  SHF_INFO_LINK= (1 << 6),
6273  SHF_LINK_ORDER= (1 << 7),
6275  SHF_GROUP= (1 << 9),
6276  SHF_TLS= (1 << 10),
6277  SHF_MASKOS= 0x0ff00000,
6278  SHF_MASKPROC= 0xf0000000
6279  };
6280 
6287 #ifdef _MSC_VER
6288 # pragma pack (1)
6289 #endif
6291  uint32_t sh_name; /* 0x00 Section name; index into section header string table */
6292  uint32_t sh_type; /* 0x04 Section contents and semantics (see SectionType enum) */
6293  uint32_t sh_flags; /* 0x08 Bit flags */
6294  uint32_t sh_addr; /* 0x0c Desired mapped address */
6295  uint32_t sh_offset; /* 0x10 Section location in file unless sh_type==SHT_NOBITS */
6296  uint32_t sh_size; /* 0x14 Section size in bytes */
6297  uint32_t sh_link; /* 0x18 Section ID of another section; meaning depends on section type */
6298  uint32_t sh_info; /* 0x1c Extra info depending on section type */
6299  uint32_t sh_addralign; /* 0x20 Mapped alignment (0 and 1=>byte aligned); sh_addr must be aligned*/
6300  uint32_t sh_entsize; /* 0x24 If non-zero, size in bytes of each array member in the section */
6301  } /* 0x28 */
6302 #if !defined(SWIG) && !defined(_MSC_VER)
6303  __attribute__((packed))
6304 #endif
6305  ;
6306 
6308  uint32_t sh_name; /* 0x00 see Elf32SectionTableEntry_disk */
6309  uint32_t sh_type; /* 0x04 */
6310  uint64_t sh_flags; /* 0x08 */
6311  uint64_t sh_addr; /* 0x10 */
6312  uint64_t sh_offset; /* 0x18 */
6313  uint64_t sh_size; /* 0x20 */
6314  uint32_t sh_link; /* 0x28 */
6315  uint32_t sh_info; /* 0x2c */
6316  uint64_t sh_addralign; /* 0x30 */
6317  uint64_t sh_entsize; /* 0x38 */
6318  } /* 0x40 */
6319 #if !defined(SWIG) && !defined(_MSC_VER)
6320  __attribute__((packed))
6321 #endif
6322  ;
6323 #ifdef _MSC_VER
6324 # pragma pack ()
6325 #endif
6326 
6328  SgAsmElfSectionTableEntry(ByteOrder::Endianness sex,
6330 
6332  SgAsmElfSectionTableEntry(ByteOrder::Endianness sex,
6334 
6338  void *encode(ByteOrder::Endianness sex,
6340  void *encode(ByteOrder::Endianness sex,
6346 
6348  virtual void dump(FILE*, const char *prefix, ssize_t idx) const;
6349 
6350  // Use Rose::stringify... function instead.
6351  static std::string to_string(SgAsmElfSectionTableEntry::SectionType);
6352  static std::string to_string(SgAsmElfSectionTableEntry::SectionFlags);
6353 
6354  private:
6355  void ctor(ByteOrder::Endianness, const SgAsmElfSectionTableEntry::Elf32SectionTableEntry_disk*);
6356  void ctor(ByteOrder::Endianness, const SgAsmElfSectionTableEntry::Elf64SectionTableEntry_disk*);
6357 #endif // SgAsmElfSectionTableEntry_OTHERS
6358 
6359 #ifdef DOCUMENTATION
6360  };
6361 #endif
6362 
6363 
6364 
6366 
6367  /*************************************************************************************************************************
6368  * ELF Segment Tables
6369  *************************************************************************************************************************/
6370 
6372 
6373  DECLARE_LEAF_CLASS(AsmElfSegmentTable);
6374  IS_SERIALIZABLE(AsmElfSegmentTable);
6375 
6376 #ifdef DOCUMENTATION
6377 
6384  public:
6385 #endif
6386 
6387  DECLARE_OTHERS(AsmElfSegmentTable);
6388 #if defined(SgAsmElfSegmentTable_OTHERS) || defined(DOCUMENTATION)
6389 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
6390  private:
6391  friend class boost::serialization::access;
6392 
6393  template<class S>
6394  void serialize(S &s, const unsigned /*version*/) {
6395  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmGenericSection);
6396  }
6397 #endif
6398 
6399  public:
6402  : SgAsmGenericSection(fhdr->get_file(), fhdr) {
6403  ctor();
6404  }
6405 
6410  virtual SgAsmElfSegmentTable *parse() override;
6411 
6426 
6430  rose_addr_t calculate_sizes(size_t *entsize, size_t *required, size_t *optional, size_t *entcount) const;
6431 
6433  virtual bool reallocate() override;
6434 
6436  virtual void unparse(std::ostream&) const override;
6437 
6439  virtual void dump(FILE*, const char *prefix, ssize_t idx) const override;
6440 
6441  private:
6442  void ctor();
6443 #endif // SgAsmElfSegmentTable_OTHERS
6444 
6445 #ifdef DOCUMENTATION
6446  };
6447 #endif
6448 
6450 
6451  DECLARE_LEAF_CLASS(AsmElfSegmentTableEntryList);
6452  IS_SERIALIZABLE(AsmElfSegmentTableEntryList);
6453 
6454 #ifdef DOCUMENTATION
6456  public:
6457 #endif
6458 
6459 #ifdef DOCUMENTATION
6460 
6466  const SgAsmElfSegmentTableEntryPtrList& get_entries();
6467  void set_entries(const SgAsmElfSegmentTableEntryPtrList&);
6469 #else
6470  AsmElfSegmentTableEntryList.setDataPrototype("SgAsmElfSegmentTableEntryPtrList", "entries", "",
6471  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL,
6472  NO_DELETE);
6473 #endif
6474 
6475  DECLARE_OTHERS(AsmElfSegmentTableEntryList);
6476 #if defined(SgAsmElfSegmentTableEntryList_OTHERS) || defined(DOCUMENTATION)
6477 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
6478  private:
6479  friend class boost::serialization::access;
6480 
6481  template<class S>
6482  void serialize(S &s, const unsigned /*version*/) {
6483  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
6484  }
6485 #endif
6486 #endif // SgAsmElfSegmentTableEntryList_OTHERS
6487 
6488 #ifdef DOCUMENTATION
6489  };
6490 #endif
6491 
6492 
6494 
6495  DECLARE_LEAF_CLASS(AsmElfSegmentTableEntry);
6496  IS_SERIALIZABLE(AsmElfSegmentTableEntry);
6497 
6498 #ifdef DOCUMENTATION
6499 
6501  public:
6502 #endif
6503 
6504 #ifdef DOCUMENTATION
6505 
6510  size_t get_index() const;
6511  void set_index(size_t);
6513 #else
6514  AsmElfSegmentTableEntry.setDataPrototype("size_t", "index", "= 0",
6515  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
6516 #endif
6517 
6518 #ifdef DOCUMENTATION
6519 
6522  SegmentType get_type() const;
6523  void set_type(SegmentType);
6525 #else
6526  AsmElfSegmentTableEntry.setDataPrototype("SgAsmElfSegmentTableEntry::SegmentType", "type",
6527  "= SgAsmElfSegmentTableEntry::PT_LOAD",
6528  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
6529 #endif
6530 
6531 #ifdef DOCUMENTATION
6532 
6535  SegmentFlags get_flags() const;
6536  void set_flags(SegmentFlags);
6538 #else
6539  AsmElfSegmentTableEntry.setDataPrototype("SgAsmElfSegmentTableEntry::SegmentFlags", "flags",
6540  "= SgAsmElfSegmentTableEntry::PF_NONE",
6541  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
6542 #endif
6543 
6544 #ifdef DOCUMENTATION
6545 
6550  rose_addr_t get_offset() const;
6551  void set_offset(rose_addr_t);
6553 #else
6554  AsmElfSegmentTableEntry.setDataPrototype("rose_addr_t", "offset", "= 0",
6555  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
6556 #endif
6557 
6558 #ifdef DOCUMENTATION
6559 
6565  rose_addr_t get_vaddr() const;
6566  void set_vaddr(rose_addr_t);
6568 #else
6569  AsmElfSegmentTableEntry.setDataPrototype("rose_addr_t", "vaddr", "= 0",
6570  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
6571 #endif
6572 
6573 #ifdef DOCUMENTATION
6574 
6579  rose_addr_t get_paddr() const;
6580  void set_paddr(rose_addr_t);
6582 #else
6583  AsmElfSegmentTableEntry.setDataPrototype("rose_addr_t", "paddr", "= 0",
6584  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
6585 #endif
6586 
6587 #ifdef DOCUMENTATION
6588 
6593  rose_addr_t get_filesz() const;
6594  void set_filesz(rose_addr_t);
6596 #else
6597  AsmElfSegmentTableEntry.setDataPrototype("rose_addr_t", "filesz", "= 0",
6598  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
6599 #endif
6600 
6601 #ifdef DOCUMENTATION
6602 
6607  rose_addr_t get_memsz() const;
6608  void set_memsz(rose_addr_t);
6610 #else
6611  AsmElfSegmentTableEntry.setDataPrototype("rose_addr_t", "memsz", "= 0",
6612  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
6613 #endif
6614 
6615 #ifdef DOCUMENTATION
6616 
6621  rose_addr_t get_align() const;
6622  void set_align(rose_addr_t);
6624 #else
6625  AsmElfSegmentTableEntry.setDataPrototype("rose_addr_t", "align", "= 0",
6626  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
6627 #endif
6628 
6629 #ifdef DOCUMENTATION
6630 
6635  const SgUnsignedCharList& get_extra() const;
6636  void set_extra(const SgUnsignedCharList&);
6638 #else
6639  AsmElfSegmentTableEntry.setDataPrototype("SgUnsignedCharList", "extra", "",
6640  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
6641 #endif
6642 
6643  DECLARE_OTHERS(AsmElfSegmentTableEntry);
6644 #if defined(SgAsmElfSegmentTableEntry_OTHERS) || defined(DOCUMENTATION)
6645 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
6646  private:
6647  friend class boost::serialization::access;
6648 
6649  template<class S>
6650  void serialize(S &s, const unsigned /*version*/) {
6651  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
6652  s & BOOST_SERIALIZATION_NVP(p_index);
6653  s & BOOST_SERIALIZATION_NVP(p_type);
6654  s & BOOST_SERIALIZATION_NVP(p_flags);
6655  s & BOOST_SERIALIZATION_NVP(p_offset);
6656  s & BOOST_SERIALIZATION_NVP(p_vaddr);
6657  s & BOOST_SERIALIZATION_NVP(p_paddr);
6658  s & BOOST_SERIALIZATION_NVP(p_filesz);
6659  s & BOOST_SERIALIZATION_NVP(p_memsz);
6660  s & BOOST_SERIALIZATION_NVP(p_align);
6661  s & BOOST_SERIALIZATION_NVP(p_extra);
6662  }
6663 #endif
6664 
6665  public:
6668  PT_NULL = 0,
6669  PT_LOAD = 1,
6672  PT_NOTE = 4,
6673  PT_SHLIB = 5,
6674  PT_PHDR = 6,
6675  PT_TLS = 7,
6677  // OS- and Processor-specific ranges
6678  PT_LOOS = 0x60000000,
6679  PT_HIOS = 0x6fffffff,
6680  PT_LOPROC = 0x70000000,
6681  PT_HIPROC = 0x7fffffff,
6682 
6683  // OS-specific values for GNU/Linux
6684  PT_GNU_EH_FRAME = 0x6474e550,
6685  PT_GNU_STACK = 0x6474e551,
6686  PT_GNU_RELRO = 0x6474e552,
6687  PT_PAX_FLAGS = 0x65041580,
6689  // OS-specific values for Sun
6690  PT_SUNWBSS = 0x6ffffffa,
6691  PT_SUNWSTACK = 0x6ffffffb
6692  };
6693 
6696  PF_NONE = 0,
6697  PF_RESERVED = 0x000ffff8,
6698  PF_XPERM = 0x00000001,
6699  PF_WPERM = 0x00000002,
6700  PF_RPERM = 0x00000004,
6701  PF_OS_MASK = 0x0ff00000,
6702  PF_PROC_MASK = 0xf0000000
6703  };
6704 
6705 #ifdef _MSC_VER
6706 # pragma pack (1)
6707 #endif
6708 
6716  uint32_t p_type;
6717  uint32_t p_offset;
6718  uint32_t p_vaddr;
6719  uint32_t p_paddr;
6720  uint32_t p_filesz;
6721  uint32_t p_memsz;
6722  uint32_t p_flags;
6723  uint32_t p_align;
6724  } /* 0x30 */
6725 #if !defined(SWIG) && !defined(_MSC_VER)
6726  __attribute__((packed))
6727 #endif
6728  ;
6729 
6731  uint32_t p_type; /* 0x00 */
6732  uint32_t p_flags; /* 0x04 */
6733  uint64_t p_offset; /* 0x08 */
6734  uint64_t p_vaddr; /* 0x10 */
6735  uint64_t p_paddr; /* 0x18 */
6736  uint64_t p_filesz; /* 0x20 */
6737  uint64_t p_memsz; /* 0x28 */
6738  uint64_t p_align; /* 0x30 */
6739  } /* 0x38 */
6740 #if !defined(SWIG) && !defined(_MSC_VER)
6741  __attribute__((packed))
6742 #endif
6743  ;
6744 #ifdef _MSC_VER
6745 # pragma pack ()
6746 #endif
6747 
6749  SgAsmElfSegmentTableEntry(ByteOrder::Endianness sex,
6751 
6753  SgAsmElfSegmentTableEntry(ByteOrder::Endianness sex,
6755 
6759  void *encode(ByteOrder::Endianness, SgAsmElfSegmentTableEntry::Elf32SegmentTableEntry_disk*) const;
6760  void *encode(ByteOrder::Endianness, SgAsmElfSegmentTableEntry::Elf64SegmentTableEntry_disk*) const;
6765 
6767  virtual void dump(FILE*, const char *prefix, ssize_t idx) const;
6768 
6771 
6774 
6775  private:
6776  void ctor(ByteOrder::Endianness, const SgAsmElfSegmentTableEntry::Elf32SegmentTableEntry_disk*);
6777  void ctor(ByteOrder::Endianness, const SgAsmElfSegmentTableEntry::Elf64SegmentTableEntry_disk*);
6778 #endif // SgAsmElfSegmentTableEntry_OTHERS
6779 
6780 #ifdef DOCUMENTATION
6781  };
6782 #endif
6783 
6784 
6785 
6787 
6788  /*************************************************************************************************************************
6789  * ELF Symbol Tables
6790  *************************************************************************************************************************/
6791 
6793 
6794  DECLARE_LEAF_CLASS(AsmElfSymbolSection);
6795  IS_SERIALIZABLE(AsmElfSymbolSection);
6796 
6797 #ifdef DOCUMENTATION
6798 
6800  public:
6801 #endif
6802 
6803 #ifdef DOCUMENTATION
6804 
6807  bool get_is_dynamic() const;
6808  void set_is_dynamic(bool);
6810 #else
6811  AsmElfSymbolSection.setDataPrototype("bool", "is_dynamic", "= false",
6812  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
6813 #endif
6814 
6815 #ifdef DOCUMENTATION
6816 
6825 #else
6826  AsmElfSymbolSection.setDataPrototype("SgAsmElfSymbolList*", "symbols", "= NULL",
6827  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
6828 #endif
6829 
6830  DECLARE_OTHERS(AsmElfSymbolSection);
6831 #if defined(SgAsmElfSymbolSection_OTHERS) || defined(DOCUMENTATION)
6832 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
6833  private:
6834  friend class boost::serialization::access;
6835 
6836  template<class S>
6837  void serialize(S &s, const unsigned /*version*/) {
6838  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmElfSection);
6839  s & BOOST_SERIALIZATION_NVP(p_is_dynamic);
6840  s & BOOST_SERIALIZATION_NVP(p_symbols);
6841  }
6842 #endif
6843 
6844  public:
6847  : SgAsmElfSection(fhdr), p_is_dynamic(false) {
6848  ctor(strsec);
6849  }
6850 
6852  virtual SgAsmElfSymbolSection* parse() override;
6853 
6866  virtual void finish_parsing() override;
6867 
6869  size_t index_of(SgAsmElfSymbol*);
6870 
6875  virtual rose_addr_t calculate_sizes(size_t *total, size_t *required, size_t *optional, size_t *nentries) const override;
6876 
6880  virtual bool reallocate() override;
6881 
6883  virtual void unparse(std::ostream&) const override;
6884 
6886  virtual void dump(FILE*, const char *prefix, ssize_t idx) const override;
6887 
6888  private:
6889  void ctor(SgAsmElfStringSection*);
6890 #endif // SgAsmElfSymbolSection_OTHERS
6891 
6892 #ifdef DOCUMENTATION
6893  };
6894 #endif
6895 
6897 
6898  DECLARE_LEAF_CLASS(AsmElfSymbolList);
6899  IS_SERIALIZABLE(AsmElfSymbolList);
6900 
6901 #ifdef DOCUMENTATION
6903  public:
6904 #endif
6905 
6906 #ifdef DOCUMENTATION
6907 
6913  const SgAsmElfSymbolPtrList& get_symbols() const;
6914  void set_symbols(const SgAsmElfSymbolPtrList&);
6916 #else
6917  AsmElfSymbolList.setDataPrototype("SgAsmElfSymbolPtrList", "symbols", "",
6918  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
6919 #endif
6920 
6921  DECLARE_OTHERS(AsmElfSymbolList);
6922 #if defined(SgAsmElfSymbolList_OTHERS) || defined(DOCUMENTATION)
6923 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
6924  private:
6925  friend class boost::serialization::access;
6926 
6927  template<class S>
6928  void serialize(S &s, const unsigned /*version*/) {
6929  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
6930  s & BOOST_SERIALIZATION_NVP(p_symbols);
6931  }
6932 #endif
6933 #endif // SgAsmElfSymbolList_OTHERS
6934 
6935 #ifdef DOCUMENTATION
6936  };
6937 #endif
6938 
6940 
6941  DECLARE_LEAF_CLASS(AsmElfSymbol);
6942  IS_SERIALIZABLE(AsmElfSymbol);
6943 
6944 #ifdef DOCUMENTATION
6945 
6950  public:
6951 #endif
6952 
6953 #ifdef DOCUMENTATION
6954 
6959  unsigned char get_st_info() const;
6960  void set_st_info(unsigned char);
6962 #else
6963  AsmElfSymbol.setDataPrototype("unsigned char", "st_info", "= 0",
6964  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
6965 #endif
6966 
6967 #ifdef DOCUMENTATION
6968 
6973  unsigned char get_st_res1() const;
6974  void set_st_res1(unsigned char);
6976 #else
6977  AsmElfSymbol.setDataPrototype("unsigned char", "st_res1", "= 0",
6978  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
6979 #endif
6980 
6981 #ifdef DOCUMENTATION
6982 
6987  unsigned get_st_shndx() const;
6988  void set_st_shndx(unsigned);
6990 #else
6991  AsmElfSymbol.setDataPrototype("unsigned", "st_shndx", "= 0",
6992  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
6993 #endif
6994 
6995 #ifdef DOCUMENTATION
6996 
7001  rose_addr_t get_st_size() const;
7002  void set_st_size(rose_addr_t);
7004 #else
7005  AsmElfSymbol.setDataPrototype("rose_addr_t", "st_size", "= 0",
7006  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
7007 #endif
7008 
7009 #ifdef DOCUMENTATION
7010 
7015  const SgUnsignedCharList& get_extra() const;
7016  void set_extra(const SgUnsignedCharList&);
7018 #else
7019  AsmElfSymbol.setDataPrototype("SgUnsignedCharList", "extra", "",
7020  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
7021 #endif
7022 
7023  DECLARE_OTHERS(AsmElfSymbol);
7024 #if defined(SgAsmElfSymbol_OTHERS) || defined(DOCUMENTATION)
7025 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
7026  private:
7027  friend class boost::serialization::access;
7028 
7029  template<class S>
7030  void serialize(S &s, const unsigned /*version*/) {
7031  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmGenericSymbol);
7032  s & BOOST_SERIALIZATION_NVP(p_st_info);
7033  s & BOOST_SERIALIZATION_NVP(p_st_res1);
7034  s & BOOST_SERIALIZATION_NVP(p_st_shndx);
7035  s & BOOST_SERIALIZATION_NVP(p_st_size);
7036  s & BOOST_SERIALIZATION_NVP(p_extra);
7037  }
7038 #endif
7039 
7040  public:
7041  enum ElfSymBinding {
7042  STB_LOCAL=0,
7043  STB_GLOBAL=1,
7044  STB_WEAK=2
7045  };
7046 
7047  enum ElfSymType {
7050  STT_FUNC = 2,
7052  STT_FILE = 4,
7054  STT_TLS = 6,
7056  };
7057 
7058 #ifdef _MSC_VER
7059 # pragma pack (1)
7060 #endif
7061 
7064  uint32_t st_name;
7065  uint32_t st_value;
7066  uint32_t st_size;
7067  unsigned char st_info;
7068  unsigned char st_res1;
7069  uint16_t st_shndx;
7070  }
7071 #if !defined(SWIG) && !defined(_MSC_VER)
7072  __attribute__((packed))
7073 #endif
7074  ;
7075 
7077  uint32_t st_name;
7078  unsigned char st_info;
7079  unsigned char st_res1;
7080  uint16_t st_shndx;
7081  uint64_t st_value;
7082  uint64_t st_size;
7083  }
7084 #if !defined(SWIG) && !defined(_MSC_VER)
7085  __attribute__((packed))
7086 #endif
7087  ;
7088 
7089 #ifdef _MSC_VER
7090 # pragma pack ()
7091 #endif
7092 
7094  explicit SgAsmElfSymbol(SgAsmElfSymbolSection *symtab) { ctor(symtab); }
7095 
7099  void parse(ByteOrder::Endianness, const SgAsmElfSymbol::Elf32SymbolEntry_disk*);
7100 
7104  void parse(ByteOrder::Endianness, const SgAsmElfSymbol::Elf64SymbolEntry_disk*);
7105 
7109  void *encode(ByteOrder::Endianness, SgAsmElfSymbol::Elf32SymbolEntry_disk*) const;
7110  void *encode(ByteOrder::Endianness, SgAsmElfSymbol::Elf64SymbolEntry_disk*) const;
7118  virtual void dump(FILE *f, const char *prefix, ssize_t idx) const override;
7119  void dump(FILE*, const char *prefix, ssize_t idx, SgAsmGenericSection*) const;
7123  SgAsmElfSymbol::ElfSymBinding get_elf_binding() const;
7124 
7127 
7129  static std::string to_string(SgAsmElfSymbol::ElfSymBinding);
7130 
7132  static std::string to_string(SgAsmElfSymbol::ElfSymType);
7133 
7134  private:
7135  void ctor(SgAsmElfSymbolSection*);
7136  void parse_common(); // initialization common to all parse() methods
7137 #endif // SgAsmElfSymbol_OTHERS
7138 
7139 #ifdef DOCUMENTATION
7140  };
7141 #endif
7142 
7143 
7144 
7146 
7147  /*************************************************************************************************************************
7148  * ELF Symbol Version Tables
7149  *************************************************************************************************************************/
7150 
7152 
7153  DECLARE_LEAF_CLASS(AsmElfSymverSection);
7154  IS_SERIALIZABLE(AsmElfSymverSection);
7155 
7156 #ifdef DOCUMENTATION
7157 
7162  public:
7163 #endif
7164 
7165 #ifdef DOCUMENTATION
7166 
7175 #else
7176  AsmElfSymverSection.setDataPrototype("SgAsmElfSymverEntryList*", "entries", "= NULL",
7177  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
7178 #endif
7179 
7180  DECLARE_OTHERS(AsmElfSymverSection);
7181 #if defined(SgAsmElfSymverSection_OTHERS) || defined(DOCUMENTATION)
7182 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
7183  private:
7184  friend class boost::serialization::access;
7185 
7186  template<class S>
7187  void serialize(S &s, const unsigned /*version*/) {
7188  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmElfSection);
7189  s & BOOST_SERIALIZATION_NVP(p_entries);
7190  }
7191 #endif
7192 
7193  public:
7196  : SgAsmElfSection(fhdr) {
7197  ctor();
7198  }
7199 
7201  virtual SgAsmElfSymverSection* parse() override;
7202 
7207  virtual rose_addr_t calculate_sizes(size_t *total, size_t *required, size_t *optional, size_t *nentries) const override;
7208 
7210  virtual void unparse(std::ostream&) const override;
7211 
7213  virtual void dump(FILE*, const char *prefix, ssize_t idx) const override;
7214  private:
7215  void ctor();
7216 #endif // SgAsmElfSymverSection_OTHERS
7217 
7218 #ifdef DOCUMENTATION
7219  };
7220 #endif
7221 
7223 
7224  DECLARE_LEAF_CLASS(AsmElfSymverEntry);
7225  IS_SERIALIZABLE(AsmElfSymverEntry);
7226 
7227 #ifdef DOCUMENTATION
7228 
7230  public:
7231 #endif
7232 
7233 #ifdef DOCUMENTATION
7234 
7239  size_t get_value() const;
7240  void set_value(size_t);
7242 #else
7243  AsmElfSymverEntry.setDataPrototype("size_t", "value", "= 0",
7244  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
7245 #endif
7246 
7247  DECLARE_OTHERS(AsmElfSymverEntry);
7248 #if defined(SgAsmElfSymverEntry_OTHERS) || defined(DOCUMENTATION)
7249 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
7250  private:
7251  friend class boost::serialization::access;
7252 
7253  template<class S>
7254  void serialize(S &s, const unsigned /*version*/) {
7255  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
7256  s & BOOST_SERIALIZATION_NVP(p_value);
7257  }
7258 #endif
7259 
7260  public:
7263  : p_value(0) {
7264  ctor(symver);
7265  }
7266 
7268  virtual void dump(FILE *f, const char *prefix, ssize_t idx) const;
7269 
7270  private:
7271  void ctor(SgAsmElfSymverSection*);
7272 #endif // SgAsmElfSymverEntry_OTHERS
7273 
7274 #ifdef DOCUMENTATION
7275  };
7276 #endif
7277 
7279 
7280 
7281  DECLARE_LEAF_CLASS(AsmElfSymverEntryList);
7282  IS_SERIALIZABLE(AsmElfSymverEntryList);
7283 
7284 #ifdef DOCUMENTATION
7285 
7290  public:
7291 #endif
7292 
7293 #ifdef DOCUMENTATION
7294 
7297  const SgAsmElfSymverEntryPtrList& get_entries() const;
7298  void set_entries(const SgAsmElfSymverEntryPtrList&);
7300 #else
7301  AsmElfSymverEntryList.setDataPrototype("SgAsmElfSymverEntryPtrList", "entries", "",
7302  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL,
7303  NO_DELETE);
7304 #endif
7305 
7306  DECLARE_OTHERS(AsmElfSymverEntryList);
7307 #if defined(SgAsmElfSymverEntryList_OTHERS) || defined(DOCUMENTATION)
7308 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
7309  private:
7310  friend class boost::serialization::access;
7311 
7312  template<class S>
7313  void serialize(S &s, const unsigned /*version*/) {
7314  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
7315  s & BOOST_SERIALIZATION_NVP(p_entries);
7316  }
7317 #endif
7318 #endif // SgAsmElfSymverEntryList_OTHERS
7319 
7320 #ifdef DOCUMENTATION
7321  };
7322 #endif
7323 
7325 
7326  DECLARE_LEAF_CLASS(AsmElfSymverDefinedSection);
7327  IS_SERIALIZABLE(AsmElfSymverDefinedSection);
7328 
7329 #ifdef DOCUMENTATION
7330 
7336  public:
7337 #endif
7338 
7339 #ifdef DOCUMENTATION
7340 
7349 #else
7350  AsmElfSymverDefinedSection.setDataPrototype("SgAsmElfSymverDefinedEntryList*", "entries", "= NULL",
7351  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL,
7352  NO_DELETE);
7353 #endif
7354 
7355  DECLARE_OTHERS(AsmElfSymverDefinedSection);
7356 #if defined(SgAsmElfSymverDefinedSection_OTHERS) || defined(DOCUMENTATION)
7357 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
7358  private:
7359  friend class boost::serialization::access;
7360 
7361  template<class S>
7362  void serialize(S &s, const unsigned /*version*/) {
7363  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmElfSection);
7364  s & BOOST_SERIALIZATION_NVP(p_entries);
7365  }
7366 #endif
7367 
7368  public:
7371  : SgAsmElfSection(fhdr) {
7372  ctor(strsec);
7373  }
7374 
7443  virtual SgAsmElfSymverDefinedSection* parse() override;
7444 
7447  virtual rose_addr_t calculate_sizes(size_t *total, size_t *required, size_t *optional, size_t *nentries) const override;
7448 
7452  virtual void unparse(std::ostream&) const override;
7453 
7455  virtual void dump(FILE*, const char *prefix, ssize_t idx) const override;
7456 
7457  private:
7458  void ctor(SgAsmElfStringSection*);
7459 #endif // SgAsmElfSymverDefinedSection_OTHERS
7460 
7461 #ifdef DOCUMENTATION
7462  };
7463 #endif
7464 
7466 
7467  DECLARE_LEAF_CLASS(AsmElfSymverDefinedEntryList);
7468  IS_SERIALIZABLE(AsmElfSymverDefinedEntryList);
7469 
7470 #ifdef DOCUMENTATION
7471 
7476  public:
7477 #endif
7478 
7479 #ifdef DOCUMENTATION
7480 
7483  const SgAsmElfSymverDefinedEntryPtrList& get_entries() const;
7484  void set_entries(const SgAsmElfSymverDefinedPtrList&);
7486 #else
7487  AsmElfSymverDefinedEntryList.setDataPrototype("SgAsmElfSymverDefinedEntryPtrList", "entries", "",
7488  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL,
7489  NO_DELETE);
7490 #endif
7491 
7492  DECLARE_OTHERS(AsmElfSymverDefinedEntryList);
7493 #if defined(SgAsmElfSymverDefinedEntryList_OTHERS) || defined(DOCUMENTATION)
7494 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
7495  private:
7496  friend class boost::serialization::access;
7497 
7498  template<class S>
7499  void serialize(S &s, const unsigned /*version*/) {
7500  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
7501  s & BOOST_SERIALIZATION_NVP(p_entries);
7502  }
7503 #endif
7504 #endif // SgAsmElfSymverDefinedEntryList_OTHERS
7505 
7506 #ifdef DOCUMENTATION
7507  };
7508 #endif
7509 
7511 
7512  DECLARE_LEAF_CLASS(AsmElfSymverDefinedEntry);
7513  IS_SERIALIZABLE(AsmElfSymverDefinedEntry);
7514 
7515 #ifdef DOCUMENTATION
7516 
7518  public:
7519 #endif
7520 
7521 #ifdef DOCUMENTATION
7522 
7527  size_t get_version() const;
7528  void set_version(size_t);
7530 #else
7531  AsmElfSymverDefinedEntry.setDataPrototype("size_t", "version", "= 0",
7532  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
7533 #endif
7534 
7535 #ifdef DOCUMENTATION
7536 
7541  int get_flags() const;
7542  void set_flags(int);
7544 #else
7545  AsmElfSymverDefinedEntry.setDataPrototype("int", "flags", "= 0",
7546  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
7547 #endif
7548 
7549 #ifdef DOCUMENTATION
7550 
7555  size_t get_index() const;
7556  void set_index(size_t);
7558 #else
7559  AsmElfSymverDefinedEntry.setDataPrototype("size_t", "index", "= 0",
7560  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
7561 #endif
7562 
7563 #ifdef DOCUMENTATION
7564 
7569  uint32_t get_hash() const;
7570  void set_hash(uint32_t);
7572 #else
7573  AsmElfSymverDefinedEntry.setDataPrototype("uint32_t", "hash", "= 0",
7574  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
7575 #endif
7576 
7577 #ifdef DOCUMENTATION
7578 
7587 #else
7588  AsmElfSymverDefinedEntry.setDataPrototype("SgAsmElfSymverDefinedAuxList*", "entries", "",
7589  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
7590 #endif
7591 
7592  DECLARE_OTHERS(AsmElfSymverDefinedEntry);
7593 #if defined(SgAsmElfSymverDefinedEntry_OTHERS) || defined(DOCUMENTATION)
7594 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
7595  private:
7596  friend class boost::serialization::access;
7597 
7598  template<class S>
7599  void serialize(S &s, const unsigned /*version*/) {
7600  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
7601  s & BOOST_SERIALIZATION_NVP(p_version);
7602  s & BOOST_SERIALIZATION_NVP(p_flags);
7603  s & BOOST_SERIALIZATION_NVP(p_index);
7604  s & BOOST_SERIALIZATION_NVP(p_hash);
7605  s & BOOST_SERIALIZATION_NVP(p_entries);
7606  }
7607 #endif
7608 
7609  public:
7610 #ifdef _MSC_VER
7611 # pragma pack (1)
7612 #endif
7613 
7615  uint16_t vd_version;
7616  uint16_t vd_flags;
7617  uint16_t vd_ndx;
7618  uint16_t vd_cnt;
7619  uint32_t vd_hash;
7620  uint32_t vd_aux;
7621  uint32_t vd_next;
7622  }
7623 #if !defined(SWIG) && !defined(_MSC_VER)
7624  __attribute__((packed))
7625 #endif
7626  ;
7627 
7628 #ifdef _MSC_VER
7629 # pragma pack ()
7630 #endif
7631 
7634  ctor(symver_defined);
7635  }
7636 
7638  void parse(ByteOrder::Endianness, const SgAsmElfSymverDefinedEntry::ElfSymverDefinedEntry_disk*);
7639 
7641  void *encode(ByteOrder::Endianness, SgAsmElfSymverDefinedEntry::ElfSymverDefinedEntry_disk*) const;
7642 
7644  virtual void dump(FILE *f, const char *prefix, ssize_t idx) const;
7645 
7646  private:
7647  void ctor(SgAsmElfSymverDefinedSection*);
7648 #endif // SgAsmElfSymverDefinedEntry_OTHERS
7649 
7650 #ifdef DOCUMENTATION
7651  };
7652 #endif
7653 
7655 
7656  DECLARE_LEAF_CLASS(AsmElfSymverDefinedAuxList);
7657  IS_SERIALIZABLE(AsmElfSymverDefinedAuxList);
7658 
7659 #ifdef DOCUMENTATION
7660 
7665  pbulic:
7666 #endif
7667 
7668 #ifdef DOCUMENTATION
7669 
7672  const SgAsmElfSymverDefinedAuxPtrList& get_entries() const;
7673  void set_entries(const SgAsmElfSymverDefinedAuxPtrList&);
7675 #else
7676  AsmElfSymverDefinedAuxList.setDataPrototype("SgAsmElfSymverDefinedAuxPtrList", "entries", "",
7677  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL,
7678  NO_DELETE);
7679 #endif
7680 
7681  DECLARE_OTHERS(AsmElfSymverDefinedAuxList);
7682 #if defined(SgAsmElfSymverDefinedAuxList_OTHERS) || defined(DOCUMENTATION)
7683 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
7684  private:
7685  friend class boost::serialization::access;
7686 
7687  template<class S>
7688  void serialize(S &s, const unsigned /*version*/) {
7689  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
7690  s & BOOST_SERIALIZATION_NVP(p_entries);
7691  }
7692 #endif
7693 #endif // SgAsmElfSymverDefinedAuxList_OTHERS
7694 
7695 #ifdef DOCUMENTATION
7696  };
7697 #endif
7698 
7700 
7701  DECLARE_LEAF_CLASS(AsmElfSymverDefinedAux);
7702  IS_SERIALIZABLE(AsmElfSymverDefinedAux);
7703 
7704 #ifdef DOCUMENTATION
7706  public:
7707 #endif
7708 
7709 #ifdef DOCUMENTATION
7710 
7713  SgAsmGenericString* get_name() const;
7716 #else
7717  AsmElfSymverDefinedAux.setDataPrototype("SgAsmGenericString*", "name", "= 0",
7718  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
7719 #endif
7720 
7721  DECLARE_OTHERS(AsmElfSymverDefinedAux);
7722 #if defined(SgAsmElfSymverDefinedAux_OTHERS) || defined(DOCUMENTATION)
7723 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
7724  private:
7725  friend class boost::serialization::access;
7726 
7727  template<class S>
7728  void serialize(S &s, const unsigned /*version*/) {
7729  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
7730  s & BOOST_SERIALIZATION_NVP(p_name);
7731  }
7732 #endif
7733 
7734  public:
7735 #ifdef _MSC_VER
7736 # pragma pack (1)
7737 #endif
7738 
7741  uint32_t vda_name;
7742  uint32_t vda_next;
7743  }
7744 #if !defined(SWIG) && !defined(_MSC_VER)
7745  __attribute__((packed))
7746 #endif
7747  ;
7748 
7749 #ifdef _MSC_VER
7750 # pragma pack ()
7751 #endif
7752 
7757  SgAsmElfSymverDefinedSection *symver_def_sec)
7758  : p_name(NULL) {
7759  ctor(symver_def_entry,symver_def_sec);
7760  }
7761 
7763  void parse(ByteOrder::Endianness, const SgAsmElfSymverDefinedAux::ElfSymverDefinedAux_disk*);
7764 
7766  void *encode(ByteOrder::Endianness, SgAsmElfSymverDefinedAux::ElfSymverDefinedAux_disk*) const;
7767 
7773  virtual void dump(FILE *f, const char *prefix, ssize_t idx) const;
7774 
7775  private:
7776  void ctor(SgAsmElfSymverDefinedEntry*,SgAsmElfSymverDefinedSection *symver_def_sec);
7777 #endif // SgAsmElfSymverDefinedAux_OTHERS
7778 
7779 #ifdef DOCUMENTATION
7780  };
7781 #endif
7782 
7784 
7785  DECLARE_LEAF_CLASS(AsmElfSymverNeededSection);
7786  IS_SERIALIZABLE(AsmElfSymverNeededSection);
7787 
7788 #ifdef DOCUMENTATION
7789 
7795  public:
7796 #endif
7797 
7798 #ifdef DOCUMENTATION
7799 
7808 #else
7809  AsmElfSymverNeededSection.setDataPrototype("SgAsmElfSymverNeededEntryList*", "entries", "= NULL",
7810  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
7811 #endif
7812 
7813  DECLARE_OTHERS(AsmElfSymverNeededSection);
7814 #if defined(SgAsmElfSymverNeededSection_OTHERS) || defined(DOCUMENTATION)
7815 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
7816  private:
7817  friend class boost::serialization::access;
7818 
7819  template<class S>
7820  void serialize(S &s, const unsigned /*version*/) {
7821  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmElfSection);
7822  s & BOOST_SERIALIZATION_NVP(p_entries);
7823  }
7824 #endif
7825 
7826  public:
7831  : SgAsmElfSection(fhdr) {
7832  ctor(strsec);
7833  }
7834 
7844  virtual SgAsmElfSymverNeededSection* parse() override;
7845 
7850  virtual rose_addr_t calculate_sizes(size_t *total, size_t *required, size_t *optional, size_t *nentries) const override;
7851 
7855  virtual void unparse(std::ostream&) const override;
7856 
7858  virtual void dump(FILE*, const char *prefix, ssize_t idx) const override;
7859 
7860  private:
7861  void ctor(SgAsmElfStringSection*);
7862 #endif // SgAsmElfSymverNeededSection_OTHERS
7863 
7864 #ifdef DOCUMENTATION
7865  };
7866 #endif
7867 
7869 
7870  DECLARE_LEAF_CLASS(AsmElfSymverNeededEntryList);
7871  IS_SERIALIZABLE(AsmElfSymverNeededEntryList);
7872 
7873 #ifdef DOCUMENTATION
7874 
7879  public:
7880 #endif
7881 
7882 #ifdef DOCUMENTATION
7883 
7886  const SgAsmElfSymverNeededEntryPtrList& get_entries() void;
7887  void set_entries(const SgAsmElfSymverNeededEntryPtrList&);
7889 #else
7890  AsmElfSymverNeededEntryList.setDataPrototype("SgAsmElfSymverNeededEntryPtrList", "entries", "",
7891  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL,
7892  NO_DELETE);
7893 #endif
7894 
7895  DECLARE_OTHERS(AsmElfSymverNeededEntryList);
7896 #if defined(SgAsmElfSymverNeededEntryList_OTHERS) || defined(DOCUMENTATION)
7897 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
7898  private:
7899  friend class boost::serialization::access;
7900 
7901  template<class S>
7902  void serialize(S &s, const unsigned /*version*/) {
7903  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
7904  s & BOOST_SERIALIZATION_NVP(p_entries);
7905  }
7906 #endif
7907 #endif // SgAsmElfSymverNeededEntryList_OTHERS
7908 
7909 #ifdef DOCUMENTATION
7910  };
7911 #endif
7912 
7914 
7915  DECLARE_LEAF_CLASS(AsmElfSymverNeededEntry);
7916  IS_SERIALIZABLE(AsmElfSymverNeededEntry);
7917 
7918 #ifdef DOCUMENTATION
7919 
7921  public:
7922 #endif
7923 
7924 #ifdef DOCUMENTATION
7925 
7930  size_t get_version() const;
7931  void set_version(size_t);
7933 #else
7934  AsmElfSymverNeededEntry.setDataPrototype("size_t", "version", "= 0",
7935  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
7936 #endif
7937 
7938 #ifdef DOCUMENTATION
7939 
7945 #else
7946  AsmElfSymverNeededEntry.setDataPrototype("SgAsmGenericString*", "file_name", "= 0",
7947  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
7948 #endif
7949 
7950 #ifdef DOCUMENTATION
7951 
7960 #else
7961  AsmElfSymverNeededEntry.setDataPrototype("SgAsmElfSymverNeededAuxList*", "entries", "",
7962  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
7963 #endif
7964 
7965  DECLARE_OTHERS(AsmElfSymverNeededEntry);
7966 #if defined(SgAsmElfSymverNeededEntry_OTHERS) || defined(DOCUMENTATION)
7967 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
7968  private:
7969  friend class boost::serialization::access;
7970 
7971  template<class S>
7972  void serialize(S &s, const unsigned /*version*/) {
7973  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
7974  s & BOOST_SERIALIZATION_NVP(p_version);
7975  s & BOOST_SERIALIZATION_NVP(p_file_name);
7976  s & BOOST_SERIALIZATION_NVP(p_entries);
7977  }
7978 #endif
7979 
7980  public:
7981 #ifdef _MSC_VER
7982 # pragma pack (1)
7983 #endif
7984 
7987  uint16_t vn_version;
7988  uint16_t vn_cnt;
7989  uint32_t vn_file;
7990  uint32_t vn_aux;
7991  uint32_t vn_next;
7992  }
7993 #if !defined(SWIG) && !defined(_MSC_VER)
7994  __attribute__((packed))
7995 #endif
7996  ;
7997 
7998 #ifdef _MSC_VER
7999 # pragma pack ()
8000 #endif
8001 
8004  : p_file_name(NULL) {
8005  ctor(symver_needed);
8006  }
8007 
8009  void parse(ByteOrder::Endianness, const SgAsmElfSymverNeededEntry::ElfSymverNeededEntry_disk*);
8010 
8012  void *encode(ByteOrder::Endianness, SgAsmElfSymverNeededEntry::ElfSymverNeededEntry_disk*) const;
8013 
8015  virtual void dump(FILE *f, const char *prefix, ssize_t idx) const;
8016 
8017  private:
8018  void ctor(SgAsmElfSymverNeededSection*);
8019 #endif // SgAsmElfSymverNeededEntry_OTHERS
8020 
8021 #ifdef DOCUMENTATION
8022  };
8023 #endif
8024 
8026 
8027  DECLARE_LEAF_CLASS(AsmElfSymverNeededAuxList);
8028  IS_SERIALIZABLE(AsmElfSymverNeededAuxList);
8029 
8030 #ifdef DOCUMENTATION
8031 
8036  public:
8037 #endif
8038 
8039 #ifdef DOCUMENTATION
8040 
8043  const SgAsmElfSymverNeededAuxPtrList& get_entries() const;
8044  void set_entries(const SgAsmElfSymverNeededAuxPtrList&);
8046 #else
8047  AsmElfSymverNeededAuxList.setDataPrototype("SgAsmElfSymverNeededAuxPtrList", "entries", "",
8048  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL,
8049  NO_DELETE);
8050 #endif
8051 
8052  DECLARE_OTHERS(AsmElfSymverNeededAuxList);
8053 #if defined(SgAsmElfSymverNeededAuxList_OTHERS) || defined(DOCUMENTATION)
8054 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
8055  private:
8056  friend class boost::serialization::access;
8057 
8058  template<class S>
8059  void serialize(S &s, const unsigned /*version*/) {
8060  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
8061  s & BOOST_SERIALIZATION_NVP(p_entries);
8062  }
8063 #endif
8064 #endif // SgAsmElfSymverNeededAuxList_OTHERS
8065 
8066 #ifdef DOCUMENTATION
8067  };
8068 #endif
8069 
8071 
8072  DECLARE_LEAF_CLASS(AsmElfSymverNeededAux);
8073  IS_SERIALIZABLE(AsmElfSymverNeededAux);
8074 
8075 #ifdef DOCUMENTATION
8076 
8078  public:
8079 #endif
8080 
8081 #ifdef DOCUMENTATION
8082 
8087  uint32_t get_hash() const;
8088  void set_hash(uint32_t);
8090 #else
8091  AsmElfSymverNeededAux.setDataPrototype("uint32_t", "hash", "= 0",
8092  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
8093 #endif
8094 
8095 #ifdef DOCUMENTATION
8096 
8101  int get_flags() const;
8102  void set_flags(int);
8104 #else
8105  AsmElfSymverNeededAux.setDataPrototype("int", "flags", "= 0",
8106  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
8107 #endif
8108 
8109 #ifdef DOCUMENTATION
8110 
8115  size_t get_other() const;
8116  void set_other(size_t);
8118 #else
8119  AsmElfSymverNeededAux.setDataPrototype("size_t", "other", "= 0",
8120  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
8121 #endif
8122 
8123 #ifdef DOCUMENTATION
8124 
8127  SgAsmGenericString* get_name() const;
8130 #else
8131  AsmElfSymverNeededAux.setDataPrototype("SgAsmGenericString*", "name", "= 0",
8132  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
8133 #endif
8134 
8135  DECLARE_OTHERS(AsmElfSymverNeededAux);
8136 #if defined(SgAsmElfSymverNeededAux_OTHERS) || defined(DOCUMENTATION)
8137 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
8138  private:
8139  friend class boost::serialization::access;
8140 
8141  template<class S>
8142  void serialize(S &s, const unsigned /*version*/) {
8143  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
8144  s & BOOST_SERIALIZATION_NVP(p_hash);
8145  s & BOOST_SERIALIZATION_NVP(p_flags);
8146  s & BOOST_SERIALIZATION_NVP(p_other);
8147  s & BOOST_SERIALIZATION_NVP(p_name);
8148  }
8149 #endif
8150 
8151  public:
8152 #ifdef _MSC_VER
8153 # pragma pack (1)
8154 #endif
8155 
8158  uint32_t vna_hash;
8159  uint16_t vna_flags;
8160  uint16_t vna_other;
8161  uint32_t vna_name;
8162  uint32_t vna_next;
8163  }
8164 #if !defined(SWIG) && !defined(_MSC_VER)
8165  __attribute__((packed))
8166 #endif
8167  ;
8168 
8169 #ifdef _MSC_VER
8170 # pragma pack ()
8171 #endif
8172 
8178  : p_name(NULL) {
8179  ctor(symver_needed_entry,symver_needed_sec);
8180  }
8181 
8183  void parse(ByteOrder::Endianness, const SgAsmElfSymverNeededAux::ElfSymverNeededAux_disk*);
8184 
8186  void *encode(ByteOrder::Endianness, SgAsmElfSymverNeededAux::ElfSymverNeededAux_disk*) const;
8187 
8193  virtual void dump(FILE *f, const char *prefix, ssize_t idx) const;
8194 
8195  private:
8197 #endif // SgAsmElfSymverNeededAux_OTHERS
8198 
8199 #ifdef DOCUMENTATION
8200  };
8201 #endif
8202 
8203 
8204 
8205 
8207 
8208  /*************************************************************************************************************************
8209  * ELF Relocation Tables
8210  *************************************************************************************************************************/
8211 
8213 
8214  DECLARE_LEAF_CLASS(AsmElfRelocSection);
8215  IS_SERIALIZABLE(AsmElfRelocSection);
8216 
8217 #ifdef DOCUMENTATION
8218 
8220  public:
8221 #endif
8222 
8223 #ifdef DOCUMENTATION
8224 
8227  bool get_uses_addend() const;
8228  void set_uses_addend(bool);
8230 #else
8231  AsmElfRelocSection.setDataPrototype("bool", "uses_addend", "= true",
8232  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
8233 #endif
8234 
8235 #ifdef DOCUMENTATION
8236 
8242 #else
8243  AsmElfRelocSection.setDataPrototype("SgAsmElfSection*", "target_section", "= NULL",
8244  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
8245 #endif
8246 
8247 #ifdef DOCUMENTATION
8248 
8256 #else
8257  AsmElfRelocSection.setDataPrototype("SgAsmElfRelocEntryList*", "entries", "= NULL",
8258  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
8259 #endif
8260 
8261  DECLARE_OTHERS(AsmElfRelocSection);
8262 #if defined(SgAsmElfRelocSection_OTHERS) || defined(DOCUMENTATION)
8263 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
8264  private:
8265  friend class boost::serialization::access;
8266 
8267  template<class S>
8268  void serialize(S &s, const unsigned /*version*/) {
8269  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmElfSection);
8270  s & BOOST_SERIALIZATION_NVP(p_uses_addend);
8271  s & BOOST_SERIALIZATION_NVP(p_target_section);
8272  s & BOOST_SERIALIZATION_NVP(p_entries);
8273  }
8274 #endif
8275 
8276  public:
8278  : SgAsmElfSection(fhdr) {
8279  ctor(symsec,targetsec);
8280  }
8281 
<