retdec
decoder_ranges.h
Go to the documentation of this file.
1 
7 #ifndef RETDEC_BIN2LLVMIR_OPTIMIZATIONS_DECODER_DECODER_RANGES_H
8 #define RETDEC_BIN2LLVMIR_OPTIMIZATIONS_DECODER_DECODER_RANGES_H
9 
10 #include <iostream>
11 
12 #include "retdec/common/address.h"
14 
15 namespace retdec {
16 namespace bin2llvmir {
17 
19 {
20  public:
22  void addPrimary(const common::AddressRange& r);
24  void addAlternative(const common::AddressRange& r);
26 
28  void remove(const common::AddressRange& r);
29  void removeZeroSequences(FileImage* image);
30 
31  bool isStrict() const;
32  bool primaryEmpty() const;
33  bool alternativeEmpty() const;
34 
35  const common::AddressRange& primaryFront() const;
37 
41 
42  void setArchitectureInstructionAlignment(unsigned a);
43 
44  friend std::ostream& operator<<(std::ostream &os, const RangesToDecode& rs);
45 
46  private:
48  FileImage* image,
50 
51  private:
54  unsigned archInsnAlign = 0;
55  bool _strict = false;
56 };
57 
58 } // namespace bin2llvmir
59 } // namespace retdec
60 
61 #endif
Definition: fileimage.h:27
Definition: decoder_ranges.h:19
bool alternativeEmpty() const
Definition: decoder_ranges.cpp:163
bool _strict
Definition: decoder_ranges.h:55
void setArchitectureInstructionAlignment(unsigned a)
Definition: decoder_ranges.cpp:195
bool primaryEmpty() const
Definition: decoder_ranges.cpp:158
friend std::ostream & operator<<(std::ostream &os, const RangesToDecode &rs)
Definition: decoder_ranges.cpp:200
unsigned archInsnAlign
Definition: decoder_ranges.h:54
void removeZeroSequences(FileImage *image)
Definition: decoder_ranges.cpp:71
void addPrimary(common::Address s, common::Address e)
Definition: decoder_ranges.cpp:25
common::AddressRangeContainer _alternativeRanges
Definition: decoder_ranges.h:53
const common::AddressRange * getAlternative(common::Address a) const
Definition: decoder_ranges.cpp:183
const common::AddressRange & primaryFront() const
Definition: decoder_ranges.cpp:168
const common::AddressRange * getPrimary(common::Address a) const
Definition: decoder_ranges.cpp:178
const common::AddressRange & alternativeFront() const
Definition: decoder_ranges.cpp:173
common::AddressRangeContainer _primaryRanges
Definition: decoder_ranges.h:52
bool isStrict() const
Definition: decoder_ranges.cpp:153
const common::AddressRange * get(common::Address a) const
Definition: decoder_ranges.cpp:189
void promoteAlternativeToPrimary()
Definition: decoder_ranges.cpp:53
void remove(common::Address s, common::Address e)
Definition: decoder_ranges.cpp:59
void addAlternative(common::Address s, common::Address e)
Definition: decoder_ranges.cpp:39
Definition: address.h:21
Definition: range.h:281
Definition: range.h:45
Address, address pair and other derived class representation.
File image provider for bin2llvmirl.
The frontend-end part of the decompiler.
Definition: archive_wrapper.h:19