Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 28

Thread: Apple/LLVM and Clang/LLVM

  1. #11
    Join Date
    Feb 2013
    Posts
    7

    Post

    Hold on Vim_user, systemed rulez.. Instead u both attacking each other.. can anyone ans to my question?

  2. #12
    Join Date
    Jan 2013
    Posts
    1,116

    Default

    Quote Originally Posted by Anandh View Post
    Hold on Vim_user, systemed rulez.. Instead u both attacking each other.. can anyone ans to my question?
    Of course. It is like Archibald already stated. The frontend, in this case Clang, analyzes the code (checking for syntactical and logical errors) and creates an intermediate code from it. This code then is given to the backend, which translates the intermediate code into actual machine code.
    This has the advantages that you can replace the parts individually, for example, Clang is a code analyzer for C/C++, but it can be replaced with a code analyzer for Pascal or any other language, as long as the analyzer creates intermediate code that the backend can parse to machine code. On the other hand you can replace the backend if necessary without changing the frontend.

    Also a nice advantage of this design: You can use the parts apart from another, for example can the Clang frontend be used by IDEs or text editors for syntax highlighting or on-the-fly recognition of syntax and logical errors.

  3. #13
    Join Date
    Jan 2013
    Posts
    83

    Default

    Quote Originally Posted by Vim_User View Post
    Of course. It is like Archibald already stated.
    Don't listen to Archibald cause he tries to tell lies to make apple look good

    The frontend, in this case Clang, analyzes the code (checking for syntactical and logical errors) and creates an intermediate code from it. This code then is given to the backend, which translates the intermediate code into actual machine code.
    This has the advantages that you can replace the parts individually, for example, Clang is a code analyzer for C/C++, but it can be replaced with a code analyzer for Pascal or any other language, as long as the analyzer creates intermediate code that the backend can parse to machine code. On the other hand you can replace the backend if necessary without changing the frontend.
    Same can be said for gcc, (gcc, g++, gcj, gfortran etc. thier all gcc) except that gcc is alot more compact and it produces far more refined binaries then clang.

    Also a nice advantage of this design: You can use the parts apart from another, for example can the Clang frontend be used by IDEs or text editors for syntax highlighting or on-the-fly recognition of syntax and logical errors.
    What advantage? They did that to gcc along time ago. But gcc has improved that you don't have to remove or replace anything to used for IDEs or text editors.

  4. #14
    Join Date
    Feb 2013
    Posts
    7

    Post

    Systemed rulz, My question is not related anything with GCC or which compiler is best. My question is all about the difference between Clang::LLVM and Apple::LLVM-if there is or both are same. please reply only if you can answer anything relevant to the question of this thread.

  5. #15
    Join Date
    Jan 2013
    Posts
    1,116

    Default

    Quote Originally Posted by systemd rulez View Post
    Don't listen to Archibald cause he tries to tell lies to make apple look good



    Same can be said for gcc, (gcc, g++, gcj, gfortran etc. thier all gcc) except that gcc is alot more compact and it produces far more refined binaries then clang.



    What advantage? They did that to gcc along time ago. But gcc has improved that you don't have to remove or replace anything to used for IDEs or text editors.
    Afraid to answer the questions, but spreading lies instead and not even able to read or understand my post properly. That's what I thought of you, lying unethical troll.

    @Anandh: There is no such thing as Apple::LLVM. Clang is the frontend for LLVM aimed at C-type languages, the development of Clang/LLVM is supported by Apple, maybe therefore the confusion.

  6. #16
    Join Date
    Sep 2012
    Posts
    780

    Default

    Quote Originally Posted by Anandh View Post
    Is Clang/LLVM and Apple-LLVM (https://developer.apple.com/technologies/tools/) are all just same. Or is there any difference in that. Someone can please enlighten me on this. or even pointer to some good article to understand would be great.

    Thanks / Anandh
    "Apple LLVM" is not really a compiler, but a marketing name Apple uses to designate its parser, compiler and static analyzer tools for its IDE. It is indeed CLang/LLVM integrated into XCode, so they are the just the same.

  7. #17
    Join Date
    Feb 2013
    Posts
    1

    Default

    Quote Originally Posted by Anandh View Post
    Hello there,

    Am newbie in this compiler arena. I have little difficult in understanding various compiler and what does it actually means front-end and back-end in the context of compiler (e.g. I read LLVM compiler used as back-end for Clang.)

    Is Clang/LLVM and Apple-LLVM (https://developer.apple.com/technologies/tools/) are all just same. Or is there any difference in that. Someone can please enlighten me on this. or even pointer to some good article to understand would be great.

    Thanks / Anandh
    Hi,

    Some of my answers will be simplified.

    Apple/LLVM and clang/LLVM are basically same thing.
    Front-end contains the lexer (source code -> token stream), syntax analyzer (token stream -> AST), semantic analyzer (AST -> Intermediate Code).
    Back-end contains the code generator (Intermediate Code -> Machine Code -> Object File).
    Not sure whether the linker is part of the back-end or counts as a different module, but it does the (Object File(s) -> Binary) part.

    When you call
    Code:
    clang <options> <sourcefile1, ...>
    you basically run your source files through all these phases.

    As long as the difference between clang and gcc, there's not much. If you are going to program in Objective-C, then clang is MUCH better, but if C/C++ is your game, they both will perform perfectly fine. What systemd rulez said is complete bullshit.
    Better in clang: (a bit) better C++11 support, faster compile times, modular structure
    Better in gcc: more front-ends (more programming languages are supported), more architectures are supported
    The best thing you can do is write your code in a compiler independent way (normally this should not be a problem) and when you have production ready code, then benchmark the two binaries to see which one is better at that point.

    This was my answer, hope it helped.

    Unrelated:

    systemd rulez, are you the kind of person who always wanted an Apple device, but could never get one, so your "revenge" is calling everything Apple makes shit? I mean, your answers were so retarded, that I laughed my ass off! FYI you can donwload the source code of clang, so you can even check on that little "surveillance capability" which doesn't exist...

  8. #18
    Join Date
    Feb 2013
    Posts
    7

    Post

    @Vim_user & erendorn, Thanks for the clarification. But in the link http://www.stroustrup.com/compilers.html strourstrup says AppleC++ and ClangC++ as two different compiler. This is where my confusion started. can you explain what did he mean by AppleC++ and ClangC++?

  9. #19
    Join Date
    Feb 2013
    Posts
    7

    Post

    @Vim_user, erandorn, Thanks for the clarification. In the link wwwdotstroustrupdotcom/compilers.html, stroustrup talks about different compilers for C++ and he mentions AppleC++ and ClangC++.. This is where my confustion started. Can you throw some light on this?

    Thanks / Anandh

  10. #20
    Join Date
    Jan 2013
    Posts
    1,116

    Default

    I think he got just confused there because of Apple's marketing strategy to name it Apple LLVM when it is just Clang/LLVM integrated into an IDE.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •