Skip to content
Commit b4b54697 authored by Volodymyr Sapsai's avatar Volodymyr Sapsai
Browse files

[clang][Driver] Don't overwrite `DiagnosticsEngine::IgnoreAllWarnings`, rely...

[clang][Driver] Don't overwrite `DiagnosticsEngine::IgnoreAllWarnings`, rely on `DiagnosticOptions::IgnoreWarnings` value.

Driver overwrites `DiagnosticsEngine::IgnoreAllWarnings` based on `-w` flag
without taking into account `DiagnosticOptions::IgnoreWarnings` that is
propagated to `DiagnosticsEngine` in `ProcessWarningOptions` (called from
`CompilerInstance::createDiagnostics`). It makes it hard to manipulate
`DiagnosticOptions` directly and pushes towards string-based API.

Most of in-tree tools use `DiagnosticOptions` already, so migrate
`clang_parseTranslationUnit_Impl` to use it too. Don't parse `-w`
directly but rely on
```
def w : Flag<["-"], "w">, HelpText<"Suppress all warnings">, Flags<[CC1Option]>,
  MarshallingInfoFlag<DiagnosticOpts<"IgnoreWarnings">>;
```

Allows to reland D138252.

Differential Revision: https://reviews.llvm.org/D138970
parent b7753330
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment