<div dir="ltr">Trunk is always "the next version", 3.6 is whatever is built from 3.6 branch.</div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Mar 4, 2015 at 3:07 PM, Robert Ankeney <span dir="ltr"><<a href="mailto:rrankene@gmail.com" target="_blank">rrankene@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>I'm updating a project from Clang 3.4 to the latest version of Clang, and am having problems getting it to work. It's a Qt-based project with a RecursiveASTVisitor, running on Windows with MinGW-32. Everything seems to go well until I get to the destructor of the CompilerInstance. The code looks something like:<br>{<br> CompilerInstance compiler;<br> DiagnosticOptions &diagOpts = compiler.getDiagnosticOpts();<br> string verr_string;<br> raw_string_ostream vErr(verr_string);<br><br> TextDiagnosticPrinter *pTextDiagnosticPrinter =<br> new TextDiagnosticPrinter(vErr, &diagOpts);<br> compiler.createDiagnostics(pTextDiagnosticPrinter);<br><br> // Create an invocation that passes any flags to preprocessor<br> unique_ptr<CompilerInvocation> Invocation(new CompilerInvocation);<br> CompilerInvocation::CreateFromArgs(*Invocation, argv + 1, argv + argc,<br> compiler.getDiagnostics());<br><br> Invocation->setLangDefaults(compiler.getLangOpts(),<br> clang::IK_CXX,<br> options.langStandard);<br><br> compiler.setInvocation(Invocation.release());<br><br> // Set default target triple<br> shared_ptr<TargetOptions> pto( new TargetOptions());<br> pto->Triple = llvm::sys::getDefaultTargetTriple();<br> shared_ptr<TargetInfo><br> pti(TargetInfo::CreateTargetInfo(compiler.getDiagnostics(), pto));<br> compiler.setTarget(pti.get());<br><br> compiler.createFileManager();<br> compiler.createSourceManager(compiler.getFileManager());<br><br> compiler.createPreprocessor(TU_Module);<br> compiler.getPreprocessorOpts().UsePredefines = false;<br><br> compiler.createASTContext();<br><br> SourceManager &sourceMgr = compiler.getSourceManager();<br><br> // Initialize rewriter<br> Rewriter Rewrite;<br> Rewrite.setSourceMgr(sourceMgr, compiler.getLangOpts());<br><br> // Get filename<br> string fileName(argv[argc - 1]);<br><br> const FileEntry *pFile = compiler.getFileManager().getFile(fileName);<br> sourceMgr.setMainFileID(sourceMgr.createFileID(pFile, SourceLocation(), SrcMgr::C_User));<br> if (pFile == NULL)<br> {<br> // File not found<br> return false;<br> }<br><br> compiler.getDiagnosticClient().BeginSourceFile(compiler.getLangOpts(),<br> &compiler.getPreprocessor());<br><br> MyASTConsumer astConsumer(Rewrite);<br><br> try {<br> // Parse the AST<br> ParseAST(compiler.getPreprocessor(),<br> &astConsumer,<br> compiler.getASTContext());<br> } catch(exception &e)<br> {<br> return false;<br> }<br><br> compiler.getDiagnosticClient().EndSourceFile();<br><br> return true; // Return success<br>}<br><br></div>Everything works fine till the return, when it crashes with:<br><div><br>libstdc++-6!_ZNSs4_Rep10_M_destroyERKSaIcE C:\Qt\Qt5.4.1\5.4\mingw491_32\bin\libstdc++-6.dll<br><div>clang::DiagnosticsEngine::~DiagnosticsEngine<br>clang::CompilerInstance::~CompilerInstance<br><br></div><div>Any ideas what I did wrong? This is with:<br>clang version 3.7.0 (trunk 230884)<br>Target: i686-pc-windows-gnu<br>Thread model: posix<br><br></div><div>BTW, why is the current build calling itself 3.7.0? Since 3.6 was just released, it seems it should be called 3.6.0 or something less confusing.<br><br></div><div>Thanks!<span class="HOEnZb"><font color="#888888"><br></font></span></div><span class="HOEnZb"><font color="#888888"><div>Robert<br><br></div><br><br></font></span></div></div>
<br>_______________________________________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@cs.uiuc.edu">cfe-dev@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev</a><br>
<br></blockquote></div><br></div>