<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Fri, May 29, 2015 at 10:48 AM, Rafael Espindola <span dir="ltr"><<a href="mailto:rafael.espindola@gmail.com" target="_blank">rafael.espindola@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: rafael<br>
Date: Fri May 29 12:48:04 2015<br>
New Revision: 238583<br>
<br>
URL: <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject-3Frev-3D238583-26view-3Drev&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=mQ4LZ2PUj9hpadE3cDHZnIdEwhEBrbAstXeMaFoB9tg&m=v0XdA3Oe1bdKsAH66H1K7bu6MSLcTIYRHE6t3XnepKY&s=St6YzI7AsebjLTch-8vkFYKfdukb542eksb7k2owmL0&e=" target="_blank">http://llvm.org/viewvc/llvm-project?rev=238583&view=rev</a><br>
Log:<br>
Move common symbol related information from MCSectionData to MCSymbol.<br>
<br>
Modified:<br>
llvm/trunk/include/llvm/MC/MCSymbol.h<br>
llvm/trunk/lib/MC/ELFObjectWriter.cpp<br>
llvm/trunk/lib/MC/MCAssembler.cpp<br>
llvm/trunk/lib/MC/MCELFStreamer.cpp<br>
llvm/trunk/lib/MC/MCExpr.cpp<br>
llvm/trunk/lib/MC/MCMachOStreamer.cpp<br>
llvm/trunk/lib/MC/MCObjectStreamer.cpp<br>
llvm/trunk/lib/MC/MachObjectWriter.cpp<br>
llvm/trunk/lib/MC/WinCOFFObjectWriter.cpp<br>
llvm/trunk/lib/MC/WinCOFFStreamer.cpp<br>
<br>
Modified: llvm/trunk/include/llvm/MC/MCSymbol.h<br>
URL: <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject_llvm_trunk_include_llvm_MC_MCSymbol.h-3Frev-3D238583-26r1-3D238582-26r2-3D238583-26view-3Ddiff&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=mQ4LZ2PUj9hpadE3cDHZnIdEwhEBrbAstXeMaFoB9tg&m=v0XdA3Oe1bdKsAH66H1K7bu6MSLcTIYRHE6t3XnepKY&s=K9pKdQ1UJHgZGcv6_My2xc8kso94gmVb-3wISvsmbO8&e=" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/MC/MCSymbol.h?rev=238583&r1=238582&r2=238583&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/include/llvm/MC/MCSymbol.h (original)<br>
+++ llvm/trunk/include/llvm/MC/MCSymbol.h Fri May 29 12:48:04 2015<br>
@@ -34,39 +34,17 @@ class MCSymbolData {<br>
/// if it is private extern (bit 1).<br>
PointerIntPair<MCFragment *, 2> Fragment;<br>
<br>
- union {<br>
- /// Offset - The offset to apply to the fragment address to form this<br>
- /// symbol's value.<br>
- uint64_t Offset;<br>
-<br>
- /// CommonSize - The size of the symbol, if it is 'common'.<br>
- uint64_t CommonSize;<br>
- };<br>
-<br>
- /// CommonAlign - The alignment of the symbol, if it is 'common', or -1.<br>
- //<br>
- // FIXME: Pack this in with other fields?<br>
- unsigned CommonAlign = -1U;<br>
<br>
/// Flags - The Flags field is used by object file implementations to store<br>
/// additional per symbol information which is not easily classified.<br>
uint32_t Flags = 0;<br>
<br>
public:<br>
- MCSymbolData() { Offset = 0; }<br>
+ MCSymbolData() {}<br></blockquote><div><br>= default or remove this entirely if there are no other ctors?<br> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
MCFragment *getFragment() const { return Fragment.getPointer(); }<br>
void setFragment(MCFragment *Value) { Fragment.setPointer(Value); }<br>
<br>
- uint64_t getOffset() const {<br>
- assert(!isCommon());<br>
- return Offset;<br>
- }<br>
- void setOffset(uint64_t Value) {<br>
- assert(!isCommon());<br>
- Offset = Value;<br>
- }<br>
-<br>
/// @}<br>
/// \name Symbol Attributes<br>
/// @{<br>
@@ -81,31 +59,6 @@ public:<br>
Fragment.setInt((Fragment.getInt() & ~2) | (unsigned(Value) << 1));<br>
}<br>
<br>
- /// isCommon - Is this a 'common' symbol.<br>
- bool isCommon() const { return CommonAlign != -1U; }<br>
-<br>
- /// setCommon - Mark this symbol as being 'common'.<br>
- ///<br>
- /// \param Size - The size of the symbol.<br>
- /// \param Align - The alignment of the symbol.<br>
- void setCommon(uint64_t Size, unsigned Align) {<br>
- assert(getOffset() == 0);<br>
- CommonSize = Size;<br>
- CommonAlign = Align;<br>
- }<br>
-<br>
- /// getCommonSize - Return the size of a 'common' symbol.<br>
- uint64_t getCommonSize() const {<br>
- assert(isCommon() && "Not a 'common' symbol!");<br>
- return CommonSize;<br>
- }<br>
-<br>
- /// getCommonAlignment - Return the alignment of a 'common' symbol.<br>
- unsigned getCommonAlignment() const {<br>
- assert(isCommon() && "Not a 'common' symbol!");<br>
- return CommonAlign;<br>
- }<br>
-<br>
/// getFlags - Get the (implementation defined) symbol flags.<br>
uint32_t getFlags() const { return Flags; }<br>
<br>
@@ -167,6 +120,19 @@ class MCSymbol {<br>
/// symbol has no size this field will be NULL.<br>
const MCExpr *SymbolSize = nullptr;<br>
<br>
+ /// The alignment of the symbol, if it is 'common', or -1.<br>
+ //<br>
+ // FIXME: Pack this in with other fields?<br>
+ unsigned CommonAlign = -1U;<br>
+<br>
+ union {<br>
+ /// The offset to apply to the fragment address to form this symbol's value.<br>
+ uint64_t Offset;<br>
+<br>
+ /// The size of the symbol, if it is 'common'.<br>
+ uint64_t CommonSize;<br>
+ };<br>
+<br>
mutable MCSymbolData Data;<br>
<br>
private: // MCContext creates and uniques these.<br>
@@ -174,7 +140,9 @@ private: // MCContext creates and unique<br>
friend class MCContext;<br>
MCSymbol(const StringMapEntry<bool> *Name, bool isTemporary)<br>
: Name(Name), Section(nullptr), Value(nullptr), IsTemporary(isTemporary),<br>
- IsRedefinable(false), IsUsed(false), HasData(false), Index(0) {}<br>
+ IsRedefinable(false), IsUsed(false), HasData(false), Index(0) {<br>
+ Offset = 0;<br>
+ }<br>
<br>
MCSymbol(const MCSymbol &) = delete;<br>
void operator=(const MCSymbol &) = delete;<br>
@@ -295,6 +263,40 @@ public:<br>
<br>
const MCExpr *getSize() const { return SymbolSize; }<br>
<br>
+ uint64_t getOffset() const {<br>
+ assert(!isCommon());<br>
+ return Offset;<br>
+ }<br>
+ void setOffset(uint64_t Value) {<br>
+ assert(!isCommon());<br>
+ Offset = Value;<br>
+ }<br>
+<br>
+ /// Return the size of a 'common' symbol.<br>
+ uint64_t getCommonSize() const {<br>
+ assert(isCommon() && "Not a 'common' symbol!");<br>
+ return CommonSize;<br>
+ }<br>
+<br>
+ /// Mark this symbol as being 'common'.<br>
+ ///<br>
+ /// \param Size - The size of the symbol.<br>
+ /// \param Align - The alignment of the symbol.<br>
+ void setCommon(uint64_t Size, unsigned Align) {<br>
+ assert(getOffset() == 0);<br>
+ CommonSize = Size;<br>
+ CommonAlign = Align;<br>
+ }<br>
+<br>
+ /// Return the alignment of a 'common' symbol.<br>
+ unsigned getCommonAlignment() const {<br>
+ assert(isCommon() && "Not a 'common' symbol!");<br>
+ return CommonAlign;<br>
+ }<br>
+<br>
+ /// Is this a 'common' symbol.<br>
+ bool isCommon() const { return CommonAlign != -1U; }<br>
+<br>
/// print - Print the value to the stream \p OS.<br>
void print(raw_ostream &OS) const;<br>
<br>
<br>
Modified: llvm/trunk/lib/MC/ELFObjectWriter.cpp<br>
URL: <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject_llvm_trunk_lib_MC_ELFObjectWriter.cpp-3Frev-3D238583-26r1-3D238582-26r2-3D238583-26view-3Ddiff&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=mQ4LZ2PUj9hpadE3cDHZnIdEwhEBrbAstXeMaFoB9tg&m=v0XdA3Oe1bdKsAH66H1K7bu6MSLcTIYRHE6t3XnepKY&s=6a-XZOdkqnFJl9v8JXKGLgdCkmubNoDxcRLWGw5kaeI&e=" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/ELFObjectWriter.cpp?rev=238583&r1=238582&r2=238583&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/lib/MC/ELFObjectWriter.cpp (original)<br>
+++ llvm/trunk/lib/MC/ELFObjectWriter.cpp Fri May 29 12:48:04 2015<br>
@@ -360,8 +360,8 @@ void ELFObjectWriter::writeHeader(const<br>
uint64_t ELFObjectWriter::SymbolValue(const MCSymbol &Sym,<br>
const MCAsmLayout &Layout) {<br>
MCSymbolData &Data = Sym.getData();<br>
- if (Data.isCommon() && Data.isExternal())<br>
- return Data.getCommonAlignment();<br>
+ if (Sym.isCommon() && Data.isExternal())<br>
+ return Sym.getCommonAlignment();<br>
<br>
uint64_t Res;<br>
if (!Layout.getSymbolOffset(Sym, Res))<br>
@@ -459,7 +459,7 @@ void ELFObjectWriter::writeSymbol(Symbol<br>
<br>
// This has to be in sync with when computeSymbolTable uses SHN_ABS or<br>
// SHN_COMMON.<br>
- bool IsReserved = !Base || OrigData.isCommon();<br>
+ bool IsReserved = !Base || MSD.Symbol->isCommon();<br>
<br>
// Binding and Type share the same byte as upper and lower nibbles<br>
uint8_t Binding = MCELF::GetBinding(OrigData);<br>
@@ -832,7 +832,7 @@ void ELFObjectWriter::computeSymbolTable<br>
<br>
if (Symbol.isAbsolute()) {<br>
MSD.SectionIndex = ELF::SHN_ABS;<br>
- } else if (SD.isCommon()) {<br>
+ } else if (Symbol.isCommon()) {<br>
assert(!Local);<br>
MSD.SectionIndex = ELF::SHN_COMMON;<br>
} else if (Symbol.isUndefined()) {<br>
<br>
Modified: llvm/trunk/lib/MC/MCAssembler.cpp<br>
URL: <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject_llvm_trunk_lib_MC_MCAssembler.cpp-3Frev-3D238583-26r1-3D238582-26r2-3D238583-26view-3Ddiff&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=mQ4LZ2PUj9hpadE3cDHZnIdEwhEBrbAstXeMaFoB9tg&m=v0XdA3Oe1bdKsAH66H1K7bu6MSLcTIYRHE6t3XnepKY&s=QzGbIF_Nz9mJa0VI_cMY26ip39A_UuyVTqCuIIBeh6w&e=" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCAssembler.cpp?rev=238583&r1=238582&r2=238583&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/lib/MC/MCAssembler.cpp (original)<br>
+++ llvm/trunk/lib/MC/MCAssembler.cpp Fri May 29 12:48:04 2015<br>
@@ -127,7 +127,7 @@ static bool getLabelOffset(const MCAsmLa<br>
S.getName() + "'");<br>
return false;<br>
}<br>
- Val = Layout.getFragmentOffset(SD.getFragment()) + SD.getOffset();<br>
+ Val = Layout.getFragmentOffset(SD.getFragment()) + S.getOffset();<br>
return true;<br>
}<br>
<br>
@@ -195,8 +195,7 @@ const MCSymbol *MCAsmLayout::getBaseSymb<br>
<br>
const MCSymbol &ASym = A->getSymbol();<br>
const MCAssembler &Asm = getAssembler();<br>
- const MCSymbolData &ASD = ASym.getData();<br>
- if (ASD.isCommon()) {<br>
+ if (ASym.isCommon()) {<br>
// FIXME: we should probably add a SMLoc to MCExpr.<br>
Asm.getContext().reportFatalError(SMLoc(),<br>
"Common symbol " + ASym.getName() +<br>
@@ -1189,12 +1188,7 @@ void MCSymbolData::dump() const {<br>
<br>
OS << "<MCSymbolData"<br>
<< " Fragment:" << getFragment();<br>
- if (!isCommon())<br>
- OS << " Offset:" << getOffset();<br>
OS << " Flags:" << getFlags();<br>
- if (isCommon())<br>
- OS << " (common, size:" << getCommonSize()<br>
- << " align: " << getCommonAlignment() << ")";<br>
if (isExternal())<br>
OS << " (external)";<br>
if (isPrivateExtern())<br>
<br>
Modified: llvm/trunk/lib/MC/MCELFStreamer.cpp<br>
URL: <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject_llvm_trunk_lib_MC_MCELFStreamer.cpp-3Frev-3D238583-26r1-3D238582-26r2-3D238583-26view-3Ddiff&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=mQ4LZ2PUj9hpadE3cDHZnIdEwhEBrbAstXeMaFoB9tg&m=v0XdA3Oe1bdKsAH66H1K7bu6MSLcTIYRHE6t3XnepKY&s=jLeo-PS_2UyYHa0dNxR_W30ZpLMwWfzwkQ4GQ1fDP4w&e=" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCELFStreamer.cpp?rev=238583&r1=238582&r2=238583&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/lib/MC/MCELFStreamer.cpp (original)<br>
+++ llvm/trunk/lib/MC/MCELFStreamer.cpp Fri May 29 12:48:04 2015<br>
@@ -328,7 +328,7 @@ void MCELFStreamer::EmitCommonSymbol(MCS<br>
struct LocalCommon L = {Symbol, Size, ByteAlignment};<br>
LocalCommons.push_back(L);<br>
} else {<br>
- SD.setCommon(Size, ByteAlignment);<br>
+ Symbol->setCommon(Size, ByteAlignment);<br>
}<br>
<br>
Symbol->setSize(MCConstantExpr::Create(Size, getContext()));<br>
<br>
Modified: llvm/trunk/lib/MC/MCExpr.cpp<br>
URL: <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject_llvm_trunk_lib_MC_MCExpr.cpp-3Frev-3D238583-26r1-3D238582-26r2-3D238583-26view-3Ddiff&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=mQ4LZ2PUj9hpadE3cDHZnIdEwhEBrbAstXeMaFoB9tg&m=v0XdA3Oe1bdKsAH66H1K7bu6MSLcTIYRHE6t3XnepKY&s=iZ2_QzohFvr37c9y3iIn_XAtOJgmsDe9Iw3ht3DikLE&e=" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCExpr.cpp?rev=238583&r1=238582&r2=238583&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/lib/MC/MCExpr.cpp (original)<br>
+++ llvm/trunk/lib/MC/MCExpr.cpp Fri May 29 12:48:04 2015<br>
@@ -475,7 +475,7 @@ static void AttemptToFoldSymbolOffsetDif<br>
const MCSymbolData &BD = SB.getData();<br>
<br>
if (AD.getFragment() == BD.getFragment()) {<br>
- Addend += (AD.getOffset() - BD.getOffset());<br>
+ Addend += (SA.getOffset() - SB.getOffset());<br>
<br>
// Pointers to Thumb symbols need to have their low-bit set to allow<br>
// for interworking.<br>
<br>
Modified: llvm/trunk/lib/MC/MCMachOStreamer.cpp<br>
URL: <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject_llvm_trunk_lib_MC_MCMachOStreamer.cpp-3Frev-3D238583-26r1-3D238582-26r2-3D238583-26view-3Ddiff&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=mQ4LZ2PUj9hpadE3cDHZnIdEwhEBrbAstXeMaFoB9tg&m=v0XdA3Oe1bdKsAH66H1K7bu6MSLcTIYRHE6t3XnepKY&s=tecogaDXvaivUTi5xJ8LGn_sQTMhfNlnp8YrhlL09yM&e=" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCMachOStreamer.cpp?rev=238583&r1=238582&r2=238583&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/lib/MC/MCMachOStreamer.cpp (original)<br>
+++ llvm/trunk/lib/MC/MCMachOStreamer.cpp Fri May 29 12:48:04 2015<br>
@@ -392,7 +392,7 @@ void MCMachOStreamer::EmitCommonSymbol(M<br>
<br>
MCSymbolData &SD = getAssembler().getOrCreateSymbolData(*Symbol);<br>
SD.setExternal(true);<br>
- SD.setCommon(Size, ByteAlignment);<br>
+ Symbol->setCommon(Size, ByteAlignment);<br>
}<br>
<br>
void MCMachOStreamer::EmitLocalCommonSymbol(MCSymbol *Symbol, uint64_t Size,<br>
@@ -470,7 +470,8 @@ void MCMachOStreamer::FinishImpl() {<br>
MCSymbolData &SD = Symbol.getData();<br>
if (getAssembler().isSymbolLinkerVisible(Symbol) && SD.getFragment()) {<br>
// An atom defining symbol should never be internal to a fragment.<br>
- assert(SD.getOffset() == 0 && "Invalid offset in atom defining symbol!");<br>
+ assert(Symbol.getOffset() == 0 &&<br>
+ "Invalid offset in atom defining symbol!");<br>
DefiningSymbolMap[SD.getFragment()] = &Symbol;<br>
}<br>
}<br>
<br>
Modified: llvm/trunk/lib/MC/MCObjectStreamer.cpp<br>
URL: <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject_llvm_trunk_lib_MC_MCObjectStreamer.cpp-3Frev-3D238583-26r1-3D238582-26r2-3D238583-26view-3Ddiff&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=mQ4LZ2PUj9hpadE3cDHZnIdEwhEBrbAstXeMaFoB9tg&m=v0XdA3Oe1bdKsAH66H1K7bu6MSLcTIYRHE6t3XnepKY&s=G30t6k0r1v3CWmrdhdSvbn_FRd8l8pNYgF_j9RPBFPw&e=" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCObjectStreamer.cpp?rev=238583&r1=238582&r2=238583&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/lib/MC/MCObjectStreamer.cpp (original)<br>
+++ llvm/trunk/lib/MC/MCObjectStreamer.cpp Fri May 29 12:48:04 2015<br>
@@ -49,7 +49,7 @@ void MCObjectStreamer::flushPendingLabel<br>
for (MCSymbol *Sym : PendingLabels) {<br>
MCSymbolData *SD = &Sym->getData();<br>
SD->setFragment(F);<br>
- SD->setOffset(FOffset);<br>
+ Sym->setOffset(FOffset);<br>
}<br>
PendingLabels.clear();<br>
}<br>
@@ -72,9 +72,9 @@ bool MCObjectStreamer::emitAbsoluteSymbo<br>
if (!isa<MCDataFragment>(HiD.getFragment()))<br>
return false;<br>
<br>
- assert(HiD.getOffset() >= LoD.getOffset() &&<br>
+ assert(Hi->getOffset() >= Lo->getOffset() &&<br>
"Expected Hi to be greater than Lo");<br>
- EmitIntValue(HiD.getOffset() - LoD.getOffset(), Size);<br>
+ EmitIntValue(Hi->getOffset() - Lo->getOffset(), Size);<br>
return true;<br>
}<br>
<br>
@@ -173,7 +173,7 @@ void MCObjectStreamer::EmitLabel(MCSymbo<br>
if (F && !(getAssembler().isBundlingEnabled() &&<br>
getAssembler().getRelaxAll())) {<br>
SD.setFragment(F);<br>
- SD.setOffset(F->getContents().size());<br>
+ Symbol->setOffset(F->getContents().size());<br>
} else {<br>
PendingLabels.push_back(Symbol);<br>
}<br>
<br>
Modified: llvm/trunk/lib/MC/MachObjectWriter.cpp<br>
URL: <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject_llvm_trunk_lib_MC_MachObjectWriter.cpp-3Frev-3D238583-26r1-3D238582-26r2-3D238583-26view-3Ddiff&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=mQ4LZ2PUj9hpadE3cDHZnIdEwhEBrbAstXeMaFoB9tg&m=v0XdA3Oe1bdKsAH66H1K7bu6MSLcTIYRHE6t3XnepKY&s=QKaiEpTN9pu92OjM92cgIz70HWSNan8I8CG7hGFiahE&e=" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MachObjectWriter.cpp?rev=238583&r1=238582&r2=238583&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/lib/MC/MachObjectWriter.cpp (original)<br>
+++ llvm/trunk/lib/MC/MachObjectWriter.cpp Fri May 29 12:48:04 2015<br>
@@ -373,13 +373,13 @@ void MachObjectWriter::WriteNlist(MachSy<br>
Address = AliaseeInfo->StringIndex;<br>
else if (Symbol->isDefined())<br>
Address = getSymbolAddress(OrigSymbol, Layout);<br>
- else if (Data.isCommon()) {<br>
+ else if (Symbol->isCommon()) {<br>
// Common symbols are encoded with the size in the address<br>
// field, and their alignment in the flags.<br>
- Address = Data.getCommonSize();<br>
+ Address = Symbol->getCommonSize();<br>
<br>
// Common alignment is packed into the 'desc' bits.<br>
- if (unsigned Align = Data.getCommonAlignment()) {<br>
+ if (unsigned Align = Symbol->getCommonAlignment()) {<br>
unsigned Log2Size = Log2_32(Align);<br>
assert((1U << Log2Size) == Align && "Invalid 'common' alignment!");<br>
if (Log2Size > 15)<br>
<br>
Modified: llvm/trunk/lib/MC/WinCOFFObjectWriter.cpp<br>
URL: <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject_llvm_trunk_lib_MC_WinCOFFObjectWriter.cpp-3Frev-3D238583-26r1-3D238582-26r2-3D238583-26view-3Ddiff&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=mQ4LZ2PUj9hpadE3cDHZnIdEwhEBrbAstXeMaFoB9tg&m=v0XdA3Oe1bdKsAH66H1K7bu6MSLcTIYRHE6t3XnepKY&s=NvTgrahazitIfggtqjEfMNyoqz0bGjGfRLbs-Xw8O0s&e=" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/WinCOFFObjectWriter.cpp?rev=238583&r1=238582&r2=238583&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/lib/MC/WinCOFFObjectWriter.cpp (original)<br>
+++ llvm/trunk/lib/MC/WinCOFFObjectWriter.cpp Fri May 29 12:48:04 2015<br>
@@ -365,8 +365,8 @@ void WinCOFFObjectWriter::defineSection(<br>
static uint64_t getSymbolValue(const MCSymbol &Symbol,<br>
const MCAsmLayout &Layout) {<br>
const MCSymbolData &Data = Symbol.getData();<br>
- if (Data.isCommon() && Data.isExternal())<br>
- return Data.getCommonSize();<br>
+ if (Symbol.isCommon() && Data.isExternal())<br>
+ return Symbol.getCommonSize();<br>
<br>
uint64_t Res;<br>
if (!Layout.getSymbolOffset(Symbol, Res))<br>
@@ -765,7 +765,7 @@ void WinCOFFObjectWriter::RecordRelocati<br>
Reloc.Symb = coff_symbol->Section->Symbol;<br>
FixedValue +=<br>
Layout.getFragmentOffset(coff_symbol->MC->getData().getFragment()) +<br>
- coff_symbol->MC->getData().getOffset();<br>
+ coff_symbol->MC->getOffset();<br>
} else<br>
Reloc.Symb = coff_symbol;<br>
<br>
<br>
Modified: llvm/trunk/lib/MC/WinCOFFStreamer.cpp<br>
URL: <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject_llvm_trunk_lib_MC_WinCOFFStreamer.cpp-3Frev-3D238583-26r1-3D238582-26r2-3D238583-26view-3Ddiff&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=mQ4LZ2PUj9hpadE3cDHZnIdEwhEBrbAstXeMaFoB9tg&m=v0XdA3Oe1bdKsAH66H1K7bu6MSLcTIYRHE6t3XnepKY&s=OuW0WrlPLfK5z0uyBKAZU7hjPva7tmhMZPobC86iiNI&e=" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/WinCOFFStreamer.cpp?rev=238583&r1=238582&r2=238583&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/lib/MC/WinCOFFStreamer.cpp (original)<br>
+++ llvm/trunk/lib/MC/WinCOFFStreamer.cpp Fri May 29 12:48:04 2015<br>
@@ -196,7 +196,7 @@ void MCWinCOFFStreamer::EmitCommonSymbol<br>
<br>
MCSymbolData &SD = getAssembler().getOrCreateSymbolData(*Symbol);<br>
SD.setExternal(true);<br>
- SD.setCommon(Size, ByteAlignment);<br>
+ Symbol->setCommon(Size, ByteAlignment);<br>
<br>
if (!T.isKnownWindowsMSVCEnvironment() && ByteAlignment > 1) {<br>
SmallString<128> Directive;<br>
<br>
<br>
_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
</blockquote></div><br></div></div>