Error while compiling .cpp

Hi,

Actually I started with hello.cpp povided as an example pass and modified and made my pass which does randomization. I have been working on it and running over programs and it always worked fine but now lately i had checked out a newer version (llvm)which i believed was working fine too but now as i did some modifications and tried to compile my pass i got these errors.

My pass simply randomization of basic blocks.

Also I have yet not found a simple way to calculate basic block size in a function.There are tools that give me function size in bytes etc etc …but not of basic block.I got reply that I have to see what my block does and then calculate size…what does that mean ? iterating over instructions and add the size of the instructions ?how do i determine that ?

Sorry for tons of questions but I would appreciate your help :slight_smile:

Thanks
Tanu

Actually I started with hello.cpp povided as an example pass and modified and made my pass which does randomization. I have been working on it and running over programs and it always worked fine but now lately i had checked out a newer version (llvm)which i believed was working fine too but now as i did some modifications and tried to compile my pass i got these errors.

So you get the errors while compiling the pass? Did you recently upgrade your system GCC? It looks like it is configured wrong or is somehow broken.

Also I have yet not found a simple way to calculate basic block size in a function.There are tools that give me function size in bytes etc etc ....but not of basic block.I got reply that I have to see what my block does and then calculate size...what does that mean ? iterating over instructions and add the size of the instructions ?how do i determine that ?

Again, what "size" are you looking for? If you just want to figure out how many llvm instructions are in it, BB->size() should do the trick.

-Chris