ROSE  0.11.87.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/InstructionEnumsX86.h>
396  namespace Rose { namespace BinaryAnalysis { class RegisterDictionary; } }
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/MemoryMap.h>
5177  namespace Rose { namespace BinaryAnalysis { class RegisterDictionary; } }
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  const Rose::BinaryAnalysis::RegisterDictionary *p_registers;
5233  bool coverageComputed; // true iff percentageCoverage has been computed
5234  mutable InstructionMap instruction_map; // cached instruction map
5235 
5237  // disassembly into instructions.
5238  double percentageCoverage;
5239 
5240 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
5241  private:
5242  friend class boost::serialization::access;
5243 
5244  template<class S>
5245  void serialize(S &s, const unsigned /*version*/) {
5246  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmNode);
5247  s & BOOST_SERIALIZATION_NVP(p_headers);
5248  s & BOOST_SERIALIZATION_NVP(p_global_block);
5249  s & BOOST_SERIALIZATION_NVP(p_map);
5250  s & BOOST_SERIALIZATION_NVP(p_registers);
5251  s & BOOST_SERIALIZATION_NVP(coverageComputed);
5252  s & BOOST_SERIALIZATION_NVP(instruction_map);
5253  s & BOOST_SERIALIZATION_NVP(percentageCoverage);
5254  }
5255 #endif
5256 
5257  public:
5260  : p_registers(NULL), coverageComputed(false), percentageCoverage(0.0), p_headers(NULL), p_global_block(NULL) {
5261  ctor();
5262  }
5263 
5268  SgAsmGenericFilePtrList get_files() const;
5269 
5296  InstructionMap& get_instruction_map(bool recompute=false);
5297  void set_instruction_map(const InstructionMap&);
5304  void insert_instructions(InstructionMap&/*in,out*/);
5305 
5310  void erase_instructions(InstructionMap&/*in,out*/);
5311 
5317  void set_coverageComputed(bool x) { coverageComputed = x; }
5318  void set_percentageCoverage(double x) { percentageCoverage = x; }
5321  private:
5322  void ctor(); // finalize construction
5323 #endif // SgAsmInterpretation_OTHERS
5324 
5325 #ifdef DOCUMENTATION
5326  };
5327 #endif
5328 
5329 
5330 
5332 
5333  /*************************************************************************************************************************
5334  * ELF File Header
5335  *************************************************************************************************************************/
5336 
5338 
5339  DECLARE_LEAF_CLASS(AsmElfFileHeader);
5340  IS_SERIALIZABLE(AsmElfFileHeader);
5341 
5342 #ifdef DOCUMENTATION
5343 
5352  public:
5353 #endif
5354 
5355 #ifdef DOCUMENTATION
5356 
5361  unsigned char get_e_ident_file_class() const;
5362  void set_e_ident_file_class(unsigned char);
5364 #else
5365  AsmElfFileHeader.setDataPrototype("unsigned char", "e_ident_file_class", "= 0",
5366  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5367 #endif
5368 
5369 #ifdef DOCUMENTATION
5370 
5375  unsigned char get_e_ident_data_encoding() const;
5376  void set_e_ident_data_encoding(unsigned char);
5378 #else
5379  AsmElfFileHeader.setDataPrototype("unsigned char", "e_ident_data_encoding", "= 0",
5380  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5381 #endif
5382 
5383 #ifdef DOCUMENTATION
5384 
5389  unsigned char get_e_ident_file_version() const;
5390  void set_e_ident_file_version(unsigned char*);
5392 #else
5393  AsmElfFileHeader.setDataPrototype("unsigned char", "e_ident_file_version", "= 0",
5394  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5395 #endif
5396 
5397 #ifdef DOCUMENTATION
5398 
5403  const SgUnsignedCharList& get_e_ident_padding() const;
5404  void set_e_ident_padding(const SgUnsignedCharList&);
5406 #else
5407  AsmElfFileHeader.setDataPrototype("SgUnsignedCharList", "e_ident_padding", "",
5408  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5409 #endif
5410 
5411 #ifdef DOCUMENTATION
5412 
5417  unsigned long get_e_type() const;
5418  void set_e_type(unsigned long);
5420 #else
5421  AsmElfFileHeader.setDataPrototype("unsigned long", "e_type", "= 0",
5422  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5423 #endif
5424 
5425 #ifdef DOCUMENTATION
5426 
5431  unsigned long get_e_machine() const;
5432  void set_e_machine(unsigned long);
5434 #else
5435  AsmElfFileHeader.setDataPrototype("unsigned long", "e_machine", "= 0",
5436  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5437 #endif
5438 
5439 #ifdef DOCUMENTATION
5440 
5445  unsigned long get_e_flags() const;
5446  void set_e_flags(unsigned long);
5448 #else
5449  AsmElfFileHeader.setDataPrototype("unsigned long", "e_flags", "= 0",
5450  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5451 #endif
5452 
5453 #ifdef DOCUMENTATION
5454 
5459  unsigned long get_e_ehsize() const;
5460  void set_e_ehsize(unsigned long);
5462 #else
5463  AsmElfFileHeader.setDataPrototype("unsigned long", "e_ehsize", "= 0",
5464  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5465 #endif
5466 
5467 #ifdef DOCUMENTATION
5468 
5473  unsigned long get_phextrasz() const;
5474  void set_phextrasz(unsigned long);
5476 #else
5477  AsmElfFileHeader.setDataPrototype("unsigned long", "phextrasz", "= 0",
5478  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5479 #endif
5480 
5481 #ifdef DOCUMENTATION
5482 
5487  unsigned long get_e_phnum() const;
5488  void set_e_phnum(unsigned long);
5490 #else
5491  AsmElfFileHeader.setDataPrototype("unsigned long", "e_phnum", "= 0",
5492  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5493 #endif
5494 
5495 #ifdef DOCUMENTATION
5496 
5501  unsigned long get_shextrasz() const;
5502  void set_shextrasz(unsigned long);
5504 #else
5505  AsmElfFileHeader.setDataPrototype("unsigned long", "shextrasz", "= 0",
5506  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5507 #endif
5508 
5509 #ifdef DOCUMENTATION
5510 
5515  unsigned long get_e_shnum() const;
5516  void set_e_shnum(unsigned long);
5518 #else
5519  AsmElfFileHeader.setDataPrototype("unsigned long", "e_shnum", "= 0",
5520  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5521 #endif
5522 
5523 #ifdef DOCUMENTATION
5524 
5529  unsigned long get_e_shstrndx() const;
5530  void set_e_shstrndx(unsigned long);
5532 #else
5533  AsmElfFileHeader.setDataPrototype("unsigned long", "e_shstrndx", "= 0",
5534  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5535 #endif
5536 
5537 #ifdef DOCUMENTATION
5538 
5548 #else
5549  AsmElfFileHeader.setDataPrototype("SgAsmElfSectionTable*", "section_table", "= NULL",
5550  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5551 #endif
5552 
5553 #ifdef DOCUMENTATION
5554 
5563 #else
5564  AsmElfFileHeader.setDataPrototype("SgAsmElfSegmentTable*", "segment_table", "= NULL",
5565  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5566 #endif
5567 
5568  DECLARE_OTHERS(AsmElfFileHeader);
5569 #if defined(SgAsmElfFileHeader_OTHERS) || defined(DOCUMENTATION)
5570 
5571 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
5572  private:
5573  friend class boost::serialization::access;
5574 
5575  template<class S>
5576  void serialize(S &s, const unsigned /*version*/) {
5577  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmGenericHeader);
5578  s & BOOST_SERIALIZATION_NVP(p_e_ident_file_class);
5579  s & BOOST_SERIALIZATION_NVP(p_e_ident_data_encoding);
5580  s & BOOST_SERIALIZATION_NVP(p_e_ident_file_version);
5581  s & BOOST_SERIALIZATION_NVP(p_e_ident_padding);
5582  s & BOOST_SERIALIZATION_NVP(p_e_type);
5583  s & BOOST_SERIALIZATION_NVP(p_e_machine);
5584  s & BOOST_SERIALIZATION_NVP(p_e_flags);
5585  s & BOOST_SERIALIZATION_NVP(p_e_ehsize);
5586  s & BOOST_SERIALIZATION_NVP(p_phextrasz);
5587  s & BOOST_SERIALIZATION_NVP(p_e_phnum);
5588  s & BOOST_SERIALIZATION_NVP(p_shextrasz);
5589  s & BOOST_SERIALIZATION_NVP(p_e_shnum);
5590  s & BOOST_SERIALIZATION_NVP(p_e_shstrndx);
5591  s & BOOST_SERIALIZATION_NVP(p_section_table);
5592  s & BOOST_SERIALIZATION_NVP(p_segment_table);
5593  }
5594 #endif
5595 
5596  public:
5598  enum ObjectType {
5599  ET_NONE = 0
5600  ,ET_REL = 1
5601  ,ET_EXEC = 2
5602  ,ET_DYN = 3
5603  ,ET_CORE = 4
5605  ,ET_LOOS = 0xfe00
5606  ,ET_HIOS = 0xfeff
5607  ,ET_LOPROC = 0xff00
5608  ,ET_HIPROC = 0xffff
5609  };
5610 
5611  // Some structures are used to represent certain things whose layout is very precise in binary files, thus we need to
5612  // make sure the compiler doesn't insert alignment padding between the struct members. ROSE can be compiled on an
5613  // architecture that has different alignment constraints than the architecture that these structs describe. GNU
5614  // compilers have long used the attribute mechanism. Microsoft compilers on the other hand use pragmas. GCC versions
5615  // 4.0 and earlier do not recognize the Microsoft pragmas and issue compiler errors when one is encountered.
5616 #ifdef _MSC_VER
5617 # pragma pack (1)
5618 #endif
5619 
5626  unsigned char e_ident_magic[4];
5627  unsigned char e_ident_file_class;
5628  unsigned char e_ident_data_encoding;
5629  unsigned char e_ident_file_version;
5630  unsigned char e_ident_padding[9];
5631  uint16_t e_type;
5632  uint16_t e_machine;
5633  uint32_t e_version;
5634  uint32_t e_entry;
5635  uint32_t e_phoff;
5636  uint32_t e_shoff;
5637  uint32_t e_flags;
5638  uint16_t e_ehsize;
5639  uint16_t e_phentsize;
5640  uint16_t e_phnum;
5641  uint16_t e_shentsize;
5642  uint16_t e_shnum;
5643  uint16_t e_shstrndx;
5644  }
5645 #if !defined(SWIG) && !defined(_MSC_VER)
5646  __attribute__((packed))
5647 #endif
5648  ;
5649 
5651  unsigned char e_ident_magic[4];
5652  unsigned char e_ident_file_class;
5653  unsigned char e_ident_data_encoding;
5654  unsigned char e_ident_file_version;
5655  unsigned char e_ident_padding[9];
5656  uint16_t e_type;
5657  uint16_t e_machine;
5658  uint32_t e_version;
5659  uint64_t e_entry;
5660  uint64_t e_phoff;
5661  uint64_t e_shoff;
5662  uint32_t e_flags;
5663  uint16_t e_ehsize;
5664  uint16_t e_phentsize;
5665  uint16_t e_phnum;
5666  uint16_t e_shentsize;
5667  uint16_t e_shnum;
5668  uint16_t e_shstrndx;
5669  }
5670 #if !defined(SWIG) && !defined(_MSC_VER)
5671  __attribute__((packed))
5672 #endif
5673  ;
5674 
5675 #ifdef _MSC_VER
5676 # pragma pack ()
5677 #endif
5678 
5686  : SgAsmGenericHeader(f) , p_e_ident_file_class(0), p_e_ident_file_version(1), p_e_type(0),
5687  p_e_machine(0), p_e_flags(0), p_e_ehsize(0), p_phextrasz(0), p_e_phnum(0), p_shextrasz(0),
5688  p_e_shnum(0), p_e_shstrndx(0), p_section_table(NULL), p_segment_table(NULL) {
5689  ctor();
5690  }
5691 
5697  uint64_t max_page_size();
5698 
5701 
5704 
5710  virtual SgAsmElfFileHeader *parse() override;
5711 
5713  virtual bool reallocate() override;
5714 
5716  virtual void unparse(std::ostream&) const override;
5717 
5719  virtual void dump(FILE*, const char *prefix, ssize_t idx) const override;
5720 
5722  static bool is_ELF(SgAsmGenericFile*);
5723 
5725  SgAsmGenericSectionPtrList get_sectab_sections();
5726 
5728  SgAsmGenericSectionPtrList get_segtab_sections();
5729 
5730  // Overrides documented in base class
5731  virtual const char *format_name() const override;
5732 
5733  private:
5734  void ctor(); // called by constructors
5735  void *encode(ByteOrder::Endianness, SgAsmElfFileHeader::Elf32FileHeader_disk*) const;
5736  void *encode(ByteOrder::Endianness, SgAsmElfFileHeader::Elf64FileHeader_disk*) const;
5737 #endif // SgAsmElfFileHeader_OTHERS
5738 
5739 #ifdef DOCUMENTATION
5740  };
5741 #endif
5742 
5743 
5744 #undef JVM_IGNORE_SERIALIZATION
5745 
5747 
5748  /*************************************************************************************************************************
5749  * JVM File Header
5750  *************************************************************************************************************************/
5751 
5753 
5754  DECLARE_LEAF_CLASS(AsmJvmFileHeader);
5755  IS_SERIALIZABLE(AsmJvmFileHeader);
5756 
5757 #ifdef DOCUMENTATION
5758 
5765  public:
5766 #endif
5767 
5768 #ifdef DOCUMENTATION
5769 
5774  uint16_t get_minor_version() const;
5775  void set_minor_version(uint16_t);
5777 #else
5778  AsmJvmFileHeader.setDataPrototype("uint16_t", "minor_version", "= 0",
5779  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5780 #endif
5781 
5782 #ifdef DOCUMENTATION
5783 
5788  uint16_t get_major_version() const;
5789  void set_major_version(uint16_t);
5791 #else
5792  AsmJvmFileHeader.setDataPrototype("uint16_t", "major_version", "= 0",
5793  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5794 #endif
5795 
5796 #ifdef DOCUMENTATION
5797 
5802  uint16_t get_access_flags() const;
5803  void set_access_flags(uint16_t);
5805 #else
5806  AsmJvmFileHeader.setDataPrototype("uint16_t", "access_flags", "= 0",
5807  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5808 #endif
5809 
5810 #ifdef DOCUMENTATION
5811 
5816  uint16_t get_this_class() const;
5817  void set_this_class(uint16_t);
5819 #else
5820  AsmJvmFileHeader.setDataPrototype("uint16_t", "this_class", "= 0",
5821  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5822 #endif
5823 
5824 #ifdef DOCUMENTATION
5825 
5830  uint16_t get_super_class() const;
5831  void set_super_class(uint16_t);
5833 #else
5834  AsmJvmFileHeader.setDataPrototype("uint16_t", "super_class", "= 0",
5835  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5836 #endif
5837 
5838 #ifdef DOCUMENTATION
5839 
5847  const SgAsmJvmConstantPool* get_constant_pool() const;
5850 #else
5851  AsmJvmFileHeader.setDataPrototype("SgAsmJvmConstantPool*", "constant_pool", "= nullptr",
5852  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5853 #endif
5854 
5855 #ifdef DOCUMENTATION
5856 
5863  const std::list<uint16_t>& get_interfaces() const;
5864  std::list<uint16_t>& get_interfaces();
5866 #else
5867  AsmJvmFileHeader.setDataPrototype("std::list<uint16_t>", "interfaces", "",
5868  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5869 #endif
5870 
5871 #ifdef DOCUMENTATION
5872 
5880  const SgAsmJvmFieldTable* get_field_table() const;
5883 #else
5884  AsmJvmFileHeader.setDataPrototype("SgAsmJvmFieldTable*", "field_table", "= nullptr",
5885  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5886 #endif
5887 
5888 #ifdef DOCUMENTATION
5889 
5897  const SgAsmJvmMethodTable* get_method_table() const;
5900 #else
5901  AsmJvmFileHeader.setDataPrototype("SgAsmJvmMethodTable*", "method_table", "= nullptr",
5902  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5903 #endif
5904 
5905 #ifdef DOCUMENTATION
5906 
5917 #else
5918  AsmJvmFileHeader.setDataPrototype("SgAsmJvmAttributeTable*", "attribute_table", "= nullptr",
5919  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
5920 #endif
5921 
5922 #ifdef DOCUMENTATION
5923  protected:
5924  uint16_t p_minor_version;
5925  uint16_t p_major_version;
5926  uint16_t p_access_flags;
5927  uint16_t p_this_class;
5928  uint16_t p_super_class;
5929  SgAsmJvmConstantPool* p_constant_pool;
5930  std::list<uint16_t>& p_interfaces;
5931  SgAsmJvmFieldTable* p_field_table;
5932  SgAsmJvmMethodTable* p_method_table;
5933  SgAsmJvmAttributeTable* p_attribute_table;
5934  public:
5935 #endif
5936 
5937  DECLARE_OTHERS(AsmJvmFileHeader);
5938 #if defined(SgAsmJvmFileHeader_OTHERS) || defined(DOCUMENTATION)
5939 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
5940  private:
5941  friend class boost::serialization::access;
5942 
5943  template<class S>
5944  void serialize(S &s, const unsigned /*version*/) {
5945  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmGenericHeader);
5946  s & BOOST_SERIALIZATION_NVP(p_minor_version);
5947  s & BOOST_SERIALIZATION_NVP(p_major_version);
5948  s & BOOST_SERIALIZATION_NVP(p_access_flags);
5949  s & BOOST_SERIALIZATION_NVP(p_this_class);
5950  s & BOOST_SERIALIZATION_NVP(p_super_class);
5951  s & BOOST_SERIALIZATION_NVP(p_constant_pool);
5952  s & BOOST_SERIALIZATION_NVP(p_interfaces);
5953  s & BOOST_SERIALIZATION_NVP(p_field_table);
5954  s & BOOST_SERIALIZATION_NVP(p_method_table);
5955  s & BOOST_SERIALIZATION_NVP(p_attribute_table);
5956  }
5957 #endif
5958 
5959  public:
5962 
5968  virtual SgAsmJvmFileHeader* parse() override;
5969 
5971  static bool is_JVM(SgAsmGenericFile*);
5972 
5973 #endif // SgAsmJvmFileHeader_OTHERS
5974 
5975 #ifdef DOCUMENTATION
5976  };
5977 #endif
5978 
5979 
5981 
5982  /*************************************************************************************************************************
5983  * ELF Section Tables
5984  *************************************************************************************************************************/
5985 
5987 
5988  DECLARE_LEAF_CLASS(AsmElfSectionTable);
5989  IS_SERIALIZABLE(AsmElfSectionTable);
5990 
5991 #ifdef DOCUMENTATION
5992 
5998  public:
5999 #endif
6000 
6001  DECLARE_OTHERS(AsmElfSectionTable);
6002 #if defined(SgAsmElfSectionTable_OTHERS) || defined(DOCUMENTATION)
6003 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
6004  private:
6005  friend class boost::serialization::access;
6006 
6007  template<class S>
6008  void serialize(S &s, const unsigned /*version*/) {
6009  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmGenericSection);
6010  }
6011 #endif
6012 
6013  public:
6016  : SgAsmGenericSection(fhdr->get_file(), fhdr) {
6017  ctor();
6018  }
6019 
6025  virtual SgAsmElfSectionTable *parse() override;
6026 
6038 
6042  rose_addr_t calculate_sizes(size_t *entsize, size_t *required, size_t *optional, size_t *entcount) const;
6043 
6045  virtual bool reallocate() override;
6046 
6048  virtual void unparse(std::ostream&) const override;
6049 
6051  virtual void dump(FILE*, const char *prefix, ssize_t idx) const override;
6052 
6053  private:
6054  void ctor();
6055 #endif // SgAsmElfSectionTable_OTHERS
6056 
6057 #ifdef DOCUMENTATION
6058  };
6059 #endif
6060 
6061 
6063 
6064  DECLARE_LEAF_CLASS(AsmElfSectionTableEntry);
6065  IS_SERIALIZABLE(AsmElfSectionTableEntry);
6066 
6067 #ifdef DOCUMENTATION
6068 
6070  public:
6071 #endif
6072 
6073 #ifdef DOCUMENTATION
6074 
6079  unsigned get_sh_name() const;
6080  void set_sh_name(unsigned);
6082 #else
6083  AsmElfSectionTableEntry.setDataPrototype("unsigned", "sh_name", "= 0",
6084  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
6085 #endif
6086 
6087 #ifdef DOCUMENTATION
6088 
6093  SectionType get_sh_type() const;
6094  void set_sh_type(SectionType);
6096 #else
6097  AsmElfSectionTableEntry.setDataPrototype("SgAsmElfSectionTableEntry::SectionType", "sh_type", "= SHT_PROGBITS",
6098  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
6099 #endif
6100 
6101 #ifdef DOCUMENTATION
6102 
6107  unsigned long get_sh_link() const;
6108  void set_sh_link(unsigned long);
6110 #else
6111  AsmElfSectionTableEntry.setDataPrototype("unsigned long", "sh_link", "= 0",
6112  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
6113 #endif
6114 
6115 #ifdef DOCUMENTATION
6116 
6121  unsigned long get_sh_info() const;
6122  void set_sh_info(unsigned long);
6124 #else
6125  AsmElfSectionTableEntry.setDataPrototype("unsigned long", "sh_info", "= 0",
6126  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
6127 #endif
6128 
6129 #ifdef DOCUMENTATION
6130 
6135  uint64_t get_sh_flags() const;
6136  void set_sh_flags(uint64_t);
6138 #else
6139  AsmElfSectionTableEntry.setDataPrototype("uint64_t", "sh_flags", "= 0",
6140  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
6141 #endif
6142 
6143 #ifdef DOCUMENTATION
6144 
6149  rose_addr_t get_sh_addr() const;
6150  void set_sh_addr(rose_addr_t);
6152 #else
6153  AsmElfSectionTableEntry.setDataPrototype("rose_addr_t", "sh_addr", "= 0",
6154  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
6155 #endif
6156 
6157 #ifdef DOCUMENTATION
6158 
6163  rose_addr_t get_sh_offset() const;
6164  void set_sh_offset(rose_addr_t);
6166 #else
6167  AsmElfSectionTableEntry.setDataPrototype("rose_addr_t", "sh_offset", "= 0",
6168  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
6169 #endif
6170 
6171 #ifdef DOCUMENTATION
6172 
6177  rose_addr_t get_sh_size() const;
6178  void set_sh_size(rose_addr_t);
6180 #else
6181  AsmElfSectionTableEntry.setDataPrototype("rose_addr_t", "sh_size", "= 0",
6182  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
6183 #endif
6184 
6185 #ifdef DOCUMENTATION
6186 
6191  rose_addr_t get_sh_addralign() const;
6192  void set_sh_addralign(rose_addr_t);
6194 #else
6195  AsmElfSectionTableEntry.setDataPrototype("rose_addr_t", "sh_addralign", "= 0",
6196  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
6197 #endif
6198 
6199 #ifdef DOCUMENTATION
6200 
6205  rose_addr_t get_sh_entsize() const;
6206  void set_sh_entsize(rose_addr_t);
6208 #else
6209  AsmElfSectionTableEntry.setDataPrototype("rose_addr_t", "sh_entsize", "= 0",
6210  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
6211 #endif
6212 
6213 #ifdef DOCUMENTATION
6214 
6219  const SgUnsignedCharList& get_extra() const;
6220  void set_extra(const SgUnsignedCharLit&);
6222 #else
6223  AsmElfSectionTableEntry.setDataPrototype("SgUnsignedCharList", "extra", "",
6224  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, NO_TRAVERSAL,
6225  NO_DELETE);
6226 #endif
6227 
6228  DECLARE_OTHERS(AsmElfSectionTableEntry);
6229 #if defined(SgAsmElfSectionTableEntry_OTHERS) || defined(DOCUMENTATION)
6230 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
6231  private:
6232  friend class boost::serialization::access;
6233 
6234  template<class S>
6235  void serialize(S &s, const unsigned /*version*/) {
6236  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
6237  s & BOOST_SERIALIZATION_NVP(p_sh_name);
6238  s & BOOST_SERIALIZATION_NVP(p_sh_type);
6239  s & BOOST_SERIALIZATION_NVP(p_sh_link);
6240  s & BOOST_SERIALIZATION_NVP(p_sh_info);
6241  s & BOOST_SERIALIZATION_NVP(p_sh_flags);
6242  s & BOOST_SERIALIZATION_NVP(p_sh_addr);
6243  s & BOOST_SERIALIZATION_NVP(p_sh_offset);
6244  s & BOOST_SERIALIZATION_NVP(p_sh_size);
6245  s & BOOST_SERIALIZATION_NVP(p_sh_addralign);
6246  s & BOOST_SERIALIZATION_NVP(p_sh_entsize);
6247  s & BOOST_SERIALIZATION_NVP(p_extra);
6248  }
6249 #endif
6250 
6251  public:
6254  SHT_NULL = 0,
6258  SHT_RELA = 4,
6259  SHT_HASH = 5,
6261  SHT_NOTE = 7,
6263  SHT_REL = 9,
6264  SHT_SHLIB = 10,
6265  SHT_DYNSYM = 11,
6267  SHT_LOOS = 0x60000000,
6268  SHT_GNU_verdef = 0x6ffffffd,
6269  SHT_GNU_verneed = 0x6ffffffe,
6270  SHT_GNU_versym = 0x6fffffff,
6271  SHT_HIOS = 0x6fffffff, /*NO_STRINGIFY*/
6272 
6273  SHT_LOPROC = 0x70000000, /* Processor specific semantics */
6274  SHT_HIPROC = 0x7fffffff,
6275  SHT_LOUSER = 0x80000000, /* Application specific semantics */
6276  SHT_HIUSER = 0xffffffff
6277  };
6278 
6282  SHF_WRITE= (1 << 0),
6283  SHF_ALLOC= (1 << 1),
6284  SHF_EXECINSTR= (1 << 2),
6285  SHF_MERGE= (1 << 4),
6286  SHF_STRINGS= (1 << 5),
6287  SHF_INFO_LINK= (1 << 6),
6288  SHF_LINK_ORDER= (1 << 7),
6290  SHF_GROUP= (1 << 9),
6291  SHF_TLS= (1 << 10),
6292  SHF_MASKOS= 0x0ff00000,
6293  SHF_MASKPROC= 0xf0000000
6294  };
6295 
6302 #ifdef _MSC_VER
6303 # pragma pack (1)
6304 #endif
6306  uint32_t sh_name; /* 0x00 Section name; index into section header string table */
6307  uint32_t sh_type; /* 0x04 Section contents and semantics (see SectionType enum) */
6308  uint32_t sh_flags; /* 0x08 Bit flags */
6309  uint32_t sh_addr; /* 0x0c Desired mapped address */
6310  uint32_t sh_offset; /* 0x10 Section location in file unless sh_type==SHT_NOBITS */
6311  uint32_t sh_size; /* 0x14 Section size in bytes */
6312  uint32_t sh_link; /* 0x18 Section ID of another section; meaning depends on section type */
6313  uint32_t sh_info; /* 0x1c Extra info depending on section type */
6314  uint32_t sh_addralign; /* 0x20 Mapped alignment (0 and 1=>byte aligned); sh_addr must be aligned*/
6315  uint32_t sh_entsize; /* 0x24 If non-zero, size in bytes of each array member in the section */
6316  } /* 0x28 */
6317 #if !defined(SWIG) && !defined(_MSC_VER)
6318  __attribute__((packed))
6319 #endif
6320  ;
6321 
6323  uint32_t sh_name; /* 0x00 see Elf32SectionTableEntry_disk */
6324  uint32_t sh_type; /* 0x04 */
6325  uint64_t sh_flags; /* 0x08 */
6326  uint64_t sh_addr; /* 0x10 */
6327  uint64_t sh_offset; /* 0x18 */
6328  uint64_t sh_size; /* 0x20 */
6329  uint32_t sh_link; /* 0x28 */
6330  uint32_t sh_info; /* 0x2c */
6331  uint64_t sh_addralign; /* 0x30 */
6332  uint64_t sh_entsize; /* 0x38 */
6333  } /* 0x40 */
6334 #if !defined(SWIG) && !defined(_MSC_VER)
6335  __attribute__((packed))
6336 #endif
6337  ;
6338 #ifdef _MSC_VER
6339 # pragma pack ()
6340 #endif
6341 
6343  SgAsmElfSectionTableEntry(ByteOrder::Endianness sex,
6345 
6347  SgAsmElfSectionTableEntry(ByteOrder::Endianness sex,
6349 
6353  void *encode(ByteOrder::Endianness sex,
6355  void *encode(ByteOrder::Endianness sex,
6361 
6363  virtual void dump(FILE*, const char *prefix, ssize_t idx) const;
6364 
6365  // Use Rose::stringify... function instead.
6366  static std::string to_string(SgAsmElfSectionTableEntry::SectionType);
6367  static std::string to_string(SgAsmElfSectionTableEntry::SectionFlags);
6368 
6369  private:
6370  void ctor(ByteOrder::Endianness, const SgAsmElfSectionTableEntry::Elf32SectionTableEntry_disk*);
6371  void ctor(ByteOrder::Endianness, const SgAsmElfSectionTableEntry::Elf64SectionTableEntry_disk*);
6372 #endif // SgAsmElfSectionTableEntry_OTHERS
6373 
6374 #ifdef DOCUMENTATION
6375  };
6376 #endif
6377 
6378 
6379 
6381 
6382  /*************************************************************************************************************************
6383  * ELF Segment Tables
6384  *************************************************************************************************************************/
6385 
6387 
6388  DECLARE_LEAF_CLASS(AsmElfSegmentTable);
6389  IS_SERIALIZABLE(AsmElfSegmentTable);
6390 
6391 #ifdef DOCUMENTATION
6392 
6399  public:
6400 #endif
6401 
6402  DECLARE_OTHERS(AsmElfSegmentTable);
6403 #if defined(SgAsmElfSegmentTable_OTHERS) || defined(DOCUMENTATION)
6404 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
6405  private:
6406  friend class boost::serialization::access;
6407 
6408  template<class S>
6409  void serialize(S &s, const unsigned /*version*/) {
6410  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmGenericSection);
6411  }
6412 #endif
6413 
6414  public:
6417  : SgAsmGenericSection(fhdr->get_file(), fhdr) {
6418  ctor();
6419  }
6420 
6425  virtual SgAsmElfSegmentTable *parse() override;
6426 
6441 
6445  rose_addr_t calculate_sizes(size_t *entsize, size_t *required, size_t *optional, size_t *entcount) const;
6446 
6448  virtual bool reallocate() override;
6449 
6451  virtual void unparse(std::ostream&) const override;
6452 
6454  virtual void dump(FILE*, const char *prefix, ssize_t idx) const override;
6455 
6456  private:
6457  void ctor();
6458 #endif // SgAsmElfSegmentTable_OTHERS
6459 
6460 #ifdef DOCUMENTATION
6461  };
6462 #endif
6463 
6465 
6466  DECLARE_LEAF_CLASS(AsmElfSegmentTableEntryList);
6467  IS_SERIALIZABLE(AsmElfSegmentTableEntryList);
6468 
6469 #ifdef DOCUMENTATION
6471  public:
6472 #endif
6473 
6474 #ifdef DOCUMENTATION
6475 
6481  const SgAsmElfSegmentTableEntryPtrList& get_entries();
6482  void set_entries(const SgAsmElfSegmentTableEntryPtrList&);
6484 #else
6485  AsmElfSegmentTableEntryList.setDataPrototype("SgAsmElfSegmentTableEntryPtrList", "entries", "",
6486  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL,
6487  NO_DELETE);
6488 #endif
6489 
6490  DECLARE_OTHERS(AsmElfSegmentTableEntryList);
6491 #if defined(SgAsmElfSegmentTableEntryList_OTHERS) || defined(DOCUMENTATION)
6492 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
6493  private:
6494  friend class boost::serialization::access;
6495 
6496  template<class S>
6497  void serialize(S &s, const unsigned /*version*/) {
6498  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
6499  }
6500 #endif
6501 #endif // SgAsmElfSegmentTableEntryList_OTHERS
6502 
6503 #ifdef DOCUMENTATION
6504  };
6505 #endif
6506 
6507 
6509 
6510  DECLARE_LEAF_CLASS(AsmElfSegmentTableEntry);
6511  IS_SERIALIZABLE(AsmElfSegmentTableEntry);
6512 
6513 #ifdef DOCUMENTATION
6514 
6516  public:
6517 #endif
6518 
6519 #ifdef DOCUMENTATION
6520 
6525  size_t get_index() const;
6526  void set_index(size_t);
6528 #else
6529  AsmElfSegmentTableEntry.setDataPrototype("size_t", "index", "= 0",
6530  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
6531 #endif
6532 
6533 #ifdef DOCUMENTATION
6534 
6537  SegmentType get_type() const;
6538  void set_type(SegmentType);
6540 #else
6541  AsmElfSegmentTableEntry.setDataPrototype("SgAsmElfSegmentTableEntry::SegmentType", "type",
6542  "= SgAsmElfSegmentTableEntry::PT_LOAD",
6543  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
6544 #endif
6545 
6546 #ifdef DOCUMENTATION
6547 
6550  SegmentFlags get_flags() const;
6551  void set_flags(SegmentFlags);
6553 #else
6554  AsmElfSegmentTableEntry.setDataPrototype("SgAsmElfSegmentTableEntry::SegmentFlags", "flags",
6555  "= SgAsmElfSegmentTableEntry::PF_NONE",
6556  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
6557 #endif
6558 
6559 #ifdef DOCUMENTATION
6560 
6565  rose_addr_t get_offset() const;
6566  void set_offset(rose_addr_t);
6568 #else
6569  AsmElfSegmentTableEntry.setDataPrototype("rose_addr_t", "offset", "= 0",
6570  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
6571 #endif
6572 
6573 #ifdef DOCUMENTATION
6574 
6580  rose_addr_t get_vaddr() const;
6581  void set_vaddr(rose_addr_t);
6583 #else
6584  AsmElfSegmentTableEntry.setDataPrototype("rose_addr_t", "vaddr", "= 0",
6585  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
6586 #endif
6587 
6588 #ifdef DOCUMENTATION
6589 
6594  rose_addr_t get_paddr() const;
6595  void set_paddr(rose_addr_t);
6597 #else
6598  AsmElfSegmentTableEntry.setDataPrototype("rose_addr_t", "paddr", "= 0",
6599  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
6600 #endif
6601 
6602 #ifdef DOCUMENTATION
6603 
6608  rose_addr_t get_filesz() const;
6609  void set_filesz(rose_addr_t);
6611 #else
6612  AsmElfSegmentTableEntry.setDataPrototype("rose_addr_t", "filesz", "= 0",
6613  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
6614 #endif
6615 
6616 #ifdef DOCUMENTATION
6617 
6622  rose_addr_t get_memsz() const;
6623  void set_memsz(rose_addr_t);
6625 #else
6626  AsmElfSegmentTableEntry.setDataPrototype("rose_addr_t", "memsz", "= 0",
6627  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
6628 #endif
6629 
6630 #ifdef DOCUMENTATION
6631 
6636  rose_addr_t get_align() const;
6637  void set_align(rose_addr_t);
6639 #else
6640  AsmElfSegmentTableEntry.setDataPrototype("rose_addr_t", "align", "= 0",
6641  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
6642 #endif
6643 
6644 #ifdef DOCUMENTATION
6645 
6650  const SgUnsignedCharList& get_extra() const;
6651  void set_extra(const SgUnsignedCharList&);
6653 #else
6654  AsmElfSegmentTableEntry.setDataPrototype("SgUnsignedCharList", "extra", "",
6655  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
6656 #endif
6657 
6658  DECLARE_OTHERS(AsmElfSegmentTableEntry);
6659 #if defined(SgAsmElfSegmentTableEntry_OTHERS) || defined(DOCUMENTATION)
6660 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
6661  private:
6662  friend class boost::serialization::access;
6663 
6664  template<class S>
6665  void serialize(S &s, const unsigned /*version*/) {
6666  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
6667  s & BOOST_SERIALIZATION_NVP(p_index);
6668  s & BOOST_SERIALIZATION_NVP(p_type);
6669  s & BOOST_SERIALIZATION_NVP(p_flags);
6670  s & BOOST_SERIALIZATION_NVP(p_offset);
6671  s & BOOST_SERIALIZATION_NVP(p_vaddr);
6672  s & BOOST_SERIALIZATION_NVP(p_paddr);
6673  s & BOOST_SERIALIZATION_NVP(p_filesz);
6674  s & BOOST_SERIALIZATION_NVP(p_memsz);
6675  s & BOOST_SERIALIZATION_NVP(p_align);
6676  s & BOOST_SERIALIZATION_NVP(p_extra);
6677  }
6678 #endif
6679 
6680  public:
6683  PT_NULL = 0,
6684  PT_LOAD = 1,
6687  PT_NOTE = 4,
6688  PT_SHLIB = 5,
6689  PT_PHDR = 6,
6690  PT_TLS = 7,
6692  // OS- and Processor-specific ranges
6693  PT_LOOS = 0x60000000,
6694  PT_HIOS = 0x6fffffff,
6695  PT_LOPROC = 0x70000000,
6696  PT_HIPROC = 0x7fffffff,
6697 
6698  // OS-specific values for GNU/Linux
6699  PT_GNU_EH_FRAME = 0x6474e550,
6700  PT_GNU_STACK = 0x6474e551,
6701  PT_GNU_RELRO = 0x6474e552,
6702  PT_PAX_FLAGS = 0x65041580,
6704  // OS-specific values for Sun
6705  PT_SUNWBSS = 0x6ffffffa,
6706  PT_SUNWSTACK = 0x6ffffffb
6707  };
6708 
6711  PF_NONE = 0,
6712  PF_RESERVED = 0x000ffff8,
6713  PF_XPERM = 0x00000001,
6714  PF_WPERM = 0x00000002,
6715  PF_RPERM = 0x00000004,
6716  PF_OS_MASK = 0x0ff00000,
6717  PF_PROC_MASK = 0xf0000000
6718  };
6719 
6720 #ifdef _MSC_VER
6721 # pragma pack (1)
6722 #endif
6723 
6731  uint32_t p_type;
6732  uint32_t p_offset;
6733  uint32_t p_vaddr;
6734  uint32_t p_paddr;
6735  uint32_t p_filesz;
6736  uint32_t p_memsz;
6737  uint32_t p_flags;
6738  uint32_t p_align;
6739  } /* 0x30 */
6740 #if !defined(SWIG) && !defined(_MSC_VER)
6741  __attribute__((packed))
6742 #endif
6743  ;
6744 
6746  uint32_t p_type; /* 0x00 */
6747  uint32_t p_flags; /* 0x04 */
6748  uint64_t p_offset; /* 0x08 */
6749  uint64_t p_vaddr; /* 0x10 */
6750  uint64_t p_paddr; /* 0x18 */
6751  uint64_t p_filesz; /* 0x20 */
6752  uint64_t p_memsz; /* 0x28 */
6753  uint64_t p_align; /* 0x30 */
6754  } /* 0x38 */
6755 #if !defined(SWIG) && !defined(_MSC_VER)
6756  __attribute__((packed))
6757 #endif
6758  ;
6759 #ifdef _MSC_VER
6760 # pragma pack ()
6761 #endif
6762 
6764  SgAsmElfSegmentTableEntry(ByteOrder::Endianness sex,
6766 
6768  SgAsmElfSegmentTableEntry(ByteOrder::Endianness sex,
6770 
6774  void *encode(ByteOrder::Endianness, SgAsmElfSegmentTableEntry::Elf32SegmentTableEntry_disk*) const;
6775  void *encode(ByteOrder::Endianness, SgAsmElfSegmentTableEntry::Elf64SegmentTableEntry_disk*) const;
6780 
6782  virtual void dump(FILE*, const char *prefix, ssize_t idx) const;
6783 
6786 
6789 
6790  private:
6791  void ctor(ByteOrder::Endianness, const SgAsmElfSegmentTableEntry::Elf32SegmentTableEntry_disk*);
6792  void ctor(ByteOrder::Endianness, const SgAsmElfSegmentTableEntry::Elf64SegmentTableEntry_disk*);
6793 #endif // SgAsmElfSegmentTableEntry_OTHERS
6794 
6795 #ifdef DOCUMENTATION
6796  };
6797 #endif
6798 
6799 
6800 
6802 
6803  /*************************************************************************************************************************
6804  * ELF Symbol Tables
6805  *************************************************************************************************************************/
6806 
6808 
6809  DECLARE_LEAF_CLASS(AsmElfSymbolSection);
6810  IS_SERIALIZABLE(AsmElfSymbolSection);
6811 
6812 #ifdef DOCUMENTATION
6813 
6815  public:
6816 #endif
6817 
6818 #ifdef DOCUMENTATION
6819 
6822  bool get_is_dynamic() const;
6823  void set_is_dynamic(bool);
6825 #else
6826  AsmElfSymbolSection.setDataPrototype("bool", "is_dynamic", "= false",
6827  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
6828 #endif
6829 
6830 #ifdef DOCUMENTATION
6831 
6840 #else
6841  AsmElfSymbolSection.setDataPrototype("SgAsmElfSymbolList*", "symbols", "= NULL",
6842  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
6843 #endif
6844 
6845  DECLARE_OTHERS(AsmElfSymbolSection);
6846 #if defined(SgAsmElfSymbolSection_OTHERS) || defined(DOCUMENTATION)
6847 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
6848  private:
6849  friend class boost::serialization::access;
6850 
6851  template<class S>
6852  void serialize(S &s, const unsigned /*version*/) {
6853  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmElfSection);
6854  s & BOOST_SERIALIZATION_NVP(p_is_dynamic);
6855  s & BOOST_SERIALIZATION_NVP(p_symbols);
6856  }
6857 #endif
6858 
6859  public:
6862  : SgAsmElfSection(fhdr), p_is_dynamic(false) {
6863  ctor(strsec);
6864  }
6865 
6867  virtual SgAsmElfSymbolSection* parse() override;
6868 
6881  virtual void finish_parsing() override;
6882 
6884  size_t index_of(SgAsmElfSymbol*);
6885 
6890  virtual rose_addr_t calculate_sizes(size_t *total, size_t *required, size_t *optional, size_t *nentries) const override;
6891 
6895  virtual bool reallocate() override;
6896 
6898  virtual void unparse(std::ostream&) const override;
6899 
6901  virtual void dump(FILE*, const char *prefix, ssize_t idx) const override;
6902 
6903  private:
6904  void ctor(SgAsmElfStringSection*);
6905 #endif // SgAsmElfSymbolSection_OTHERS
6906 
6907 #ifdef DOCUMENTATION
6908  };
6909 #endif
6910 
6912 
6913  DECLARE_LEAF_CLASS(AsmElfSymbolList);
6914  IS_SERIALIZABLE(AsmElfSymbolList);
6915 
6916 #ifdef DOCUMENTATION
6918  public:
6919 #endif
6920 
6921 #ifdef DOCUMENTATION
6922 
6928  const SgAsmElfSymbolPtrList& get_symbols() const;
6929  void set_symbols(const SgAsmElfSymbolPtrList&);
6931 #else
6932  AsmElfSymbolList.setDataPrototype("SgAsmElfSymbolPtrList", "symbols", "",
6933  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
6934 #endif
6935 
6936  DECLARE_OTHERS(AsmElfSymbolList);
6937 #if defined(SgAsmElfSymbolList_OTHERS) || defined(DOCUMENTATION)
6938 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
6939  private:
6940  friend class boost::serialization::access;
6941 
6942  template<class S>
6943  void serialize(S &s, const unsigned /*version*/) {
6944  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
6945  s & BOOST_SERIALIZATION_NVP(p_symbols);
6946  }
6947 #endif
6948 #endif // SgAsmElfSymbolList_OTHERS
6949 
6950 #ifdef DOCUMENTATION
6951  };
6952 #endif
6953 
6955 
6956  DECLARE_LEAF_CLASS(AsmElfSymbol);
6957  IS_SERIALIZABLE(AsmElfSymbol);
6958 
6959 #ifdef DOCUMENTATION
6960 
6965  public:
6966 #endif
6967 
6968 #ifdef DOCUMENTATION
6969 
6974  unsigned char get_st_info() const;
6975  void set_st_info(unsigned char);
6977 #else
6978  AsmElfSymbol.setDataPrototype("unsigned char", "st_info", "= 0",
6979  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
6980 #endif
6981 
6982 #ifdef DOCUMENTATION
6983 
6988  unsigned char get_st_res1() const;
6989  void set_st_res1(unsigned char);
6991 #else
6992  AsmElfSymbol.setDataPrototype("unsigned char", "st_res1", "= 0",
6993  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
6994 #endif
6995 
6996 #ifdef DOCUMENTATION
6997 
7002  unsigned get_st_shndx() const;
7003  void set_st_shndx(unsigned);
7005 #else
7006  AsmElfSymbol.setDataPrototype("unsigned", "st_shndx", "= 0",
7007  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
7008 #endif
7009 
7010 #ifdef DOCUMENTATION
7011 
7016  rose_addr_t get_st_size() const;
7017  void set_st_size(rose_addr_t);
7019 #else
7020  AsmElfSymbol.setDataPrototype("rose_addr_t", "st_size", "= 0",
7021  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
7022 #endif
7023 
7024 #ifdef DOCUMENTATION
7025 
7030  const SgUnsignedCharList& get_extra() const;
7031  void set_extra(const SgUnsignedCharList&);
7033 #else
7034  AsmElfSymbol.setDataPrototype("SgUnsignedCharList", "extra", "",
7035  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
7036 #endif
7037 
7038  DECLARE_OTHERS(AsmElfSymbol);
7039 #if defined(SgAsmElfSymbol_OTHERS) || defined(DOCUMENTATION)
7040 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
7041  private:
7042  friend class boost::serialization::access;
7043 
7044  template<class S>
7045  void serialize(S &s, const unsigned /*version*/) {
7046  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmGenericSymbol);
7047  s & BOOST_SERIALIZATION_NVP(p_st_info);
7048  s & BOOST_SERIALIZATION_NVP(p_st_res1);
7049  s & BOOST_SERIALIZATION_NVP(p_st_shndx);
7050  s & BOOST_SERIALIZATION_NVP(p_st_size);
7051  s & BOOST_SERIALIZATION_NVP(p_extra);
7052  }
7053 #endif
7054 
7055  public:
7056  enum ElfSymBinding {
7057  STB_LOCAL=0,
7058  STB_GLOBAL=1,
7059  STB_WEAK=2
7060  };
7061 
7062  enum ElfSymType {
7065  STT_FUNC = 2,
7067  STT_FILE = 4,
7069  STT_TLS = 6,
7071  };
7072 
7073 #ifdef _MSC_VER
7074 # pragma pack (1)
7075 #endif
7076 
7079  uint32_t st_name;
7080  uint32_t st_value;
7081  uint32_t st_size;
7082  unsigned char st_info;
7083  unsigned char st_res1;
7084  uint16_t st_shndx;
7085  }
7086 #if !defined(SWIG) && !defined(_MSC_VER)
7087  __attribute__((packed))
7088 #endif
7089  ;
7090 
7092  uint32_t st_name;
7093  unsigned char st_info;
7094  unsigned char st_res1;
7095  uint16_t st_shndx;
7096  uint64_t st_value;
7097  uint64_t st_size;
7098  }
7099 #if !defined(SWIG) && !defined(_MSC_VER)
7100  __attribute__((packed))
7101 #endif
7102  ;
7103 
7104 #ifdef _MSC_VER
7105 # pragma pack ()
7106 #endif
7107 
7109  explicit SgAsmElfSymbol(SgAsmElfSymbolSection *symtab) { ctor(symtab); }
7110 
7114  void parse(ByteOrder::Endianness, const SgAsmElfSymbol::Elf32SymbolEntry_disk*);
7115 
7119  void parse(ByteOrder::Endianness, const SgAsmElfSymbol::Elf64SymbolEntry_disk*);
7120 
7124  void *encode(ByteOrder::Endianness, SgAsmElfSymbol::Elf32SymbolEntry_disk*) const;
7125  void *encode(ByteOrder::Endianness, SgAsmElfSymbol::Elf64SymbolEntry_disk*) const;
7133  virtual void dump(FILE *f, const char *prefix, ssize_t idx) const override;
7134  void dump(FILE*, const char *prefix, ssize_t idx, SgAsmGenericSection*) const;
7138  SgAsmElfSymbol::ElfSymBinding get_elf_binding() const;
7139 
7142 
7144  static std::string to_string(SgAsmElfSymbol::ElfSymBinding);
7145 
7147  static std::string to_string(SgAsmElfSymbol::ElfSymType);
7148 
7149  private:
7150  void ctor(SgAsmElfSymbolSection*);
7151  void parse_common(); // initialization common to all parse() methods
7152 #endif // SgAsmElfSymbol_OTHERS
7153 
7154 #ifdef DOCUMENTATION
7155  };
7156 #endif
7157 
7158 
7159 
7161 
7162  /*************************************************************************************************************************
7163  * ELF Symbol Version Tables
7164  *************************************************************************************************************************/
7165 
7167 
7168  DECLARE_LEAF_CLASS(AsmElfSymverSection);
7169  IS_SERIALIZABLE(AsmElfSymverSection);
7170 
7171 #ifdef DOCUMENTATION
7172 
7177  public:
7178 #endif
7179 
7180 #ifdef DOCUMENTATION
7181 
7190 #else
7191  AsmElfSymverSection.setDataPrototype("SgAsmElfSymverEntryList*", "entries", "= NULL",
7192  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
7193 #endif
7194 
7195  DECLARE_OTHERS(AsmElfSymverSection);
7196 #if defined(SgAsmElfSymverSection_OTHERS) || defined(DOCUMENTATION)
7197 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
7198  private:
7199  friend class boost::serialization::access;
7200 
7201  template<class S>
7202  void serialize(S &s, const unsigned /*version*/) {
7203  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmElfSection);
7204  s & BOOST_SERIALIZATION_NVP(p_entries);
7205  }
7206 #endif
7207 
7208  public:
7211  : SgAsmElfSection(fhdr) {
7212  ctor();
7213  }
7214 
7216  virtual SgAsmElfSymverSection* parse() override;
7217 
7222  virtual rose_addr_t calculate_sizes(size_t *total, size_t *required, size_t *optional, size_t *nentries) const override;
7223 
7225  virtual void unparse(std::ostream&) const override;
7226 
7228  virtual void dump(FILE*, const char *prefix, ssize_t idx) const override;
7229  private:
7230  void ctor();
7231 #endif // SgAsmElfSymverSection_OTHERS
7232 
7233 #ifdef DOCUMENTATION
7234  };
7235 #endif
7236 
7238 
7239  DECLARE_LEAF_CLASS(AsmElfSymverEntry);
7240  IS_SERIALIZABLE(AsmElfSymverEntry);
7241 
7242 #ifdef DOCUMENTATION
7243 
7245  public:
7246 #endif
7247 
7248 #ifdef DOCUMENTATION
7249 
7254  size_t get_value() const;
7255  void set_value(size_t);
7257 #else
7258  AsmElfSymverEntry.setDataPrototype("size_t", "value", "= 0",
7259  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
7260 #endif
7261 
7262  DECLARE_OTHERS(AsmElfSymverEntry);
7263 #if defined(SgAsmElfSymverEntry_OTHERS) || defined(DOCUMENTATION)
7264 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
7265  private:
7266  friend class boost::serialization::access;
7267 
7268  template<class S>
7269  void serialize(S &s, const unsigned /*version*/) {
7270  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
7271  s & BOOST_SERIALIZATION_NVP(p_value);
7272  }
7273 #endif
7274 
7275  public:
7278  : p_value(0) {
7279  ctor(symver);
7280  }
7281 
7283  virtual void dump(FILE *f, const char *prefix, ssize_t idx) const;
7284 
7285  private:
7286  void ctor(SgAsmElfSymverSection*);
7287 #endif // SgAsmElfSymverEntry_OTHERS
7288 
7289 #ifdef DOCUMENTATION
7290  };
7291 #endif
7292 
7294 
7295 
7296  DECLARE_LEAF_CLASS(AsmElfSymverEntryList);
7297  IS_SERIALIZABLE(AsmElfSymverEntryList);
7298 
7299 #ifdef DOCUMENTATION
7300 
7305  public:
7306 #endif
7307 
7308 #ifdef DOCUMENTATION
7309 
7312  const SgAsmElfSymverEntryPtrList& get_entries() const;
7313  void set_entries(const SgAsmElfSymverEntryPtrList&);
7315 #else
7316  AsmElfSymverEntryList.setDataPrototype("SgAsmElfSymverEntryPtrList", "entries", "",
7317  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL,
7318  NO_DELETE);
7319 #endif
7320 
7321  DECLARE_OTHERS(AsmElfSymverEntryList);
7322 #if defined(SgAsmElfSymverEntryList_OTHERS) || defined(DOCUMENTATION)
7323 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
7324  private:
7325  friend class boost::serialization::access;
7326 
7327  template<class S>
7328  void serialize(S &s, const unsigned /*version*/) {
7329  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
7330  s & BOOST_SERIALIZATION_NVP(p_entries);
7331  }
7332 #endif
7333 #endif // SgAsmElfSymverEntryList_OTHERS
7334 
7335 #ifdef DOCUMENTATION
7336  };
7337 #endif
7338 
7340 
7341  DECLARE_LEAF_CLASS(AsmElfSymverDefinedSection);
7342  IS_SERIALIZABLE(AsmElfSymverDefinedSection);
7343 
7344 #ifdef DOCUMENTATION
7345 
7351  public:
7352 #endif
7353 
7354 #ifdef DOCUMENTATION
7355 
7364 #else
7365  AsmElfSymverDefinedSection.setDataPrototype("SgAsmElfSymverDefinedEntryList*", "entries", "= NULL",
7366  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL,
7367  NO_DELETE);
7368 #endif
7369 
7370  DECLARE_OTHERS(AsmElfSymverDefinedSection);
7371 #if defined(SgAsmElfSymverDefinedSection_OTHERS) || defined(DOCUMENTATION)
7372 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
7373  private:
7374  friend class boost::serialization::access;
7375 
7376  template<class S>
7377  void serialize(S &s, const unsigned /*version*/) {
7378  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmElfSection);
7379  s & BOOST_SERIALIZATION_NVP(p_entries);
7380  }
7381 #endif
7382 
7383  public:
7386  : SgAsmElfSection(fhdr) {
7387  ctor(strsec);
7388  }
7389 
7458  virtual SgAsmElfSymverDefinedSection* parse() override;
7459 
7462  virtual rose_addr_t calculate_sizes(size_t *total, size_t *required, size_t *optional, size_t *nentries) const override;
7463 
7467  virtual void unparse(std::ostream&) const override;
7468 
7470  virtual void dump(FILE*, const char *prefix, ssize_t idx) const override;
7471 
7472  private:
7473  void ctor(SgAsmElfStringSection*);
7474 #endif // SgAsmElfSymverDefinedSection_OTHERS
7475 
7476 #ifdef DOCUMENTATION
7477  };
7478 #endif
7479 
7481 
7482  DECLARE_LEAF_CLASS(AsmElfSymverDefinedEntryList);
7483  IS_SERIALIZABLE(AsmElfSymverDefinedEntryList);
7484 
7485 #ifdef DOCUMENTATION
7486 
7491  public:
7492 #endif
7493 
7494 #ifdef DOCUMENTATION
7495 
7498  const SgAsmElfSymverDefinedEntryPtrList& get_entries() const;
7499  void set_entries(const SgAsmElfSymverDefinedPtrList&);
7501 #else
7502  AsmElfSymverDefinedEntryList.setDataPrototype("SgAsmElfSymverDefinedEntryPtrList", "entries", "",
7503  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL,
7504  NO_DELETE);
7505 #endif
7506 
7507  DECLARE_OTHERS(AsmElfSymverDefinedEntryList);
7508 #if defined(SgAsmElfSymverDefinedEntryList_OTHERS) || defined(DOCUMENTATION)
7509 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
7510  private:
7511  friend class boost::serialization::access;
7512 
7513  template<class S>
7514  void serialize(S &s, const unsigned /*version*/) {
7515  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
7516  s & BOOST_SERIALIZATION_NVP(p_entries);
7517  }
7518 #endif
7519 #endif // SgAsmElfSymverDefinedEntryList_OTHERS
7520 
7521 #ifdef DOCUMENTATION
7522  };
7523 #endif
7524 
7526 
7527  DECLARE_LEAF_CLASS(AsmElfSymverDefinedEntry);
7528  IS_SERIALIZABLE(AsmElfSymverDefinedEntry);
7529 
7530 #ifdef DOCUMENTATION
7531 
7533  public:
7534 #endif
7535 
7536 #ifdef DOCUMENTATION
7537 
7542  size_t get_version() const;
7543  void set_version(size_t);
7545 #else
7546  AsmElfSymverDefinedEntry.setDataPrototype("size_t", "version", "= 0",
7547  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
7548 #endif
7549 
7550 #ifdef DOCUMENTATION
7551 
7556  int get_flags() const;
7557  void set_flags(int);
7559 #else
7560  AsmElfSymverDefinedEntry.setDataPrototype("int", "flags", "= 0",
7561  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
7562 #endif
7563 
7564 #ifdef DOCUMENTATION
7565 
7570  size_t get_index() const;
7571  void set_index(size_t);
7573 #else
7574  AsmElfSymverDefinedEntry.setDataPrototype("size_t", "index", "= 0",
7575  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
7576 #endif
7577 
7578 #ifdef DOCUMENTATION
7579 
7584  uint32_t get_hash() const;
7585  void set_hash(uint32_t);
7587 #else
7588  AsmElfSymverDefinedEntry.setDataPrototype("uint32_t", "hash", "= 0",
7589  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
7590 #endif
7591 
7592 #ifdef DOCUMENTATION
7593 
7602 #else
7603  AsmElfSymverDefinedEntry.setDataPrototype("SgAsmElfSymverDefinedAuxList*", "entries", "",
7604  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
7605 #endif
7606 
7607  DECLARE_OTHERS(AsmElfSymverDefinedEntry);
7608 #if defined(SgAsmElfSymverDefinedEntry_OTHERS) || defined(DOCUMENTATION)
7609 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
7610  private:
7611  friend class boost::serialization::access;
7612 
7613  template<class S>
7614  void serialize(S &s, const unsigned /*version*/) {
7615  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
7616  s & BOOST_SERIALIZATION_NVP(p_version);
7617  s & BOOST_SERIALIZATION_NVP(p_flags);
7618  s & BOOST_SERIALIZATION_NVP(p_index);
7619  s & BOOST_SERIALIZATION_NVP(p_hash);
7620  s & BOOST_SERIALIZATION_NVP(p_entries);
7621  }
7622 #endif
7623 
7624  public:
7625 #ifdef _MSC_VER
7626 # pragma pack (1)
7627 #endif
7628 
7630  uint16_t vd_version;
7631  uint16_t vd_flags;
7632  uint16_t vd_ndx;
7633  uint16_t vd_cnt;
7634  uint32_t vd_hash;
7635  uint32_t vd_aux;
7636  uint32_t vd_next;
7637  }
7638 #if !defined(SWIG) && !defined(_MSC_VER)
7639  __attribute__((packed))
7640 #endif
7641  ;
7642 
7643 #ifdef _MSC_VER
7644 # pragma pack ()
7645 #endif
7646 
7649  ctor(symver_defined);
7650  }
7651 
7653  void parse(ByteOrder::Endianness, const SgAsmElfSymverDefinedEntry::ElfSymverDefinedEntry_disk*);
7654 
7656  void *encode(ByteOrder::Endianness, SgAsmElfSymverDefinedEntry::ElfSymverDefinedEntry_disk*) const;
7657 
7659  virtual void dump(FILE *f, const char *prefix, ssize_t idx) const;
7660 
7661  private:
7662  void ctor(SgAsmElfSymverDefinedSection*);
7663 #endif // SgAsmElfSymverDefinedEntry_OTHERS
7664 
7665 #ifdef DOCUMENTATION
7666  };
7667 #endif
7668 
7670 
7671  DECLARE_LEAF_CLASS(AsmElfSymverDefinedAuxList);
7672  IS_SERIALIZABLE(AsmElfSymverDefinedAuxList);
7673 
7674 #ifdef DOCUMENTATION
7675 
7680  pbulic:
7681 #endif
7682 
7683 #ifdef DOCUMENTATION
7684 
7687  const SgAsmElfSymverDefinedAuxPtrList& get_entries() const;
7688  void set_entries(const SgAsmElfSymverDefinedAuxPtrList&);
7690 #else
7691  AsmElfSymverDefinedAuxList.setDataPrototype("SgAsmElfSymverDefinedAuxPtrList", "entries", "",
7692  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL,
7693  NO_DELETE);
7694 #endif
7695 
7696  DECLARE_OTHERS(AsmElfSymverDefinedAuxList);
7697 #if defined(SgAsmElfSymverDefinedAuxList_OTHERS) || defined(DOCUMENTATION)
7698 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
7699  private:
7700  friend class boost::serialization::access;
7701 
7702  template<class S>
7703  void serialize(S &s, const unsigned /*version*/) {
7704  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
7705  s & BOOST_SERIALIZATION_NVP(p_entries);
7706  }
7707 #endif
7708 #endif // SgAsmElfSymverDefinedAuxList_OTHERS
7709 
7710 #ifdef DOCUMENTATION
7711  };
7712 #endif
7713 
7715 
7716  DECLARE_LEAF_CLASS(AsmElfSymverDefinedAux);
7717  IS_SERIALIZABLE(AsmElfSymverDefinedAux);
7718 
7719 #ifdef DOCUMENTATION
7721  public:
7722 #endif
7723 
7724 #ifdef DOCUMENTATION
7725 
7728  SgAsmGenericString* get_name() const;
7731 #else
7732  AsmElfSymverDefinedAux.setDataPrototype("SgAsmGenericString*", "name", "= 0",
7733  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
7734 #endif
7735 
7736  DECLARE_OTHERS(AsmElfSymverDefinedAux);
7737 #if defined(SgAsmElfSymverDefinedAux_OTHERS) || defined(DOCUMENTATION)
7738 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
7739  private:
7740  friend class boost::serialization::access;
7741 
7742  template<class S>
7743  void serialize(S &s, const unsigned /*version*/) {
7744  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
7745  s & BOOST_SERIALIZATION_NVP(p_name);
7746  }
7747 #endif
7748 
7749  public:
7750 #ifdef _MSC_VER
7751 # pragma pack (1)
7752 #endif
7753 
7756  uint32_t vda_name;
7757  uint32_t vda_next;
7758  }
7759 #if !defined(SWIG) && !defined(_MSC_VER)
7760  __attribute__((packed))
7761 #endif
7762  ;
7763 
7764 #ifdef _MSC_VER
7765 # pragma pack ()
7766 #endif
7767 
7772  SgAsmElfSymverDefinedSection *symver_def_sec)
7773  : p_name(NULL) {
7774  ctor(symver_def_entry,symver_def_sec);
7775  }
7776 
7778  void parse(ByteOrder::Endianness, const SgAsmElfSymverDefinedAux::ElfSymverDefinedAux_disk*);
7779 
7781  void *encode(ByteOrder::Endianness, SgAsmElfSymverDefinedAux::ElfSymverDefinedAux_disk*) const;
7782 
7788  virtual void dump(FILE *f, const char *prefix, ssize_t idx) const;
7789 
7790  private:
7791  void ctor(SgAsmElfSymverDefinedEntry*,SgAsmElfSymverDefinedSection *symver_def_sec);
7792 #endif // SgAsmElfSymverDefinedAux_OTHERS
7793 
7794 #ifdef DOCUMENTATION
7795  };
7796 #endif
7797 
7799 
7800  DECLARE_LEAF_CLASS(AsmElfSymverNeededSection);
7801  IS_SERIALIZABLE(AsmElfSymverNeededSection);
7802 
7803 #ifdef DOCUMENTATION
7804 
7810  public:
7811 #endif
7812 
7813 #ifdef DOCUMENTATION
7814 
7823 #else
7824  AsmElfSymverNeededSection.setDataPrototype("SgAsmElfSymverNeededEntryList*", "entries", "= NULL",
7825  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
7826 #endif
7827 
7828  DECLARE_OTHERS(AsmElfSymverNeededSection);
7829 #if defined(SgAsmElfSymverNeededSection_OTHERS) || defined(DOCUMENTATION)
7830 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
7831  private:
7832  friend class boost::serialization::access;
7833 
7834  template<class S>
7835  void serialize(S &s, const unsigned /*version*/) {
7836  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmElfSection);
7837  s & BOOST_SERIALIZATION_NVP(p_entries);
7838  }
7839 #endif
7840 
7841  public:
7846  : SgAsmElfSection(fhdr) {
7847  ctor(strsec);
7848  }
7849 
7859  virtual SgAsmElfSymverNeededSection* parse() override;
7860 
7865  virtual rose_addr_t calculate_sizes(size_t *total, size_t *required, size_t *optional, size_t *nentries) const override;
7866 
7870  virtual void unparse(std::ostream&) const override;
7871 
7873  virtual void dump(FILE*, const char *prefix, ssize_t idx) const override;
7874 
7875  private:
7876  void ctor(SgAsmElfStringSection*);
7877 #endif // SgAsmElfSymverNeededSection_OTHERS
7878 
7879 #ifdef DOCUMENTATION
7880  };
7881 #endif
7882 
7884 
7885  DECLARE_LEAF_CLASS(AsmElfSymverNeededEntryList);
7886  IS_SERIALIZABLE(AsmElfSymverNeededEntryList);
7887 
7888 #ifdef DOCUMENTATION
7889 
7894  public:
7895 #endif
7896 
7897 #ifdef DOCUMENTATION
7898 
7901  const SgAsmElfSymverNeededEntryPtrList& get_entries() void;
7902  void set_entries(const SgAsmElfSymverNeededEntryPtrList&);
7904 #else
7905  AsmElfSymverNeededEntryList.setDataPrototype("SgAsmElfSymverNeededEntryPtrList", "entries", "",
7906  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL,
7907  NO_DELETE);
7908 #endif
7909 
7910  DECLARE_OTHERS(AsmElfSymverNeededEntryList);
7911 #if defined(SgAsmElfSymverNeededEntryList_OTHERS) || defined(DOCUMENTATION)
7912 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
7913  private:
7914  friend class boost::serialization::access;
7915 
7916  template<class S>
7917  void serialize(S &s, const unsigned /*version*/) {
7918  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
7919  s & BOOST_SERIALIZATION_NVP(p_entries);
7920  }
7921 #endif
7922 #endif // SgAsmElfSymverNeededEntryList_OTHERS
7923 
7924 #ifdef DOCUMENTATION
7925  };
7926 #endif
7927 
7929 
7930  DECLARE_LEAF_CLASS(AsmElfSymverNeededEntry);
7931  IS_SERIALIZABLE(AsmElfSymverNeededEntry);
7932 
7933 #ifdef DOCUMENTATION
7934 
7936  public:
7937 #endif
7938 
7939 #ifdef DOCUMENTATION
7940 
7945  size_t get_version() const;
7946  void set_version(size_t);
7948 #else
7949  AsmElfSymverNeededEntry.setDataPrototype("size_t", "version", "= 0",
7950  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
7951 #endif
7952 
7953 #ifdef DOCUMENTATION
7954 
7960 #else
7961  AsmElfSymverNeededEntry.setDataPrototype("SgAsmGenericString*", "file_name", "= 0",
7962  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
7963 #endif
7964 
7965 #ifdef DOCUMENTATION
7966 
7975 #else
7976  AsmElfSymverNeededEntry.setDataPrototype("SgAsmElfSymverNeededAuxList*", "entries", "",
7977  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
7978 #endif
7979 
7980  DECLARE_OTHERS(AsmElfSymverNeededEntry);
7981 #if defined(SgAsmElfSymverNeededEntry_OTHERS) || defined(DOCUMENTATION)
7982 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
7983  private:
7984  friend class boost::serialization::access;
7985 
7986  template<class S>
7987  void serialize(S &s, const unsigned /*version*/) {
7988  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
7989  s & BOOST_SERIALIZATION_NVP(p_version);
7990  s & BOOST_SERIALIZATION_NVP(p_file_name);
7991  s & BOOST_SERIALIZATION_NVP(p_entries);
7992  }
7993 #endif
7994 
7995  public:
7996 #ifdef _MSC_VER
7997 # pragma pack (1)
7998 #endif
7999 
8002  uint16_t vn_version;
8003  uint16_t vn_cnt;
8004  uint32_t vn_file;
8005  uint32_t vn_aux;
8006  uint32_t vn_next;
8007  }
8008 #if !defined(SWIG) && !defined(_MSC_VER)
8009  __attribute__((packed))
8010 #endif
8011  ;
8012 
8013 #ifdef _MSC_VER
8014 # pragma pack ()
8015 #endif
8016 
8019  : p_file_name(NULL) {
8020  ctor(symver_needed);
8021  }
8022 
8024  void parse(ByteOrder::Endianness, const SgAsmElfSymverNeededEntry::ElfSymverNeededEntry_disk*);
8025 
8027  void *encode(ByteOrder::Endianness, SgAsmElfSymverNeededEntry::ElfSymverNeededEntry_disk*) const;
8028 
8030  virtual void dump(FILE *f, const char *prefix, ssize_t idx) const;
8031 
8032  private:
8033  void ctor(SgAsmElfSymverNeededSection*);
8034 #endif // SgAsmElfSymverNeededEntry_OTHERS
8035 
8036 #ifdef DOCUMENTATION
8037  };
8038 #endif
8039 
8041 
8042  DECLARE_LEAF_CLASS(AsmElfSymverNeededAuxList);
8043  IS_SERIALIZABLE(AsmElfSymverNeededAuxList);
8044 
8045 #ifdef DOCUMENTATION
8046 
8051  public:
8052 #endif
8053 
8054 #ifdef DOCUMENTATION
8055 
8058  const SgAsmElfSymverNeededAuxPtrList& get_entries() const;
8059  void set_entries(const SgAsmElfSymverNeededAuxPtrList&);
8061 #else
8062  AsmElfSymverNeededAuxList.setDataPrototype("SgAsmElfSymverNeededAuxPtrList", "entries", "",
8063  NO_CONSTRUCTOR_PARAMETER, BUILD_LIST_ACCESS_FUNCTIONS, DEF_TRAVERSAL,
8064  NO_DELETE);
8065 #endif
8066 
8067  DECLARE_OTHERS(AsmElfSymverNeededAuxList);
8068 #if defined(SgAsmElfSymverNeededAuxList_OTHERS) || defined(DOCUMENTATION)
8069 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
8070  private:
8071  friend class boost::serialization::access;
8072 
8073  template<class S>
8074  void serialize(S &s, const unsigned /*version*/) {
8075  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
8076  s & BOOST_SERIALIZATION_NVP(p_entries);
8077  }
8078 #endif
8079 #endif // SgAsmElfSymverNeededAuxList_OTHERS
8080 
8081 #ifdef DOCUMENTATION
8082  };
8083 #endif
8084 
8086 
8087  DECLARE_LEAF_CLASS(AsmElfSymverNeededAux);
8088  IS_SERIALIZABLE(AsmElfSymverNeededAux);
8089 
8090 #ifdef DOCUMENTATION
8091 
8093  public:
8094 #endif
8095 
8096 #ifdef DOCUMENTATION
8097 
8102  uint32_t get_hash() const;
8103  void set_hash(uint32_t);
8105 #else
8106  AsmElfSymverNeededAux.setDataPrototype("uint32_t", "hash", "= 0",
8107  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
8108 #endif
8109 
8110 #ifdef DOCUMENTATION
8111 
8116  int get_flags() const;
8117  void set_flags(int);
8119 #else
8120  AsmElfSymverNeededAux.setDataPrototype("int", "flags", "= 0",
8121  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
8122 #endif
8123 
8124 #ifdef DOCUMENTATION
8125 
8130  size_t get_other() const;
8131  void set_other(size_t);
8133 #else
8134  AsmElfSymverNeededAux.setDataPrototype("size_t", "other", "= 0",
8135  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
8136 #endif
8137 
8138 #ifdef DOCUMENTATION
8139 
8142  SgAsmGenericString* get_name() const;
8145 #else
8146  AsmElfSymverNeededAux.setDataPrototype("SgAsmGenericString*", "name", "= 0",
8147  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
8148 #endif
8149 
8150  DECLARE_OTHERS(AsmElfSymverNeededAux);
8151 #if defined(SgAsmElfSymverNeededAux_OTHERS) || defined(DOCUMENTATION)
8152 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
8153  private:
8154  friend class boost::serialization::access;
8155 
8156  template<class S>
8157  void serialize(S &s, const unsigned /*version*/) {
8158  s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmExecutableFileFormat);
8159  s & BOOST_SERIALIZATION_NVP(p_hash);
8160  s & BOOST_SERIALIZATION_NVP(p_flags);
8161  s & BOOST_SERIALIZATION_NVP(p_other);
8162  s & BOOST_SERIALIZATION_NVP(p_name);
8163  }
8164 #endif
8165 
8166  public:
8167 #ifdef _MSC_VER
8168 # pragma pack (1)
8169 #endif
8170 
8173  uint32_t vna_hash;
8174  uint16_t vna_flags;
8175  uint16_t vna_other;
8176  uint32_t vna_name;
8177  uint32_t vna_next;
8178  }
8179 #if !defined(SWIG) && !defined(_MSC_VER)
8180  __attribute__((packed))
8181 #endif
8182  ;
8183 
8184 #ifdef _MSC_VER
8185 # pragma pack ()
8186 #endif
8187 
8193  : p_name(NULL) {
8194  ctor(symver_needed_entry,symver_needed_sec);
8195  }
8196 
8198  void parse(ByteOrder::Endianness, const SgAsmElfSymverNeededAux::ElfSymverNeededAux_disk*);
8199 
8201  void *encode(ByteOrder::Endianness, SgAsmElfSymverNeededAux::ElfSymverNeededAux_disk*) const;
8202 
8208  virtual void dump(FILE *f, const char *prefix, ssize_t idx) const;
8209 
8210  private:
8212 #endif // SgAsmElfSymverNeededAux_OTHERS
8213 
8214 #ifdef DOCUMENTATION
8215  };
8216 #endif
8217 
8218 
8219 
8220 
8222 
8223  /*************************************************************************************************************************
8224  * ELF Relocation Tables
8225  *************************************************************************************************************************/
8226 
8228 
8229  DECLARE_LEAF_CLASS(AsmElfRelocSection);
8230  IS_SERIALIZABLE(AsmElfRelocSection);
8231 
8232 #ifdef DOCUMENTATION
8233 
8235  public:
8236 #endif
8237 
8238 #ifdef DOCUMENTATION
8239 
8242  bool get_uses_addend() const;
8243  void set_uses_addend(bool);
8245 #else
8246  AsmElfRelocSection.setDataPrototype("bool", "uses_addend", "= true",
8247  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
8248 #endif
8249 
8250 #ifdef DOCUMENTATION
8251 
8257 #else
8258  AsmElfRelocSection.setDataPrototype("SgAsmElfSection*", "target_section", "= NULL",
8259  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, NO_TRAVERSAL, NO_DELETE);
8260 #endif
8261 
8262 #ifdef DOCUMENTATION
8263 
8271 #else
8272  AsmElfRelocSection.setDataPrototype("SgAsmElfRelocEntryList*", "entries", "= NULL",
8273  NO_CONSTRUCTOR_PARAMETER, BUILD_ACCESS_FUNCTIONS, DEF_TRAVERSAL, NO_DELETE);
8274 #endif
8275 
8276  DECLARE_OTHERS(AsmElfRelocSection);
8277 #if defined(SgAsmElfRelocSection_OTHERS) || defined(DOCUMENTATION)
8278 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
8279  private:
8280  friend class boost::serialization::access;
8281 
8282  template<class S>
8283  void serialize(S &s, const unsigned /*versi