hii<br><br>Please find attached herewith the "hello.cpp" file. also one interesting point is that if i declare the global variable "x" after any function declaration then it is not printed .<br><br>Rahul<br>
<br><div class="gmail_quote">On Thu, Jun 3, 2010 at 11:14 PM, RAHUL GOYAL <span dir="ltr"><<a href="mailto:rahulgoyal34@gmail.com">rahulgoyal34@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Hey all...<br><br>I was writing a Function pass to print all the functions using runonFunction() method .but it is printing one global variable "x" at the same time which i just dont know how is getting there.how can i avoid "x" from printing?? . Here is the framgment of code of my pass<br>
<br>namespace {<br> // Hello - The first implementation, without getAnalysisUsage.<br> struct Test2 : public FunctionPass {<br> static char ID; // Pass identification, replacement for typeid<br> Test2() : FunctionPass (&ID) {}<br>
<br> virtual bool runOnFunction(Function &BB) {<br> errs() << "Test1: "<<BB.getName()<<" ";<br> if (BB.empty())<br> errs()<<"true"<<"\n";<br>
else <br> errs()<<"false"<<"\n";<br> return false;<br> }<br> };<br>}<br><br><br>
</blockquote></div><br>