[lld] r233247 - Store non-log2 values to Native files.

Rui Ueyama ruiu at google.com
Wed Mar 25 19:23:43 PDT 2015


Author: ruiu
Date: Wed Mar 25 21:23:42 2015
New Revision: 233247

URL: http://llvm.org/viewvc/llvm-project?rev=233247&view=rev
Log:
Store non-log2 values to Native files.

Modified:
    lld/trunk/lib/ReaderWriter/Native/NativeFileFormat.h
    lld/trunk/lib/ReaderWriter/Native/ReaderNative.cpp
    lld/trunk/lib/ReaderWriter/Native/WriterNative.cpp

Modified: lld/trunk/lib/ReaderWriter/Native/NativeFileFormat.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/Native/NativeFileFormat.h?rev=233247&r1=233246&r2=233247&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/Native/NativeFileFormat.h (original)
+++ lld/trunk/lib/ReaderWriter/Native/NativeFileFormat.h Wed Mar 25 21:23:42 2015
@@ -145,7 +145,7 @@ struct NativeDefinedAtomIvarsV1 {
 //
 struct NativeAtomAttributesV1 {
   uint32_t  sectionNameOffset;
-  uint16_t  align2;
+  uint16_t  align;
   uint16_t  alignModulus;
   uint8_t   scope;
   uint8_t   interposable;

Modified: lld/trunk/lib/ReaderWriter/Native/ReaderNative.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/Native/ReaderNative.cpp?rev=233247&r1=233246&r2=233247&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/Native/ReaderNative.cpp (original)
+++ lld/trunk/lib/ReaderWriter/Native/ReaderNative.cpp Wed Mar 25 21:23:42 2015
@@ -67,7 +67,7 @@ public:
   }
 
   DefinedAtom::Alignment alignment() const override {
-    return DefinedAtom::Alignment(1 << attributes().align2,
+    return DefinedAtom::Alignment(attributes().align,
                                   attributes().alignModulus);
   }
 

Modified: lld/trunk/lib/ReaderWriter/Native/WriterNative.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/Native/WriterNative.cpp?rev=233247&r1=233246&r2=233247&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/Native/WriterNative.cpp (original)
+++ lld/trunk/lib/ReaderWriter/Native/WriterNative.cpp Wed Mar 25 21:23:42 2015
@@ -416,7 +416,7 @@ private:
   NativeAtomAttributesV1 computeAttributesV1(const DefinedAtom& atom) {
     NativeAtomAttributesV1 attrs;
     attrs.sectionNameOffset = sectionNameOffset(atom);
-    attrs.align2            = llvm::Log2_32(atom.alignment().value);
+    attrs.align             = atom.alignment().value;
     attrs.alignModulus      = atom.alignment().modulus;
     attrs.scope             = atom.scope();
     attrs.interposable      = atom.interposable();





More information about the llvm-commits mailing list