diff options
author | Rui Ueyama <ruiu@google.com> | 2015-03-26 02:20:25 +0000 |
---|---|---|
committer | Rui Ueyama <ruiu@google.com> | 2015-03-26 02:20:25 +0000 |
commit | 629f964d50d140366edd129bc4368ba6bd918eea (patch) | |
tree | f1f4af79d81d6b1a2b097a6e696663761d1a0a82 /lld/include/lld/Core/DefinedAtom.h | |
parent | f217ef0d75a4438f610764e582823ffd4807d75d (diff) | |
download | bcm5719-llvm-629f964d50d140366edd129bc4368ba6bd918eea.tar.gz bcm5719-llvm-629f964d50d140366edd129bc4368ba6bd918eea.zip |
Use arithmetic type to represent alignments (not in log2) everywhere.
This is the final step of conversion. Now log2 numbers are removed
from everywhere!
llvm-svn: 233246
Diffstat (limited to 'lld/include/lld/Core/DefinedAtom.h')
-rw-r--r-- | lld/include/lld/Core/DefinedAtom.h | 22 |
1 files changed, 1 insertions, 21 deletions
diff --git a/lld/include/lld/Core/DefinedAtom.h b/lld/include/lld/Core/DefinedAtom.h index 211c9bd50c9..986c7ff5ad1 100644 --- a/lld/include/lld/Core/DefinedAtom.h +++ b/lld/include/lld/Core/DefinedAtom.h @@ -17,26 +17,6 @@ namespace lld { class File; class Reference; -// This class represents exponents of power-of-two numbers. -// Used to represent alignments. -// -// Currently we represent alignments both in log2 of a value or a -// value itself. That is confusing. We aim to use only real values -// only. Conversion is not easy, since both types are just arithmetic -// types, and thus the compiler doesn't help us find places we mix -// them. This class is to make all places where exponents are used -// explicit. -// -// Once the conversion is done, this class will be removed. -class PowerOf2 { -public: - PowerOf2(uint16_t v) : _v(v) {} - bool operator==(const PowerOf2 &other) const { return _v == other._v; } - operator uint16_t() const { return _v; } -private: - uint16_t _v; -}; - /// \brief The fundamental unit of linking. /// /// A C function or global variable is an atom. An atom has content and @@ -220,7 +200,7 @@ public: struct Alignment { Alignment(int v, int m = 0) : value(v), modulus(m) {} - PowerOf2 value; + uint16_t value; uint16_t modulus; bool operator==(const Alignment &rhs) const { |