Hacker News new | ask | show | jobs
by steveklabnik 5717 days ago
> LLVM is just a replacement for GCC

You're confusing LLVM and clang. LLVM is a bunch of tools to build compilers with, one of which is clang. With Apple moving to tools that support LLVM, they could easily switch out backends to generate, say, ARM rather than x86_64 instructions, allowing them to keep the same software, but run it on different hardware.

1 comments

No, not really confusing them at all. I know what LLVM is, I used it in the more broader terms in that clang is a subproject of LLVM and wouldn't exist without it.

LLVM in the strictest sense is replacing GCC in that clang is being brought in, along with various other tools that are normally part of GCC.

Also, GCC currently compiles for ARM, what makes LLVM somehow better for generating ARM code than GCC? Your logic here makes absolutely no sense what so ever.

I was speaking in generalities about ARM. One of the main aims of the LLVM project is to be as modular as possible, and GCC's plugin architecture is less than stellar, as others have pointed out in this thread. Embracing flexibility would enable Apple to make this move, and they've jumped processor architectures twice in the past, and once with the iPad, so it's not out of the question that they wouldn't do it again.
Still has nothing to do with choosing LLVM over GCC. Currently GCC is happily generating object files for me that contains i386, x86_64, and ppc:

file x.o x.o: Mach-O universal binary with 2 architectures

x.o (for architecture i386): Mach-O object i386

x.o (for architecture x86_64): Mach-O 64-bit object x86_64

x.o (for architecture ppc7400): Mach-O object ppc

Going to another architecture doesn't mean changing the compiler at all, just like they didn't change the compiler when going from PowerPC to Intel. Back on PowerPC it was GCC and now on Intel it is GCC. I believe that GCC is also used to compile for the iPhone/iPad.

Please don't get me wrong, I am really happy Apple is embracing LLVM with the various tools surrounding it and is moving away from GCC, however that is not a sign that they are planning on moving CPU architectures again.