[llvm-commits] [llvm] r122446 - in /llvm/trunk/lib/MC: MCAssembler.cpp MCObjectStreamer.cpp
Rafael Espindola
rafael.espindola at gmail.com
Wed Dec 22 14:04:28 PST 2010
Author: rafael
Date: Wed Dec 22 16:04:28 2010
New Revision: 122446
URL: http://llvm.org/viewvc/llvm-project?rev=122446&view=rev
Log:
Assert that the AddrDelta expression is really constant and wrap it in a set
if we have a lame assembler.
Modified:
llvm/trunk/lib/MC/MCAssembler.cpp
llvm/trunk/lib/MC/MCObjectStreamer.cpp
Modified: llvm/trunk/lib/MC/MCAssembler.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCAssembler.cpp?rev=122446&r1=122445&r2=122446&view=diff
==============================================================================
--- llvm/trunk/lib/MC/MCAssembler.cpp (original)
+++ llvm/trunk/lib/MC/MCAssembler.cpp Wed Dec 22 16:04:28 2010
@@ -687,7 +687,9 @@
MCDwarfLineAddrFragment &DF) {
int64_t AddrDelta = 0;
uint64_t OldSize = DF.getContents().size();
- DF.getAddrDelta().EvaluateAsAbsolute(AddrDelta, Layout);
+ bool IsAbs = DF.getAddrDelta().EvaluateAsAbsolute(AddrDelta, Layout);
+ (void)IsAbs;
+ assert(IsAbs);
int64_t LineDelta;
LineDelta = DF.getLineDelta();
SmallString<8> &Data = DF.getContents();
Modified: llvm/trunk/lib/MC/MCObjectStreamer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCObjectStreamer.cpp?rev=122446&r1=122445&r2=122446&view=diff
==============================================================================
--- llvm/trunk/lib/MC/MCObjectStreamer.cpp (original)
+++ llvm/trunk/lib/MC/MCObjectStreamer.cpp Wed Dec 22 16:04:28 2010
@@ -7,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
+#include "llvm/MC/MCAsmInfo.h"
#include "llvm/MC/MCObjectStreamer.h"
#include "llvm/Support/ErrorHandling.h"
@@ -90,7 +91,7 @@
return;
}
DF->addFixup(MCFixup::Create(DF->getContents().size(),
- AddValueSymbols(Value),
+ Value,
MCFixup::getKindForSize(Size, isPCRel)));
DF->getContents().resize(DF->getContents().size() + Size, 0);
}
@@ -210,6 +211,11 @@
MCDwarfLineAddr::Emit(this, LineDelta, Res);
return;
}
+ if (!getContext().getAsmInfo().hasAggressiveSymbolFolding()) {
+ MCSymbol *ABS = getContext().CreateTempSymbol();
+ EmitAssignment(ABS, AddrDelta);
+ AddrDelta = MCSymbolRefExpr::Create(ABS, getContext());
+ }
new MCDwarfLineAddrFragment(LineDelta, *AddrDelta, getCurrentSectionData());
}
More information about the llvm-commits
mailing list