forked from OSchip/llvm-project
The diagnostic printer expects the LangOptions to still be alive. Give it one that lives at least as long as all the uses of it. This is still wrong though, we should be passing in the correct LangOpts for a given source file.
llvm-svn: 200952
This commit is contained in:
parent
7c435a5ede
commit
ccf8e29060
|
@ -322,15 +322,16 @@ static void reportDiagnostic(const ClangTidyMessage &Message,
|
|||
|
||||
void handleErrors(SmallVectorImpl<ClangTidyError> &Errors, bool Fix) {
|
||||
FileManager Files((FileSystemOptions()));
|
||||
LangOptions LangOpts; // FIXME: use langopts from each original file
|
||||
IntrusiveRefCntPtr<DiagnosticOptions> DiagOpts = new DiagnosticOptions();
|
||||
DiagOpts->ShowColors = llvm::sys::Process::StandardErrHasColors();
|
||||
DiagnosticConsumer *DiagPrinter =
|
||||
new TextDiagnosticPrinter(llvm::outs(), &*DiagOpts);
|
||||
DiagnosticsEngine Diags(IntrusiveRefCntPtr<DiagnosticIDs>(new DiagnosticIDs),
|
||||
&*DiagOpts, DiagPrinter);
|
||||
DiagPrinter->BeginSourceFile(LangOptions());
|
||||
DiagPrinter->BeginSourceFile(LangOpts);
|
||||
SourceManager SourceMgr(Diags, Files);
|
||||
Rewriter Rewrite(SourceMgr, LangOptions());
|
||||
Rewriter Rewrite(SourceMgr, LangOpts);
|
||||
for (SmallVectorImpl<ClangTidyError>::iterator I = Errors.begin(),
|
||||
E = Errors.end();
|
||||
I != E; ++I) {
|
||||
|
|
Loading…
Reference in New Issue