DataSection(".data"),
AddressSize(4),
NeedsSet(false),
+ MaxInstLength(4),
+ SeparatorChar(';'),
CommentString("#"),
GlobalPrefix(""),
PrivateGlobalPrefix("."),
SectionEndDirectiveSuffix(0),
ConstantPoolSection("\t.section .rodata\n"),
JumpTableDataSection("\t.section .rodata\n"),
- JumpTableTextSection("\t.text\n"),
JumpTableDirective(0),
+ CStringSection(0),
StaticCtorsSection("\t.section .ctors,\"aw\",@progbits"),
StaticDtorsSection("\t.section .dtors,\"aw\",@progbits"),
FourByteConstantSection(0),
COMMDirective("\t.comm\t"),
COMMDirectiveTakesAlignment(true),
HasDotTypeDotSizeDirective(true),
+ UsedDirective(0),
HasLEB128(false),
HasDotLoc(false),
HasDotFile(false),
+ DwarfRequiresFrameSection(true),
DwarfAbbrevSection(".debug_abbrev"),
DwarfInfoSection(".debug_info"),
DwarfLineSection(".debug_line"),
DwarfLocSection(".debug_loc"),
DwarfARangesSection(".debug_aranges"),
DwarfRangesSection(".debug_ranges"),
- DwarfMacInfoSection(".debug_macinfo")
-{}
+ DwarfMacInfoSection(".debug_macinfo") {
+}
+
+TargetAsmInfo::~TargetAsmInfo() {
+}
+
+/// Measure the specified inline asm to determine an approximation of its
+/// length.
+unsigned TargetAsmInfo::getInlineAsmLength(const char *Str) const {
+ // Count the number of instructions in the asm.
+ unsigned NumInsts = 0;
+ for (; *Str; ++Str) {
+ if (*Str == '\n' || *Str == SeparatorChar)
+ ++NumInsts;
+ }
+
+ // Multiply by the worst-case length for each instruction.
+ return NumInsts * MaxInstLength;
+}