title: Changing source code at compilation time (using LLVM)
body: <pre><code>#include &lt;stdio.h&gt;
  #include &lt;string.h&gt;    
  int foo(char* a)
      { char str[10];
        if (strlen(a)&lt;10) 
       { 
         sprintf(str,"Yes");
         puts(str);
         return 0;
       }
       else
       {
         sprintf(str,"No");
         puts(str);
         return 1;
       }
      }
  </code></pre>
  
  <p>Now, lets say while writing a LLVM pass, I want to ensure that instead of calling <em>sprintf</em>,  <em>printf</em> is called instead (with the same arguments). How could I go about doing that?</p>