El código no se compila para un archivo de implementación extra grande

The compiler exits by throwing following error.

/var/folders/2t/jkh9ngsn6f9bnmz8l0mz0zm80000gs/T/xsdLocal20-ZhAiH9.s:1895977:branch out of range
clang: error: assembler command failed with exit code 1 (use -v to see invocation)
Command        /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang failed with exit code 1

The file has 98341 number of lines.

using compiler Apple LLVM 3.1

The code builds for simulator but not for iOS device

preguntado el 05 de septiembre de 12 a las 10:09

Do you have any huge functions/methods in this file? Also, is this just one class or multiple classes implemented in the same file? -

Also it can be a bug in the toolchain ... It's worth to report this with sample project how to reproduce the build issue. -

@sch it contains multiple classes with huge methods/ functions -

1 Respuestas

Save the original file.

Comment out out @implementation after another, til the file compiles properly. Npw you know the class that is giving you the problem.

Then take the very biggest method, adding '#if 0' around the code, and at the top before the '#if 0', return a proper value - YES, NO, nil, whatever so the file will compile.

Compile. Do you still get the problem? Then comment out the next largest method, or just do the methods sequentially, or use a binary search technique (ie comment out one half of the methods, then the other half, to drill down on the culprit.

Once you find the problem method, you will need to refactor it into two or more methods, which probably can be private to the class, so your public interface does not change.

Respondido el 05 de Septiembre de 12 a las 11:09

opening the file searching navigating itself is very slow, any tool which can divide the file in to multiple - Hanuman

Open the file with some other text editor known to handle large files well. I believe BBEdit does this but not sure. Creating one file with almost 100,000 lines it was not a great idea and unfortunately when bad design decisions are made, the outcome is usually not very pleasant. BBEdit use to have a free sibling - TextWrangler I think - not sure if its still available. - David H

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.