mirror of
https://github.com/intel/llvm.git
synced 2026-02-01 17:07:36 +08:00
[AST] Hide errors from the attempt to introspect nodes
This commit is contained in:
@@ -92,7 +92,13 @@ int main(int argc, const char **argv) {
|
||||
auto ParsedArgs = Opts.ParseArgs(llvm::makeArrayRef(Argv).slice(1),
|
||||
MissingArgIndex, MissingArgCount);
|
||||
ParseDiagnosticArgs(*DiagOpts, ParsedArgs);
|
||||
TextDiagnosticPrinter DiagnosticPrinter(llvm::errs(), &*DiagOpts);
|
||||
|
||||
// Don't output diagnostics, because common scenarios such as
|
||||
// cross-compiling fail with diagnostics. This is not fatal, but
|
||||
// just causes attempts to use the introspection API to return no data.
|
||||
std::string Str;
|
||||
llvm::raw_string_ostream OS(Str);
|
||||
TextDiagnosticPrinter DiagnosticPrinter(OS, &*DiagOpts);
|
||||
DiagnosticsEngine Diagnostics(
|
||||
IntrusiveRefCntPtr<DiagnosticIDs>(new DiagnosticIDs()), &*DiagOpts,
|
||||
&DiagnosticPrinter, false);
|
||||
|
||||
Reference in New Issue
Block a user