[prev in list] [next in list] [prev in thread] [next in thread] 

List:       cfe-dev
Subject:    Re: [cfe-dev] Question of main() in llvm/tools/clang/tools/driver/driver.cpp
From:       David Wiberg <dwiberg () gmail ! com>
Date:       2014-11-24 17:26:32
Message-ID: CACXFvW2QPeFiZZW6+Wf6Vr2Y75yBg2VUtv+3xkb9u4rjAYmVvw () mail ! gmail ! com
[Download RAW message or body]

2014-11-24 5:38 GMT+01:00 Xiaohui Chen <xchen422@uwo.ca>:
> hi all:
>
> i am looking into the "main function" of
> llvm/tools/clang/tools/driver/driver.cpp,
> i only add several llvm::outs() in the source code, and re-compile the
> source code again,
> then i use the clang to compile  my input file(t.c) like this:
>
> xchen422@dimsum:~$ clang  t.c
>
>  the output is :
>
> xchen422@dimsum:~$ clang  t.c
> clang main function start point 1
> clang main function start point 3
> clang main function start point 4
> clang main function start point 1
> clang main function start point 2
> clang main function start point 5
> clang main function start point 6
> xchen422@dimsum:~$
>
> It seems that the main() function is called twice, also it seems that there
> are
> some magic in this function(line 468):
>  Res = TheDriver.ExecuteCompilation(*C, FailingCommands);
>
> i could not understand, could someone give me a brief explanation.
>

Hi,

Please see the Clang FAQ (http://clang.llvm.org/docs/FAQ.html#id2)
which describes the difference between the Clang driver and the Clang
frontend.

Best regards
David
_______________________________________________
cfe-dev mailing list
cfe-dev@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic