Is there any way to modify basic block like adding junk code or ...

Hi ,

Is there any way to modify code like adding junk code or mess up the order of a bunch of codes(in same basic block) which is no dependency? I saw some options like -dce -deadargelim for ‘opt’ , but what I want is to reverse to do it. I mean adding some dead code or junk code. Actually what I want is to implement a ploymorphic engine. Coud I do those by using llvm?

Thanks.

Qiuyu

Sure, modifying and adding to the LLVM IR is easy. Please read the
programmers manual for more info:

http://llvm.org/docs/ProgrammersManual.html

For example, "Creating and inserting new Instructions" might be useful:
http://llvm.org/docs/ProgrammersManual.html#schanges_creating

-Chris