Dale Johannesen | 67cf561 | 2007-05-02 01:02:40 +0000 | [diff] [blame] | 1 | |
Jim Laskey | 8e8de8f | 2006-09-07 22:05:02 +0000 | [diff] [blame] | 2 | //===-- ARMTargetAsmInfo.cpp - ARM asm properties ---------------*- C++ -*-===// |
| 3 | // |
| 4 | // The LLVM Compiler Infrastructure |
| 5 | // |
| 6 | // This file was developed by James M. Laskey and is distributed under the |
| 7 | // University of Illinois Open Source License. See LICENSE.TXT for details. |
| 8 | // |
| 9 | //===----------------------------------------------------------------------===// |
| 10 | // |
| 11 | // This file contains the declarations of the ARMTargetAsmInfo properties. |
| 12 | // |
| 13 | //===----------------------------------------------------------------------===// |
| 14 | |
| 15 | #include "ARMTargetAsmInfo.h" |
Evan Cheng | a8e2989 | 2007-01-19 07:51:42 +0000 | [diff] [blame] | 16 | #include "ARMTargetMachine.h" |
Dale Johannesen | 24fb52d | 2007-04-23 20:04:35 +0000 | [diff] [blame] | 17 | #include <cstring> |
| 18 | #include <cctype> |
Jim Laskey | 8e8de8f | 2006-09-07 22:05:02 +0000 | [diff] [blame] | 19 | using namespace llvm; |
| 20 | |
Lauro Ramos Venancio | 61718a6 | 2007-06-08 21:06:23 +0000 | [diff] [blame] | 21 | static const char* arm_asm_table[] = {"{r0}", "r0", |
| 22 | "{r1}", "r1", |
| 23 | "{r2}", "r2", |
| 24 | "{r3}", "r3", |
| 25 | "{r4}", "r4", |
| 26 | "{r5}", "r5", |
| 27 | "{r6}", "r6", |
| 28 | "{r7}", "r7", |
| 29 | "{r8}", "r8", |
| 30 | "{r9}", "r9", |
| 31 | "{r10}", "r10", |
| 32 | "{r11}", "r11", |
| 33 | "{r12}", "r12", |
| 34 | "{r13}", "r13", |
| 35 | "{r14}", "r14", |
| 36 | "{lr}", "lr", |
| 37 | "{sp}", "sp", |
| 38 | "{ip}", "ip", |
| 39 | "{fp}", "fp", |
| 40 | "{sl}", "sl", |
| 41 | "{memory}", "memory", |
| 42 | "{cc}", "cc", |
| 43 | 0,0}; |
| 44 | |
Jim Laskey | 8e8de8f | 2006-09-07 22:05:02 +0000 | [diff] [blame] | 45 | ARMTargetAsmInfo::ARMTargetAsmInfo(const ARMTargetMachine &TM) { |
Dale Johannesen | 67cf561 | 2007-05-02 01:02:40 +0000 | [diff] [blame] | 46 | Subtarget = &TM.getSubtarget<ARMSubtarget>(); |
Lauro Ramos Venancio | 61718a6 | 2007-06-08 21:06:23 +0000 | [diff] [blame] | 47 | AsmTransCBE = arm_asm_table; |
Evan Cheng | e433ea9 | 2007-01-19 19:23:47 +0000 | [diff] [blame] | 48 | if (Subtarget->isTargetDarwin()) { |
Evan Cheng | a8e2989 | 2007-01-19 07:51:42 +0000 | [diff] [blame] | 49 | GlobalPrefix = "_"; |
Evan Cheng | e433ea9 | 2007-01-19 19:23:47 +0000 | [diff] [blame] | 50 | PrivateGlobalPrefix = "L"; |
| 51 | BSSSection = 0; // no BSS section. |
| 52 | ZeroFillDirective = "\t.zerofill\t"; // Uses .zerofill |
Evan Cheng | a8e2989 | 2007-01-19 07:51:42 +0000 | [diff] [blame] | 53 | SetDirective = "\t.set"; |
| 54 | WeakRefDirective = "\t.weak_reference\t"; |
Evan Cheng | a6f567c | 2007-01-23 19:06:03 +0000 | [diff] [blame] | 55 | HiddenDirective = "\t.private_extern\t"; |
Lauro Ramos Venancio | 0a18173 | 2007-04-30 00:23:51 +0000 | [diff] [blame] | 56 | ProtectedDirective = NULL; |
Evan Cheng | a8e2989 | 2007-01-19 07:51:42 +0000 | [diff] [blame] | 57 | JumpTableDataSection = ".const"; |
| 58 | CStringSection = "\t.cstring"; |
Evan Cheng | 98ded76 | 2007-03-08 01:25:25 +0000 | [diff] [blame] | 59 | FourByteConstantSection = "\t.literal4\n"; |
| 60 | EightByteConstantSection = "\t.literal8\n"; |
| 61 | ReadOnlySection = "\t.const\n"; |
Evan Cheng | e433ea9 | 2007-01-19 19:23:47 +0000 | [diff] [blame] | 62 | HasDotTypeDotSizeDirective = false; |
Bill Wendling | fe4afb1 | 2007-09-11 23:55:40 +0000 | [diff] [blame] | 63 | NeedsIndirectEncoding = true; |
Evan Cheng | b267ca1 | 2007-01-30 08:04:53 +0000 | [diff] [blame] | 64 | if (TM.getRelocationModel() == Reloc::Static) { |
| 65 | StaticCtorsSection = ".constructor"; |
| 66 | StaticDtorsSection = ".destructor"; |
| 67 | } else { |
| 68 | StaticCtorsSection = ".mod_init_func"; |
| 69 | StaticDtorsSection = ".mod_term_func"; |
| 70 | } |
Evan Cheng | a8e2989 | 2007-01-19 07:51:42 +0000 | [diff] [blame] | 71 | |
Evan Cheng | 8e1185b | 2007-01-19 18:59:56 +0000 | [diff] [blame] | 72 | // In non-PIC modes, emit a special label before jump tables so that the |
| 73 | // linker can perform more accurate dead code stripping. |
| 74 | if (TM.getRelocationModel() != Reloc::PIC_) { |
| 75 | // Emit a local label that is preserved until the linker runs. |
| 76 | JumpTableSpecialLabelPrefix = "l"; |
| 77 | } |
| 78 | |
Evan Cheng | a8e2989 | 2007-01-19 07:51:42 +0000 | [diff] [blame] | 79 | NeedsSet = true; |
| 80 | DwarfAbbrevSection = ".section __DWARF,__debug_abbrev,regular,debug"; |
| 81 | DwarfInfoSection = ".section __DWARF,__debug_info,regular,debug"; |
| 82 | DwarfLineSection = ".section __DWARF,__debug_line,regular,debug"; |
| 83 | DwarfFrameSection = ".section __DWARF,__debug_frame,regular,debug"; |
| 84 | DwarfPubNamesSection = ".section __DWARF,__debug_pubnames,regular,debug"; |
| 85 | DwarfPubTypesSection = ".section __DWARF,__debug_pubtypes,regular,debug"; |
| 86 | DwarfStrSection = ".section __DWARF,__debug_str,regular,debug"; |
| 87 | DwarfLocSection = ".section __DWARF,__debug_loc,regular,debug"; |
| 88 | DwarfARangesSection = ".section __DWARF,__debug_aranges,regular,debug"; |
| 89 | DwarfRangesSection = ".section __DWARF,__debug_ranges,regular,debug"; |
| 90 | DwarfMacInfoSection = ".section __DWARF,__debug_macinfo,regular,debug"; |
| 91 | } else { |
Lauro Ramos Venancio | e8e5495 | 2007-05-03 20:28:35 +0000 | [diff] [blame] | 92 | NeedsSet = false; |
| 93 | HasLEB128 = true; |
| 94 | AbsoluteDebugSectionOffsets = true; |
| 95 | ReadOnlySection = "\t.section\t.rodata\n"; |
Lauro Ramos Venancio | c33f674 | 2007-02-01 21:43:53 +0000 | [diff] [blame] | 96 | PrivateGlobalPrefix = ".L"; |
Evan Cheng | a8e2989 | 2007-01-19 07:51:42 +0000 | [diff] [blame] | 97 | WeakRefDirective = "\t.weak\t"; |
Lauro Ramos Venancio | 69642f1 | 2007-05-14 18:32:56 +0000 | [diff] [blame] | 98 | SetDirective = "\t.set\t"; |
Lauro Ramos Venancio | e8e5495 | 2007-05-03 20:28:35 +0000 | [diff] [blame] | 99 | DwarfRequiresFrameSection = false; |
| 100 | DwarfAbbrevSection = "\t.section\t.debug_abbrev,\"\",%progbits"; |
| 101 | DwarfInfoSection = "\t.section\t.debug_info,\"\",%progbits"; |
| 102 | DwarfLineSection = "\t.section\t.debug_line,\"\",%progbits"; |
| 103 | DwarfFrameSection = "\t.section\t.debug_frame,\"\",%progbits"; |
| 104 | DwarfPubNamesSection ="\t.section\t.debug_pubnames,\"\",%progbits"; |
| 105 | DwarfPubTypesSection ="\t.section\t.debug_pubtypes,\"\",%progbits"; |
| 106 | DwarfStrSection = "\t.section\t.debug_str,\"\",%progbits"; |
| 107 | DwarfLocSection = "\t.section\t.debug_loc,\"\",%progbits"; |
| 108 | DwarfARangesSection = "\t.section\t.debug_aranges,\"\",%progbits"; |
| 109 | DwarfRangesSection = "\t.section\t.debug_ranges,\"\",%progbits"; |
| 110 | DwarfMacInfoSection = "\t.section\t.debug_macinfo,\"\",%progbits"; |
| 111 | |
Lauro Ramos Venancio | 6d7dd8e | 2007-03-05 17:59:58 +0000 | [diff] [blame] | 112 | if (Subtarget->isAAPCS_ABI()) { |
| 113 | StaticCtorsSection = "\t.section .init_array,\"aw\",%init_array"; |
| 114 | StaticDtorsSection = "\t.section .fini_array,\"aw\",%fini_array"; |
| 115 | } else { |
| 116 | StaticCtorsSection = "\t.section .ctors,\"aw\",%progbits"; |
| 117 | StaticDtorsSection = "\t.section .dtors,\"aw\",%progbits"; |
| 118 | } |
Lauro Ramos Venancio | 64f4fa5 | 2007-04-27 13:54:47 +0000 | [diff] [blame] | 119 | TLSDataSection = "\t.section .tdata,\"awT\",%progbits"; |
| 120 | TLSBSSSection = "\t.section .tbss,\"awT\",%nobits"; |
Evan Cheng | a8e2989 | 2007-01-19 07:51:42 +0000 | [diff] [blame] | 121 | } |
Lauro Ramos Venancio | ea9fc58 | 2007-01-26 23:24:43 +0000 | [diff] [blame] | 122 | |
| 123 | ZeroDirective = "\t.space\t"; |
| 124 | AlignmentIsInBytes = false; |
Jim Laskey | 8e8de8f | 2006-09-07 22:05:02 +0000 | [diff] [blame] | 125 | Data64bitsDirective = 0; |
Jim Laskey | 8e8de8f | 2006-09-07 22:05:02 +0000 | [diff] [blame] | 126 | CommentString = "@"; |
Evan Cheng | a8e2989 | 2007-01-19 07:51:42 +0000 | [diff] [blame] | 127 | DataSection = "\t.data"; |
Jim Laskey | 8e8de8f | 2006-09-07 22:05:02 +0000 | [diff] [blame] | 128 | ConstantPoolSection = "\t.text\n"; |
Lauro Ramos Venancio | ea9fc58 | 2007-01-26 23:24:43 +0000 | [diff] [blame] | 129 | COMMDirectiveTakesAlignment = false; |
| 130 | InlineAsmStart = "@ InlineAsm Start"; |
| 131 | InlineAsmEnd = "@ InlineAsm End"; |
| 132 | LCOMMDirective = "\t.lcomm\t"; |
Dale Johannesen | 67cf561 | 2007-05-02 01:02:40 +0000 | [diff] [blame] | 133 | } |
| 134 | |
| 135 | /// Count the number of comma-separated arguments. |
| 136 | /// Do not try to detect errors. |
| 137 | unsigned ARMTargetAsmInfo::countArguments(const char* p) const { |
| 138 | unsigned count = 0; |
| 139 | while (*p && isspace(*p) && *p != '\n') |
| 140 | p++; |
| 141 | count++; |
| 142 | while (*p && *p!='\n' && |
| 143 | strncmp(p, CommentString, strlen(CommentString))!=0) { |
| 144 | if (*p==',') |
| 145 | count++; |
| 146 | p++; |
| 147 | } |
| 148 | return count; |
| 149 | } |
| 150 | |
| 151 | /// Count the length of a string enclosed in quote characters. |
| 152 | /// Do not try to detect errors. |
| 153 | unsigned ARMTargetAsmInfo::countString(const char* p) const { |
| 154 | unsigned count = 0; |
| 155 | while (*p && isspace(*p) && *p!='\n') |
| 156 | p++; |
| 157 | if (!*p || *p != '\"') |
| 158 | return count; |
| 159 | while (*++p && *p != '\"') |
| 160 | count++; |
| 161 | return count; |
Jim Laskey | 8e8de8f | 2006-09-07 22:05:02 +0000 | [diff] [blame] | 162 | } |
Dale Johannesen | 8650199 | 2007-04-29 19:17:45 +0000 | [diff] [blame] | 163 | |
| 164 | /// ARM-specific version of TargetAsmInfo::getInlineAsmLength. |
Dale Johannesen | ca4571e | 2007-10-25 21:54:43 +0000 | [diff] [blame^] | 165 | unsigned ARMTargetAsmInfo::getInlineAsmLength(const char *s) const { |
| 166 | // Make a lowercase-folded version of s for counting purposes. |
| 167 | char *q, *s_copy = (char *)malloc(strlen(s) + 1); |
| 168 | strcpy(s_copy, s); |
| 169 | for (q=s_copy; *q; q++) |
| 170 | *q = tolower(*q); |
| 171 | const char *Str = s_copy; |
| 172 | |
Dale Johannesen | 8650199 | 2007-04-29 19:17:45 +0000 | [diff] [blame] | 173 | // Count the number of bytes in the asm. |
| 174 | bool atInsnStart = true; |
Dale Johannesen | 67cf561 | 2007-05-02 01:02:40 +0000 | [diff] [blame] | 175 | bool inTextSection = true; |
Dale Johannesen | 8650199 | 2007-04-29 19:17:45 +0000 | [diff] [blame] | 176 | unsigned Length = 0; |
| 177 | for (; *Str; ++Str) { |
| 178 | if (atInsnStart) { |
| 179 | // Skip whitespace |
| 180 | while (*Str && isspace(*Str) && *Str != '\n') |
| 181 | Str++; |
| 182 | // Skip label |
| 183 | for (const char* p = Str; *p && !isspace(*p); p++) |
| 184 | if (*p == ':') { |
| 185 | Str = p+1; |
Dale Johannesen | 67cf561 | 2007-05-02 01:02:40 +0000 | [diff] [blame] | 186 | while (*Str && isspace(*Str) && *Str != '\n') |
| 187 | Str++; |
Dale Johannesen | 8650199 | 2007-04-29 19:17:45 +0000 | [diff] [blame] | 188 | break; |
| 189 | } |
| 190 | // Ignore everything from comment char(s) to EOL |
| 191 | if (strncmp(Str, CommentString, strlen(CommentString))==-0) |
| 192 | atInsnStart = false; |
Dale Johannesen | 67cf561 | 2007-05-02 01:02:40 +0000 | [diff] [blame] | 193 | // FIXME do something like the following for non-Darwin |
| 194 | else if (*Str == '.' && Subtarget->isTargetDarwin()) { |
| 195 | // Directive. |
| 196 | atInsnStart = false; |
Dale Johannesen | ca4571e | 2007-10-25 21:54:43 +0000 | [diff] [blame^] | 197 | |
Dale Johannesen | 67cf561 | 2007-05-02 01:02:40 +0000 | [diff] [blame] | 198 | // Some change the section, but don't generate code. |
Dale Johannesen | ca4571e | 2007-10-25 21:54:43 +0000 | [diff] [blame^] | 199 | if (strncmp(Str, ".literal4", strlen(".literal4"))==0 || |
| 200 | strncmp(Str, ".literal8", strlen(".literal8"))==0 || |
| 201 | strncmp(Str, ".const", strlen(".const"))==0 || |
| 202 | strncmp(Str, ".constructor", strlen(".constructor"))==0 || |
| 203 | strncmp(Str, ".cstring", strlen(".cstring"))==0 || |
| 204 | strncmp(Str, ".data", strlen(".data"))==0 || |
| 205 | strncmp(Str, ".destructor", strlen(".destructor"))==0 || |
| 206 | strncmp(Str, ".fvmlib_init0", strlen(".fvmlib_init0"))==0 || |
| 207 | strncmp(Str, ".fvmlib_init1", strlen(".fvmlib_init1"))==0 || |
| 208 | strncmp(Str, ".mod_init_func", strlen(".mod_init_func"))==0 || |
| 209 | strncmp(Str, ".mod_term_func", strlen(".mod_term_func"))==0 || |
| 210 | strncmp(Str, ".picsymbol_stub", strlen(".picsymbol_stub"))==0 || |
| 211 | strncmp(Str, ".symbol_stub", strlen(".symbol_stub"))==0 || |
| 212 | strncmp(Str, ".static_data", strlen(".static_data"))==0 || |
| 213 | strncmp(Str, ".section", strlen(".section"))==0 || |
| 214 | strncmp(Str, ".lazy_symbol_pointer", strlen(".lazy_symbol_pointer"))==0 || |
| 215 | strncmp(Str, ".non_lazy_symbol_pointer", strlen(".non_lazy_symbol_pointer"))==0 || |
| 216 | strncmp(Str, ".dyld", strlen(".dyld"))==0 || |
| 217 | strncmp(Str, ".const_data", strlen(".const_data"))==0 || |
| 218 | strncmp(Str, ".objc", strlen(".objc"))==0 || //// many directives |
| 219 | strncmp(Str, ".static_const", strlen(".static_const"))==0) |
Dale Johannesen | 67cf561 | 2007-05-02 01:02:40 +0000 | [diff] [blame] | 220 | inTextSection=false; |
Dale Johannesen | ca4571e | 2007-10-25 21:54:43 +0000 | [diff] [blame^] | 221 | else if (strncmp(Str, ".text", strlen(".text"))==0) |
Dale Johannesen | 67cf561 | 2007-05-02 01:02:40 +0000 | [diff] [blame] | 222 | inTextSection = true; |
| 223 | // Some can't really be handled without implementing significant pieces |
| 224 | // of an assembler. Others require dynamic adjustment of block sizes in |
| 225 | // AdjustBBOffsetsAfter; it's a big compile-time speed hit to check every |
| 226 | // instruction in there, and none of these are currently used in the kernel. |
Dale Johannesen | ca4571e | 2007-10-25 21:54:43 +0000 | [diff] [blame^] | 227 | else if (strncmp(Str, ".macro", strlen(".macro"))==0 || |
| 228 | strncmp(Str, ".if", strlen(".if"))==0 || |
| 229 | strncmp(Str, ".align", strlen(".align"))==0 || |
| 230 | strncmp(Str, ".fill", strlen(".fill"))==0 || |
| 231 | strncmp(Str, ".space", strlen(".space"))==0 || |
| 232 | strncmp(Str, ".zerofill", strlen(".zerofill"))==0 || |
| 233 | strncmp(Str, ".p2align", strlen(".p2align"))==0 || |
| 234 | strncmp(Str, ".p2alignw", strlen(".p2alignw"))==0 || |
| 235 | strncmp(Str, ".p2alignl", strlen(".p2alignl"))==0 || |
| 236 | strncmp(Str, ".align32", strlen(".p2align32"))==0 || |
| 237 | strncmp(Str, ".include", strlen(".include"))==0) |
Dale Johannesen | 67cf561 | 2007-05-02 01:02:40 +0000 | [diff] [blame] | 238 | cerr << "Directive " << Str << " in asm may lead to invalid offsets for" << |
| 239 | " constant pools (the assembler will tell you if this happens).\n"; |
| 240 | // Some generate code, but this is only interesting in the text section. |
| 241 | else if (inTextSection) { |
Dale Johannesen | ca4571e | 2007-10-25 21:54:43 +0000 | [diff] [blame^] | 242 | if (strncmp(Str, ".long", strlen(".long"))==0) |
Dale Johannesen | 67cf561 | 2007-05-02 01:02:40 +0000 | [diff] [blame] | 243 | Length += 4*countArguments(Str+strlen(".long")); |
Dale Johannesen | ca4571e | 2007-10-25 21:54:43 +0000 | [diff] [blame^] | 244 | else if (strncmp(Str, ".short", strlen(".short"))==0) |
Dale Johannesen | 67cf561 | 2007-05-02 01:02:40 +0000 | [diff] [blame] | 245 | Length += 2*countArguments(Str+strlen(".short")); |
Dale Johannesen | ca4571e | 2007-10-25 21:54:43 +0000 | [diff] [blame^] | 246 | else if (strncmp(Str, ".byte", strlen(".byte"))==0) |
Dale Johannesen | 67cf561 | 2007-05-02 01:02:40 +0000 | [diff] [blame] | 247 | Length += 1*countArguments(Str+strlen(".byte")); |
Dale Johannesen | ca4571e | 2007-10-25 21:54:43 +0000 | [diff] [blame^] | 248 | else if (strncmp(Str, ".single", strlen(".single"))==0) |
Dale Johannesen | 67cf561 | 2007-05-02 01:02:40 +0000 | [diff] [blame] | 249 | Length += 4*countArguments(Str+strlen(".single")); |
Dale Johannesen | ca4571e | 2007-10-25 21:54:43 +0000 | [diff] [blame^] | 250 | else if (strncmp(Str, ".double", strlen(".double"))==0) |
Dale Johannesen | 67cf561 | 2007-05-02 01:02:40 +0000 | [diff] [blame] | 251 | Length += 8*countArguments(Str+strlen(".double")); |
Dale Johannesen | ca4571e | 2007-10-25 21:54:43 +0000 | [diff] [blame^] | 252 | else if (strncmp(Str, ".quad", strlen(".quad"))==0) |
Dale Johannesen | 67cf561 | 2007-05-02 01:02:40 +0000 | [diff] [blame] | 253 | Length += 16*countArguments(Str+strlen(".quad")); |
Dale Johannesen | ca4571e | 2007-10-25 21:54:43 +0000 | [diff] [blame^] | 254 | else if (strncmp(Str, ".ascii", strlen(".ascii"))==0) |
Dale Johannesen | 67cf561 | 2007-05-02 01:02:40 +0000 | [diff] [blame] | 255 | Length += countString(Str+strlen(".ascii")); |
Dale Johannesen | ca4571e | 2007-10-25 21:54:43 +0000 | [diff] [blame^] | 256 | else if (strncmp(Str, ".asciz", strlen(".asciz"))==0) |
Dale Johannesen | 67cf561 | 2007-05-02 01:02:40 +0000 | [diff] [blame] | 257 | Length += countString(Str+strlen(".asciz"))+1; |
| 258 | } |
| 259 | } else if (inTextSection) { |
Dale Johannesen | 8650199 | 2007-04-29 19:17:45 +0000 | [diff] [blame] | 260 | // An instruction |
| 261 | atInsnStart = false; |
Dale Johannesen | 67cf561 | 2007-05-02 01:02:40 +0000 | [diff] [blame] | 262 | if (Subtarget->isThumb()) { |
Dale Johannesen | 8650199 | 2007-04-29 19:17:45 +0000 | [diff] [blame] | 263 | // BL and BLX <non-reg> are 4 bytes, all others 2. |
Dale Johannesen | ca4571e | 2007-10-25 21:54:43 +0000 | [diff] [blame^] | 264 | if (strncmp(Str, "blx", strlen("blx"))==0) { |
Dale Johannesen | 67cf561 | 2007-05-02 01:02:40 +0000 | [diff] [blame] | 265 | const char* p = Str+3; |
| 266 | while (*p && isspace(*p)) |
| 267 | p++; |
| 268 | if (*p == 'r' || *p=='R') |
| 269 | Length += 2; // BLX reg |
Dale Johannesen | 8650199 | 2007-04-29 19:17:45 +0000 | [diff] [blame] | 270 | else |
Dale Johannesen | 67cf561 | 2007-05-02 01:02:40 +0000 | [diff] [blame] | 271 | Length += 4; // BLX non-reg |
Dale Johannesen | ca4571e | 2007-10-25 21:54:43 +0000 | [diff] [blame^] | 272 | } else if (strncmp(Str, "bl", strlen("bl"))==0) |
Dale Johannesen | 67cf561 | 2007-05-02 01:02:40 +0000 | [diff] [blame] | 273 | Length += 4; // BL |
| 274 | else |
Dale Johannesen | 8650199 | 2007-04-29 19:17:45 +0000 | [diff] [blame] | 275 | Length += 2; // Thumb anything else |
| 276 | } |
| 277 | else |
| 278 | Length += 4; // ARM |
| 279 | } |
| 280 | } |
| 281 | if (*Str == '\n' || *Str == SeparatorChar) |
| 282 | atInsnStart = true; |
| 283 | } |
Dale Johannesen | ca4571e | 2007-10-25 21:54:43 +0000 | [diff] [blame^] | 284 | free(s_copy); |
Dale Johannesen | 8650199 | 2007-04-29 19:17:45 +0000 | [diff] [blame] | 285 | return Length; |
| 286 | } |