<html><head><meta http-equiv="Content-Type" content="text/html charset=iso-8859-1"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Feb 20, 2013, at 10:12 PM, Karthik Bhat <<a href="mailto:blitz.opensource@gmail.com">blitz.opensource@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">Hi Sean,<div>Thanks for the reply. I'm sorry i didn't make my requirement clear in the last mail.</div><div><br></div><div>As per my understanding compiler Instance operates on one file at a time and hence at a time the Source Manager contains only the information about the current file being processed.</div>
<div><br></div><div>Given the command -</div><div><br></div><div>clang -cc1 test1.c test2.c</div><div><br></div><div>While processing test1.c Source manager will not have any information about test2.c. Is my understanding correct? </div>
<div><br></div><div>Is it possible to provide Sourcemanager with information about test2.c as well while the current file being processed is test1.c?</div><div><br></div><div><br></div><div>In my current requirement i'm trying to emit warnings in case we have a call from a function in test1.c to a function in test2.c which might result in some problems. Hence would require the Source manager to have information of test2.c as well while the current file being processed is test1.c</div>
<div><br></div><div>Thanks.</div></blockquote><div><br></div><div>You probably need to manually take over parsing and not use a CompilerInstance (e.g. use clang::ParseAST() directly).</div><div>Then I think you will be able to use one SourceManager for all files. But you still need to use one Preprocessor per translation unit otherwise macros from one translation unit will pollute others.</div><br><blockquote type="cite"><div><br></div><div><br></div><div><br><br><div class="gmail_quote">On Wed, Feb 20, 2013 at 11:23 PM, Sean Silva <span dir="ltr"><<a href="mailto:silvas@purdue.edu" target="_blank">silvas@purdue.edu</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">The SourceManager is meant to manage all the sources. Don't use one<br>
SourceManager per file.<br>
<span class="HOEnZb"><font color="#888888"><br>
-- Sean Silva<br>
</font></span></blockquote></div><br></div>
_______________________________________________<br>cfe-dev mailing list<br><a href="mailto:cfe-dev@cs.uiuc.edu">cfe-dev@cs.uiuc.edu</a><br>http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev<br></blockquote></div><br></body></html>