blob: 6c3d2476688c8e4858ffc17bc61931089de055ba [file] [log] [blame]
Tim Northover5cc3dc82012-12-07 16:50:23 +00001//===- lib/MC/ARMELFStreamer.cpp - ELF Object Output for ARM --------------===//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9//
10// This file assembles .s files and emits ARM ELF .o object files. Different
11// from generic ELF streamer in emitting mapping symbols ($a, $t and $d) to
12// delimit regions of data and code.
13//
14//===----------------------------------------------------------------------===//
15
Logan Chiend8bb4b72013-04-16 12:02:21 +000016#include "ARMRegisterInfo.h"
Logan Chien2bcc42c2013-01-30 15:39:04 +000017#include "ARMUnwindOp.h"
Logan Chiend8bb4b72013-04-16 12:02:21 +000018#include "ARMUnwindOpAsm.h"
Tim Northover5cc3dc82012-12-07 16:50:23 +000019#include "llvm/ADT/SmallPtrSet.h"
Benjamin Kramerf242d8c2012-12-08 10:45:24 +000020#include "llvm/ADT/Twine.h"
21#include "llvm/MC/MCAsmBackend.h"
Tim Northover5cc3dc82012-12-07 16:50:23 +000022#include "llvm/MC/MCAssembler.h"
23#include "llvm/MC/MCCodeEmitter.h"
24#include "llvm/MC/MCContext.h"
Tim Northover5cc3dc82012-12-07 16:50:23 +000025#include "llvm/MC/MCELF.h"
26#include "llvm/MC/MCELFStreamer.h"
27#include "llvm/MC/MCELFSymbolFlags.h"
28#include "llvm/MC/MCExpr.h"
29#include "llvm/MC/MCInst.h"
30#include "llvm/MC/MCObjectStreamer.h"
Logan Chiend8bb4b72013-04-16 12:02:21 +000031#include "llvm/MC/MCRegisterInfo.h"
Tim Northover5cc3dc82012-12-07 16:50:23 +000032#include "llvm/MC/MCSection.h"
Benjamin Kramerf242d8c2012-12-08 10:45:24 +000033#include "llvm/MC/MCSectionELF.h"
34#include "llvm/MC/MCStreamer.h"
Tim Northover5cc3dc82012-12-07 16:50:23 +000035#include "llvm/MC/MCSymbol.h"
36#include "llvm/MC/MCValue.h"
Tim Northover5cc3dc82012-12-07 16:50:23 +000037#include "llvm/Support/Debug.h"
38#include "llvm/Support/ELF.h"
Tim Northover5cc3dc82012-12-07 16:50:23 +000039#include "llvm/Support/raw_ostream.h"
40
41using namespace llvm;
42
Logan Chiend8bb4b72013-04-16 12:02:21 +000043static std::string GetAEABIUnwindPersonalityName(unsigned Index) {
44 assert(Index < NUM_PERSONALITY_INDEX && "Invalid personality index");
45 return (Twine("__aeabi_unwind_cpp_pr") + Twine(Index)).str();
46}
47
Tim Northover5cc3dc82012-12-07 16:50:23 +000048namespace {
49
50/// Extend the generic ELFStreamer class so that it can emit mapping symbols at
51/// the appropriate points in the object files. These symbols are defined in the
52/// ARM ELF ABI: infocenter.arm.com/help/topic/com.arm.../IHI0044D_aaelf.pdf.
53///
54/// In brief: $a, $t or $d should be emitted at the start of each contiguous
55/// region of ARM code, Thumb code or data in a section. In practice, this
56/// emission does not rely on explicit assembler directives but on inherent
57/// properties of the directives doing the emission (e.g. ".byte" is data, "add
58/// r0, r0, r0" an instruction).
59///
60/// As a result this system is orthogonal to the DataRegion infrastructure used
61/// by MachO. Beware!
62class ARMELFStreamer : public MCELFStreamer {
63public:
Chandler Carruthde093ef2013-01-31 23:29:57 +000064 ARMELFStreamer(MCContext &Context, MCAsmBackend &TAB, raw_ostream &OS,
65 MCCodeEmitter *Emitter, bool IsThumb)
66 : MCELFStreamer(SK_ARMELFStreamer, Context, TAB, OS, Emitter),
Logan Chiend8bb4b72013-04-16 12:02:21 +000067 IsThumb(IsThumb), MappingSymbolCounter(0), LastEMS(EMS_None) {
68 Reset();
69 }
Tim Northover5cc3dc82012-12-07 16:50:23 +000070
71 ~ARMELFStreamer() {}
72
Logan Chien2bcc42c2013-01-30 15:39:04 +000073 // ARM exception handling directives
74 virtual void EmitFnStart();
75 virtual void EmitFnEnd();
76 virtual void EmitCantUnwind();
77 virtual void EmitPersonality(const MCSymbol *Per);
78 virtual void EmitHandlerData();
79 virtual void EmitSetFP(unsigned NewFpReg,
80 unsigned NewSpReg,
81 int64_t Offset = 0);
82 virtual void EmitPad(int64_t Offset);
83 virtual void EmitRegSave(const SmallVectorImpl<unsigned> &RegList,
84 bool isVector);
85
Peter Collingbourne2f495b92013-04-17 21:18:16 +000086 virtual void ChangeSection(const MCSection *Section,
87 const MCExpr *Subsection) {
Tim Northover5cc3dc82012-12-07 16:50:23 +000088 // We have to keep track of the mapping symbol state of any sections we
89 // use. Each one should start off as EMS_None, which is provided as the
90 // default constructor by DenseMap::lookup.
Peter Collingbourne2f495b92013-04-17 21:18:16 +000091 LastMappingSymbols[getPreviousSection().first] = LastEMS;
Tim Northover5cc3dc82012-12-07 16:50:23 +000092 LastEMS = LastMappingSymbols.lookup(Section);
93
Peter Collingbourne2f495b92013-04-17 21:18:16 +000094 MCELFStreamer::ChangeSection(Section, Subsection);
Tim Northover5cc3dc82012-12-07 16:50:23 +000095 }
96
97 /// This function is the one used to emit instruction data into the ELF
98 /// streamer. We override it to add the appropriate mapping symbol if
99 /// necessary.
100 virtual void EmitInstruction(const MCInst& Inst) {
101 if (IsThumb)
102 EmitThumbMappingSymbol();
103 else
104 EmitARMMappingSymbol();
105
106 MCELFStreamer::EmitInstruction(Inst);
107 }
108
109 /// This is one of the functions used to emit data into an ELF section, so the
110 /// ARM streamer overrides it to add the appropriate mapping symbol ($d) if
111 /// necessary.
112 virtual void EmitBytes(StringRef Data, unsigned AddrSpace) {
113 EmitDataMappingSymbol();
114 MCELFStreamer::EmitBytes(Data, AddrSpace);
115 }
116
117 /// This is one of the functions used to emit data into an ELF section, so the
118 /// ARM streamer overrides it to add the appropriate mapping symbol ($d) if
119 /// necessary.
120 virtual void EmitValueImpl(const MCExpr *Value, unsigned Size,
121 unsigned AddrSpace) {
122 EmitDataMappingSymbol();
123 MCELFStreamer::EmitValueImpl(Value, Size, AddrSpace);
124 }
125
126 virtual void EmitAssemblerFlag(MCAssemblerFlag Flag) {
127 MCELFStreamer::EmitAssemblerFlag(Flag);
128
129 switch (Flag) {
130 case MCAF_SyntaxUnified:
131 return; // no-op here.
132 case MCAF_Code16:
133 IsThumb = true;
134 return; // Change to Thumb mode
135 case MCAF_Code32:
136 IsThumb = false;
137 return; // Change to ARM mode
138 case MCAF_Code64:
139 return;
140 case MCAF_SubsectionsViaSymbols:
141 return;
142 }
143 }
144
Chandler Carruthde093ef2013-01-31 23:29:57 +0000145 static bool classof(const MCStreamer *S) {
146 return S->getKind() == SK_ARMELFStreamer;
147 }
148
Tim Northover5cc3dc82012-12-07 16:50:23 +0000149private:
150 enum ElfMappingSymbol {
151 EMS_None,
152 EMS_ARM,
153 EMS_Thumb,
154 EMS_Data
155 };
156
157 void EmitDataMappingSymbol() {
158 if (LastEMS == EMS_Data) return;
159 EmitMappingSymbol("$d");
160 LastEMS = EMS_Data;
161 }
162
163 void EmitThumbMappingSymbol() {
164 if (LastEMS == EMS_Thumb) return;
165 EmitMappingSymbol("$t");
166 LastEMS = EMS_Thumb;
167 }
168
169 void EmitARMMappingSymbol() {
170 if (LastEMS == EMS_ARM) return;
171 EmitMappingSymbol("$a");
172 LastEMS = EMS_ARM;
173 }
174
175 void EmitMappingSymbol(StringRef Name) {
176 MCSymbol *Start = getContext().CreateTempSymbol();
177 EmitLabel(Start);
178
Chandler Carruth1d94e932012-12-08 03:10:14 +0000179 MCSymbol *Symbol =
Benjamin Kramerf242d8c2012-12-08 10:45:24 +0000180 getContext().GetOrCreateSymbol(Name + "." +
181 Twine(MappingSymbolCounter++));
Tim Northover5cc3dc82012-12-07 16:50:23 +0000182
183 MCSymbolData &SD = getAssembler().getOrCreateSymbolData(*Symbol);
184 MCELF::SetType(SD, ELF::STT_NOTYPE);
185 MCELF::SetBinding(SD, ELF::STB_LOCAL);
186 SD.setExternal(false);
Peter Collingbourne2f495b92013-04-17 21:18:16 +0000187 Symbol->setSection(*getCurrentSection().first);
Tim Northover5cc3dc82012-12-07 16:50:23 +0000188
189 const MCExpr *Value = MCSymbolRefExpr::Create(Start, getContext());
190 Symbol->setVariableValue(Value);
191 }
192
193 void EmitThumbFunc(MCSymbol *Func) {
194 // FIXME: Anything needed here to flag the function as thumb?
195
196 getAssembler().setIsThumbFunc(Func);
197
198 MCSymbolData &SD = getAssembler().getOrCreateSymbolData(*Func);
199 SD.setFlags(SD.getFlags() | ELF_Other_ThumbFunc);
200 }
201
Logan Chien2bcc42c2013-01-30 15:39:04 +0000202 // Helper functions for ARM exception handling directives
203 void Reset();
204
205 void EmitPersonalityFixup(StringRef Name);
Logan Chiend8bb4b72013-04-16 12:02:21 +0000206 void CollectUnwindOpcodes();
Logan Chien2bcc42c2013-01-30 15:39:04 +0000207
208 void SwitchToEHSection(const char *Prefix, unsigned Type, unsigned Flags,
209 SectionKind Kind, const MCSymbol &Fn);
210 void SwitchToExTabSection(const MCSymbol &FnStart);
211 void SwitchToExIdxSection(const MCSymbol &FnStart);
Tim Northover5cc3dc82012-12-07 16:50:23 +0000212
213 bool IsThumb;
214 int64_t MappingSymbolCounter;
215
216 DenseMap<const MCSection *, ElfMappingSymbol> LastMappingSymbols;
217 ElfMappingSymbol LastEMS;
218
Logan Chien2bcc42c2013-01-30 15:39:04 +0000219 // ARM Exception Handling Frame Information
220 MCSymbol *ExTab;
221 MCSymbol *FnStart;
222 const MCSymbol *Personality;
Logan Chiend8bb4b72013-04-16 12:02:21 +0000223 uint32_t VFPRegSave; // Register mask for {d31-d0}
224 uint32_t RegSave; // Register mask for {r15-r0}
225 int64_t SPOffset;
226 uint16_t FPReg;
227 int64_t FPOffset;
228 bool UsedFP;
Logan Chien2bcc42c2013-01-30 15:39:04 +0000229 bool CantUnwind;
Logan Chiend8bb4b72013-04-16 12:02:21 +0000230 UnwindOpcodeAssembler UnwindOpAsm;
Tim Northover5cc3dc82012-12-07 16:50:23 +0000231};
Logan Chiend8bb4b72013-04-16 12:02:21 +0000232} // end anonymous namespace
Tim Northover5cc3dc82012-12-07 16:50:23 +0000233
Logan Chien2bcc42c2013-01-30 15:39:04 +0000234inline void ARMELFStreamer::SwitchToEHSection(const char *Prefix,
235 unsigned Type,
236 unsigned Flags,
237 SectionKind Kind,
238 const MCSymbol &Fn) {
239 const MCSectionELF &FnSection =
240 static_cast<const MCSectionELF &>(Fn.getSection());
241
242 // Create the name for new section
243 StringRef FnSecName(FnSection.getSectionName());
244 SmallString<128> EHSecName(Prefix);
245 if (FnSecName != ".text") {
246 EHSecName += FnSecName;
247 }
248
249 // Get .ARM.extab or .ARM.exidx section
250 const MCSectionELF *EHSection = NULL;
251 if (const MCSymbol *Group = FnSection.getGroup()) {
252 EHSection = getContext().getELFSection(
253 EHSecName, Type, Flags | ELF::SHF_GROUP, Kind,
254 FnSection.getEntrySize(), Group->getName());
255 } else {
256 EHSection = getContext().getELFSection(EHSecName, Type, Flags, Kind);
257 }
Logan Chiend8bb4b72013-04-16 12:02:21 +0000258 assert(EHSection && "Failed to get the required EH section");
Logan Chien2bcc42c2013-01-30 15:39:04 +0000259
260 // Switch to .ARM.extab or .ARM.exidx section
261 SwitchSection(EHSection);
262 EmitCodeAlignment(4, 0);
263}
264
265inline void ARMELFStreamer::SwitchToExTabSection(const MCSymbol &FnStart) {
266 SwitchToEHSection(".ARM.extab",
267 ELF::SHT_PROGBITS,
268 ELF::SHF_ALLOC,
269 SectionKind::getDataRel(),
270 FnStart);
271}
272
273inline void ARMELFStreamer::SwitchToExIdxSection(const MCSymbol &FnStart) {
274 SwitchToEHSection(".ARM.exidx",
275 ELF::SHT_ARM_EXIDX,
276 ELF::SHF_ALLOC | ELF::SHF_LINK_ORDER,
277 SectionKind::getDataRel(),
278 FnStart);
279}
280
281void ARMELFStreamer::Reset() {
Logan Chiend8bb4b72013-04-16 12:02:21 +0000282 const MCRegisterInfo &MRI = getContext().getRegisterInfo();
283
Logan Chien2bcc42c2013-01-30 15:39:04 +0000284 ExTab = NULL;
285 FnStart = NULL;
286 Personality = NULL;
Logan Chiend8bb4b72013-04-16 12:02:21 +0000287 VFPRegSave = 0;
288 RegSave = 0;
289 FPReg = MRI.getEncodingValue(ARM::SP);
290 FPOffset = 0;
291 SPOffset = 0;
292 UsedFP = false;
Logan Chien2bcc42c2013-01-30 15:39:04 +0000293 CantUnwind = false;
Logan Chiend8bb4b72013-04-16 12:02:21 +0000294
295 UnwindOpAsm.Reset();
Logan Chien2bcc42c2013-01-30 15:39:04 +0000296}
297
298// Add the R_ARM_NONE fixup at the same position
299void ARMELFStreamer::EmitPersonalityFixup(StringRef Name) {
300 const MCSymbol *PersonalitySym = getContext().GetOrCreateSymbol(Name);
301
302 const MCSymbolRefExpr *PersonalityRef =
303 MCSymbolRefExpr::Create(PersonalitySym,
304 MCSymbolRefExpr::VK_ARM_NONE,
305 getContext());
306
307 AddValueSymbols(PersonalityRef);
308 MCDataFragment *DF = getOrCreateDataFragment();
309 DF->getFixups().push_back(
310 MCFixup::Create(DF->getContents().size(), PersonalityRef,
311 MCFixup::getKindForSize(4, false)));
312}
313
Logan Chiend8bb4b72013-04-16 12:02:21 +0000314void ARMELFStreamer::CollectUnwindOpcodes() {
315 if (UsedFP) {
316 UnwindOpAsm.EmitSetFP(FPReg);
317 UnwindOpAsm.EmitSPOffset(-FPOffset);
318 } else {
319 UnwindOpAsm.EmitSPOffset(SPOffset);
320 }
321 UnwindOpAsm.EmitVFPRegSave(VFPRegSave);
322 UnwindOpAsm.EmitRegSave(RegSave);
323 UnwindOpAsm.Finalize();
324}
325
Logan Chien2bcc42c2013-01-30 15:39:04 +0000326void ARMELFStreamer::EmitFnStart() {
327 assert(FnStart == 0);
328 FnStart = getContext().CreateTempSymbol();
329 EmitLabel(FnStart);
330}
331
332void ARMELFStreamer::EmitFnEnd() {
333 assert(FnStart && ".fnstart must preceeds .fnend");
334
335 // Emit unwind opcodes if there is no .handlerdata directive
Logan Chien2bcc42c2013-01-30 15:39:04 +0000336 if (!ExTab && !CantUnwind) {
Logan Chiend8bb4b72013-04-16 12:02:21 +0000337 CollectUnwindOpcodes();
Logan Chien2bcc42c2013-01-30 15:39:04 +0000338
Logan Chiend8bb4b72013-04-16 12:02:21 +0000339 unsigned PersonalityIndex = UnwindOpAsm.getPersonalityIndex();
340 if (PersonalityIndex == AEABI_UNWIND_CPP_PR1 ||
341 PersonalityIndex == AEABI_UNWIND_CPP_PR2) {
342 // For the __aeabi_unwind_cpp_pr1 and __aeabi_unwind_cpp_pr2, we have to
343 // emit the unwind opcodes in the corresponding ".ARM.extab" section, and
344 // then emit a reference to these unwind opcodes in the second word of
345 // the exception index table entry.
346 SwitchToExTabSection(*FnStart);
347 ExTab = getContext().CreateTempSymbol();
348 EmitLabel(ExTab);
349 EmitBytes(UnwindOpAsm.data(), 0);
350 }
Logan Chien2bcc42c2013-01-30 15:39:04 +0000351 }
352
353 // Emit the exception index table entry
354 SwitchToExIdxSection(*FnStart);
355
Logan Chiend8bb4b72013-04-16 12:02:21 +0000356 unsigned PersonalityIndex = UnwindOpAsm.getPersonalityIndex();
357 if (PersonalityIndex < NUM_PERSONALITY_INDEX)
358 EmitPersonalityFixup(GetAEABIUnwindPersonalityName(PersonalityIndex));
Logan Chien2bcc42c2013-01-30 15:39:04 +0000359
360 const MCSymbolRefExpr *FnStartRef =
361 MCSymbolRefExpr::Create(FnStart,
362 MCSymbolRefExpr::VK_ARM_PREL31,
363 getContext());
364
365 EmitValue(FnStartRef, 4, 0);
366
367 if (CantUnwind) {
368 EmitIntValue(EXIDX_CANTUNWIND, 4, 0);
Logan Chiend8bb4b72013-04-16 12:02:21 +0000369 } else if (ExTab) {
370 // Emit a reference to the unwind opcodes in the ".ARM.extab" section.
Logan Chien2bcc42c2013-01-30 15:39:04 +0000371 const MCSymbolRefExpr *ExTabEntryRef =
372 MCSymbolRefExpr::Create(ExTab,
373 MCSymbolRefExpr::VK_ARM_PREL31,
374 getContext());
375 EmitValue(ExTabEntryRef, 4, 0);
Logan Chiend8bb4b72013-04-16 12:02:21 +0000376 } else {
377 // For the __aeabi_unwind_cpp_pr0, we have to emit the unwind opcodes in
378 // the second word of exception index table entry. The size of the unwind
379 // opcodes should always be 4 bytes.
380 assert(PersonalityIndex == AEABI_UNWIND_CPP_PR0 &&
381 "Compact model must use __aeabi_cpp_unwind_pr0 as personality");
382 assert(UnwindOpAsm.size() == 4u &&
383 "Unwind opcode size for __aeabi_cpp_unwind_pr0 must be equal to 4");
384 EmitBytes(UnwindOpAsm.data(), 0);
Logan Chien2bcc42c2013-01-30 15:39:04 +0000385 }
386
387 // Clean exception handling frame information
388 Reset();
389}
390
391void ARMELFStreamer::EmitCantUnwind() {
392 CantUnwind = true;
393}
394
395void ARMELFStreamer::EmitHandlerData() {
396 SwitchToExTabSection(*FnStart);
397
398 // Create .ARM.extab label for offset in .ARM.exidx
399 assert(!ExTab);
400 ExTab = getContext().CreateTempSymbol();
401 EmitLabel(ExTab);
402
403 // Emit Personality
404 assert(Personality && ".personality directive must preceed .handlerdata");
405
406 const MCSymbolRefExpr *PersonalityRef =
407 MCSymbolRefExpr::Create(Personality,
408 MCSymbolRefExpr::VK_ARM_PREL31,
409 getContext());
410
411 EmitValue(PersonalityRef, 4, 0);
412
413 // Emit unwind opcodes
Logan Chiend8bb4b72013-04-16 12:02:21 +0000414 CollectUnwindOpcodes();
415 EmitBytes(UnwindOpAsm.data(), 0);
Logan Chien2bcc42c2013-01-30 15:39:04 +0000416}
417
418void ARMELFStreamer::EmitPersonality(const MCSymbol *Per) {
419 Personality = Per;
Logan Chiend8bb4b72013-04-16 12:02:21 +0000420 UnwindOpAsm.setPersonality(Per);
Logan Chien2bcc42c2013-01-30 15:39:04 +0000421}
422
Logan Chiend8bb4b72013-04-16 12:02:21 +0000423void ARMELFStreamer::EmitSetFP(unsigned NewFPReg,
424 unsigned NewSPReg,
Logan Chien2bcc42c2013-01-30 15:39:04 +0000425 int64_t Offset) {
Logan Chiend8bb4b72013-04-16 12:02:21 +0000426 assert(SPOffset == 0 &&
427 "Current implementation assumes .setfp precedes .pad");
428
429 const MCRegisterInfo &MRI = getContext().getRegisterInfo();
430
431 uint16_t NewFPRegEncVal = MRI.getEncodingValue(NewFPReg);
Logan Chien3d134eb2013-04-16 14:02:30 +0000432#ifndef NDEBUG
Logan Chiend8bb4b72013-04-16 12:02:21 +0000433 uint16_t NewSPRegEncVal = MRI.getEncodingValue(NewSPReg);
Logan Chien3d134eb2013-04-16 14:02:30 +0000434#endif
Logan Chiend8bb4b72013-04-16 12:02:21 +0000435
436 assert((NewSPReg == ARM::SP || NewSPRegEncVal == FPReg) &&
437 "the operand of .setfp directive should be either $sp or $fp");
438
439 UsedFP = true;
440 FPReg = NewFPRegEncVal;
441 FPOffset = Offset;
Logan Chien2bcc42c2013-01-30 15:39:04 +0000442}
443
444void ARMELFStreamer::EmitPad(int64_t Offset) {
Logan Chiend8bb4b72013-04-16 12:02:21 +0000445 SPOffset += Offset;
Logan Chien2bcc42c2013-01-30 15:39:04 +0000446}
447
448void ARMELFStreamer::EmitRegSave(const SmallVectorImpl<unsigned> &RegList,
449 bool IsVector) {
Logan Chiend8bb4b72013-04-16 12:02:21 +0000450 const MCRegisterInfo &MRI = getContext().getRegisterInfo();
451
Logan Chien3d134eb2013-04-16 14:02:30 +0000452#ifndef NDEBUG
Logan Chiend8bb4b72013-04-16 12:02:21 +0000453 unsigned Max = IsVector ? 32 : 16;
Logan Chien3d134eb2013-04-16 14:02:30 +0000454#endif
Logan Chiend8bb4b72013-04-16 12:02:21 +0000455 uint32_t &RegMask = IsVector ? VFPRegSave : RegSave;
456
457 for (size_t i = 0; i < RegList.size(); ++i) {
458 unsigned Reg = MRI.getEncodingValue(RegList[i]);
459 assert(Reg < Max && "Register encoded value out of range");
460 RegMask |= 1u << Reg;
461 }
Logan Chien2bcc42c2013-01-30 15:39:04 +0000462}
463
Tim Northover5cc3dc82012-12-07 16:50:23 +0000464namespace llvm {
465 MCELFStreamer* createARMELFStreamer(MCContext &Context, MCAsmBackend &TAB,
466 raw_ostream &OS, MCCodeEmitter *Emitter,
467 bool RelaxAll, bool NoExecStack,
468 bool IsThumb) {
469 ARMELFStreamer *S = new ARMELFStreamer(Context, TAB, OS, Emitter, IsThumb);
470 if (RelaxAll)
471 S->getAssembler().setRelaxAll(true);
472 if (NoExecStack)
473 S->getAssembler().setNoExecStack(true);
474 return S;
475 }
476
477}
478
479