[LLVMdev] Recompiling llvm+clang how-to?

Óscar Fuentes ofv at wanadoo.es
Fri Jul 13 19:36:02 PDT 2012


"Journeyer J. Joh" <oosaprogrammer at gmail.com> writes:

> Hello Mr. Ciao and people on our list
>
> I tried this last night and now in the morning I captured the problem status.
> Could you please advise me on this problem?
>
> - I downloaded brand new clang+llvm and compiled it as instructed from
> the url below.
>>> http://clang.llvm.org/get_started.html
>
> - I added some code to tools/clang/tools/driver/driver.cpp
>
> 343 int main(int argc_, const char **argv_) {
> 344
> 345   {
> 346     int aaa = 0, bbb = 0;
> 347
> 348     for (int i = 0; i != 1 ; ) {
> 349       if (aaa < 10000) aaa += 1;
> 350       if (bbb < 10000) bbb += aaa;
> 351       if (aaa > 100) aaa -= 1;
> 352       if (bbb > 100) bbb -= aaa;
> 353     }
> 354   }
>
> - And after this I just tried to recompile using the very same
> Makefile under build directory where I compiled the brand new
> clang+llvm as show beow.
>>> time make -j3

[snip]

>>> I grepped 'clang' from ps aux when the compiler stucks in somewhere.
>
>
> [$ top]
>   PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
>  3252 hum       20   0 79412 9560 9272 R  100  0.5 510:06.43 clang
>  1169 root      20   0  222m  47m 6588 S    3  2.4   0:50.93 Xorg
>  1943 hum       20   0 1033m  79m  16m R    2  4.0   0:36.01
> unity-2d-shell
>
>>> Process clang, PID 3252 spends 100% of cpu more than 7 hours
>
>
> I want to debug and learn llvm+clang source code. To do this I need to
> compile and modify the code frequently.

I cannot replicate the problem with a Clang checkout from June 29.

What happens if you replace line 348 with

for (int i = 0; i != 1 ; ++i) {


?



More information about the llvm-dev mailing list