<div dir="ltr"><br><div>Hi Vedant,</div><div><br></div><div>Thanks for the pointers. Please find my replies inline.</div><div class="gmail_extra"><br><div class="gmail_quote">On 16 June 2017 at 14:48, Vedant Kumar <span dir="ltr"><<a href="mailto:vsk@apple.com" target="_blank">vsk@apple.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><br><div><blockquote type="cite"><div>On Jun 16, 2017, at 4:11 AM, Dipanjan Das via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>> wrote:</div><br class="m_-4534259531768341626Apple-interchange-newline"><div><div dir="ltr"><div><br></div>Can anybody give me any pointer on how compiler-rt, especially the sanitizers work? Do they operate on IR as any other LLVM pass? Or are they integral part of the frontend itself? I couldn't spot any documentation on the internals of compiler-rt project? What happens (sequence of actions) when I pass -fsanitizer=dataflow to clang?</div></div></blockquote><div><br></div><div>Passing -fsanitize=dataflow tells clang to insert the dataflow sanitizer's instrumentation pass into the normal compilation pipeline. The instrumentation occurs at the LLVM IR level. The pass may insert calls into runtime functions which are provided by compiler-rt. Therefore, in order to link a program compiled with -fsanitize=dataflow, the appropriate runtime library from compiler-rt is required.</div><div><br></div><br><blockquote type="cite"><div><div dir="ltr"><div>Precisely, I intend to alter the behaviour of DFSan to suit my need.</div></div></div></blockquote><div><br></div>What is your need, exactly?</div><div><br></div></div></blockquote><div><br></div><div>Instead of manually inserting the dfsan_create_label() and dfsan_set_label() calls in the source, I want to automatically insert those calls in the IR for all the input variables in scanf(). I intend to run the DFsan pass afterwards, thus instrumenting the IR further as required.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><div></div><div><blockquote type="cite"><div><div dir="ltr"><div>Therefore, I need to know how it gets integrated in the tool-chain. Initially, my idea was to insert the dfsan_set_label() calls to the IR and pass it to DFSan. However, I am not sure if it's designed to run on the source only, not on IR.<br clear="all"></div></div></div></blockquote><div><br></div><div>You should take a look at <span>lib/Transforms/<wbr>Instrumentation/<wbr>DataFlowSanitizer.cpp. There doesn't appear to be much done at the source level.</span></div><span><br></span><div>best,</div><div>vedant</div><span class="HOEnZb"><font color="#888888"><br><blockquote type="cite"><div><div dir="ltr"><div><div><br></div>-- <br><div class="m_-4534259531768341626gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><span><div><div dir="ltr"><p>Thanks & Regards,</p>
<div>Dipanjan</div></div></div></span></div></div>
</div></div>
______________________________<wbr>_________________<br>LLVM Developers mailing list<br><a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br><a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/llvm-dev</a><br></div></blockquote></font></span></div><br></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><span><div><div dir="ltr"><p>Thanks & Regards,</p>
<div>Dipanjan</div></div></div></span></div></div>
</div></div>