From f5199f68f2e636b5bc2a9f976fd19cc89aad10ab Mon Sep 17 00:00:00 2001 From: David Woodhouse Date: Tue, 28 Jan 2014 23:12:53 +0000 Subject: Keep the MCSubtargetInfo in the MCRelxableFragment class. Needed to fix PR18303 to correctly re-encode the instruction if it is relaxed. We keep a copy of the MCSubtargetInfo to make sure that we are not effected by future changes to the subtarget info coming from the assembler (e.g. when parsing .code 16 directived). llvm-svn: 200347 --- llvm/lib/MC/MCObjectStreamer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'llvm/lib/MC/MCObjectStreamer.cpp') diff --git a/llvm/lib/MC/MCObjectStreamer.cpp b/llvm/lib/MC/MCObjectStreamer.cpp index d46f9d6f903..689c4230aac 100644 --- a/llvm/lib/MC/MCObjectStreamer.cpp +++ b/llvm/lib/MC/MCObjectStreamer.cpp @@ -230,7 +230,7 @@ void MCObjectStreamer::EmitInstToFragment(const MCInst &Inst, const MCSubtargetInfo &STI) { // Always create a new, separate fragment here, because its size can change // during relaxation. - MCRelaxableFragment *IF = new MCRelaxableFragment(Inst); + MCRelaxableFragment *IF = new MCRelaxableFragment(Inst, STI); insert(IF); SmallString<128> Code; -- cgit v1.2.3