-rewrite-objc and Objective-C in clang

I have one problem recently. Klang can translate Objective-C into C ++ using -rewrite-objc. Therefore, I think the first step. clang compiles Objective-C in C ++. And then compilation can only use the C ++ compiler. This is true? clang first convert Objective-C to C ++ with runTime and then compile with machine code?

0
objective-c-runtime clang
source share
1 answer

-rewrite-objc exists for translating ObjC into C ++, so it can be compiled in Visual Studio. This is still Objective-C semantics, and you still need Objective-C runtime. This is not a magical conversion of Objective-C to O ++ C ++ architecture.

It is more like Objective-C was implemented as an extension of the pre-compiler.

It all depends on the fact that Objective-C classes are just C structures with fancy behavior and Objective-C method calls, all of which can be translated into objc_msgSend() calls.

+3
source share

All Articles