Fix llvm-gcc boostrap on OS X by avoiding printing sleb and uleb when

possible.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119785 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Rafael Espindola 2010-11-19 04:10:13 +00:00
parent 0f60ddc277
commit a4b23ffced

View File

@ -535,12 +535,28 @@ void MCAsmStreamer::EmitValue(const MCExpr *Value, unsigned Size,
}
void MCAsmStreamer::EmitULEB128Value(const MCExpr *Value, unsigned AddrSpace) {
int64_t IntValue;
if (Value->EvaluateAsAbsolute(IntValue)) {
SmallString<32> Tmp;
raw_svector_ostream OSE(Tmp);
MCObjectWriter::EncodeULEB128(IntValue, OSE);
EmitBytes(OSE.str(), AddrSpace);
return;
}
assert(MAI.hasLEB128() && "Cannot print a .uleb");
OS << ".uleb128 " << *Value;
EmitEOL();
}
void MCAsmStreamer::EmitSLEB128Value(const MCExpr *Value, unsigned AddrSpace) {
int64_t IntValue;
if (Value->EvaluateAsAbsolute(IntValue)) {
SmallString<32> Tmp;
raw_svector_ostream OSE(Tmp);
MCObjectWriter::EncodeSLEB128(IntValue, OSE);
EmitBytes(OSE.str(), AddrSpace);
return;
}
assert(MAI.hasLEB128() && "Cannot print a .sleb");
OS << ".sleb128 " << *Value;
EmitEOL();