summaryrefslogtreecommitdiffstats
path: root/lld/lib/ReaderWriter/MachO/MachONormalizedFileYAML.cpp
diff options
context:
space:
mode:
authorRui Ueyama <ruiu@google.com>2015-03-26 01:44:01 +0000
committerRui Ueyama <ruiu@google.com>2015-03-26 01:44:01 +0000
commitf006f4d62c9375288f25870f2b020609d67f6b11 (patch)
tree6753fb979cf61e0d4f2951925de3e686a1652482 /lld/lib/ReaderWriter/MachO/MachONormalizedFileYAML.cpp
parent48865ca64d823eb5a76514deeffe235b54c86da7 (diff)
downloadbcm5719-llvm-f006f4d62c9375288f25870f2b020609d67f6b11.tar.gz
bcm5719-llvm-f006f4d62c9375288f25870f2b020609d67f6b11.zip
Define an implicit constructor which takes actual alignment value to PowerOf2.
The new constructor's type is the same, but this one takes not a log2 value but an alignment value itself, so the meaning is totally differnet. llvm-svn: 233244
Diffstat (limited to 'lld/lib/ReaderWriter/MachO/MachONormalizedFileYAML.cpp')
-rw-r--r--lld/lib/ReaderWriter/MachO/MachONormalizedFileYAML.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/lld/lib/ReaderWriter/MachO/MachONormalizedFileYAML.cpp b/lld/lib/ReaderWriter/MachO/MachONormalizedFileYAML.cpp
index 79eefd32573..5d71c75ef43 100644
--- a/lld/lib/ReaderWriter/MachO/MachONormalizedFileYAML.cpp
+++ b/lld/lib/ReaderWriter/MachO/MachONormalizedFileYAML.cpp
@@ -61,7 +61,7 @@ struct ScalarTraits<lld::PowerOf2> {
static StringRef input(StringRef scalar, void*, lld::PowerOf2 &result) {
uint32_t value;
scalar.getAsInteger(10, value);
- result = lld::PowerOf2::create(value);
+ result = 1 << value;
return StringRef();
}
static bool mustQuote(StringRef) { return false; }
@@ -290,7 +290,7 @@ struct MappingTraits<Section> {
io.mapRequired("section", sect.sectionName);
io.mapRequired("type", sect.type);
io.mapOptional("attributes", sect.attributes);
- io.mapOptional("alignment", sect.alignment, lld::PowerOf2::create(0));
+ io.mapOptional("alignment", sect.alignment, lld::PowerOf2(1));
io.mapRequired("address", sect.address);
if (sect.type == llvm::MachO::S_ZEROFILL) {
// S_ZEROFILL sections use "size:" instead of "content:"
OpenPOWER on IntegriCloud