<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">On 2/27/17 8:33 PM, Willem Wyndham via
cfe-dev wrote:<br>
</div>
<blockquote
cite="mid:CAEn6zJEqTuYDKy5Ss5fVoeCqKE=6-O+uSX6Huonhqr8FRyd6rg@mail.gmail.com"
type="cite">
<div dir="ltr"><font face="verdana, arial, helvetica, sans-serif"><span
style="font-size:14px">I'm working a project to add a bug to
Clang that is inspired by Ken Thompson's famous article. My
question is where in clang should I edit to add source to
the input source? I need my added source to be internal to
clang so that when I compile normal clang with my binary the
bug will still exist in the new compiler.</span></font><br>
</div>
</blockquote>
<br>
<font face="verdana, arial, helvetica, sans-serif">You probably want
to examine and transform the Abstract Syntax Tree (AST) instead of
the program's actual source. I have not worked with the Clang
libraries myself, but from what I understand, Clang provides
something like LLVM's transform passes for modifying the AST.<br>
<br>
Clang has some bug detection code that you could look at; this
would help you learn how to examine the AST.<br>
<br>
Regards,<br>
<br>
John Criswell<br>
<br>
</font>
<blockquote
cite="mid:CAEn6zJEqTuYDKy5Ss5fVoeCqKE=6-O+uSX6Huonhqr8FRyd6rg@mail.gmail.com"
type="cite">
<div dir="ltr">
<div><font face="verdana, arial, helvetica, sans-serif"><span
style="font-size:14px"><br>
</span></font></div>
<div><font face="verdana, arial, helvetica, sans-serif"><span
style="font-size:14px">Best,</span></font></div>
<div><font face="verdana, arial, helvetica, sans-serif"><span
style="font-size:14px">Willem Wyndham</span></font></div>
<div><font face="verdana, arial, helvetica, sans-serif"><span
style="font-size:14px">Phd Student UMD, College Park</span></font></div>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
cfe-dev mailing list
<a class="moz-txt-link-abbreviated" href="mailto:cfe-dev@lists.llvm.org">cfe-dev@lists.llvm.org</a>
<a class="moz-txt-link-freetext" href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev">http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev</a>
</pre>
</blockquote>
<br>
<p><br>
</p>
<pre class="moz-signature" cols="72">--
John Criswell
Assistant Professor
Department of Computer Science, University of Rochester
<a class="moz-txt-link-freetext" href="http://www.cs.rochester.edu/u/criswell">http://www.cs.rochester.edu/u/criswell</a></pre>
</body>
</html>