[LLVMdev] me being stupid: me vs the llvm codebase...

Chris Lattner sabre at nondot.org
Tue Oct 23 20:21:10 PDT 2007


>> LLVM handles function pointers currently.  It just overwrites the  
>> first
>> instruction of the old code with an unconditional branch to the new
>> implementation.  Thus, any code branching to the old location will  
>> still
>> work.
>
> yes, that works so long as one has write access to the text section  
> (or the
> code is otherwise in a writable area).
> at least with typical compilation, afaik this is not the case (I  
> think both
> linux and windows by default have .text being read only, which may  
> limit
> applicability of this approach...).
>

In the LLVM case, it generated the code in the first place, so it  
obviously had access to write it there.

In any case, the JIT can use mprotect to map the page writable if it  
has to.

> a major detractor at this point for me and LLVM, is that it is  
> written in
> C++, and I am not so good with C++, and I am otherwise not so  
> fammiliar with
> the codebase...

That sounds like an excellent reason to get more familiar with C++  
and the LLVM code base.  It's usually better to try to grow your  
capabilities than to limit what you can do by avoiding learning new  
things ;-)

LLVM has extensive documentation at http://llvm.org/docs

> (as for myself and my project, well, my issue is partly one of  
> isolation,
> namely that not really anyone cares about much of this, so I don't  
> have all
> that many people to talk to...).

Sure, but that isn't a good reason to fill the in-boxes of people who  
are interested in LLVM. :)

> so, I am just some lame hobbyist is all I guess, may stay around or  
> may go
> away, or may use LLVM or continue using my own compiler.

We certainly welcome "lame hobbists"!  That is not the point.  In  
fact, one significant goal of LLVM is to make it usable and  
approachable for people with all sorts of backgrounds.  We haven't  
necessarily done a great job at this, but it is a goal :).  I have no  
problem with discussing technical issues or answering questions on  
this list, just so long as they stay LLVM-related.

Thanks, and welcome to the LLVM community!

-Chris 



More information about the llvm-dev mailing list