1

My project is obj-c and C++ hybirid, filled with by both *.m and *.mm.

When compiling, if choose GCC 4.2, *.m obj-c source files compile speed is very fast but *.mm very very slow, but LLVM 2.0 can do a very good job, it is very fast for both *.m and *.mm.

My question: Is there any difference between LLVM and GCC 4.2 during compliling *.mm files? why GCC 3.2 is so slow?

Any ieda or discussion will be appreciated, thanks in advance.

ENV: XCODE 4.0.1

3 Answers 3

1

Is there any difference between LLVM and GCC 4.2 during compliling *.mm files? why GCC 3.2 is so slow?

Yes; they are totally different compilers; essentially everything about the process is different, even though the actual effect is similar (you get an executable which faithfully reproduces the semantics of your source code). One of the major goals for LLVM has been improving compilation speed. This is expected.

If you want to read about the internals of LLVM, here's a reasonable place to start.

0
0

LLVM is a much newer compiler, designed and written during the last 5 years, while the gnu compiler collection (gcc) is more than 20 years old and very bloated, but can do lots of languages. In very rare occurences, the gcc optimization is better, but in general you should just use LLVM.

0
0

GCC is indeed old, but is still making progress. I suggest you to compare recent versions, so use GCC 4.6 (vs LLVM 2.9). Your 4.2 version of GCC is several years old, and a lot of progress has been made on the GCC side since.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.