<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div>Reid,</div><div><br></div><div>After going over the code (specifically in libclang), I just can’t guarantee that all entry points into CompilerInvocation::CreateFromArgs() are passing arguments that aren’t stack or dynamically allocated then freed (For example, whatever calling clang::createInvocationFromCommandLine could pass in args pointing to strings from its stack). I think a practical solution is to have a persisting unique string pool in this instance. I’ve decided to change my code to use StringMap instead, so that should ease your concern over the complexity. If there is an easy to reuse global string pool within clang, I’d certainly like to know (I’ve heard that there are such pools in several LLVM projects for exactly this purpose, but I am not familiar with them). The global in this case is local to the file; I think for the sake of practicality it might be ok to allow this? Either that, or assume that CompilerInvocation instances are live for the lifetime of whatever main() is calling libclang because I’m not sure if StringRef on CodeGenOptions is any better of an assumption. </div><div><br></div><div>I am open to suggestions.</div><div><br></div><div>Thanks</div><div><br></div><div>Puyan</div><div><br></div><div></div></body></html>