mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-24 20:46:05 +00:00
[clang-apply-replacements] Always initialize FormatStyle.
The cleanup logic reads from this for cleanups even if reformatting is not requested. Found by msan. llvm-svn: 329894
This commit is contained in:
parent
32d368147f
commit
8d2acfd8e8
@ -97,16 +97,13 @@ int main(int argc, char **argv) {
|
||||
IntrusiveRefCntPtr<DiagnosticIDs>(new DiagnosticIDs()), DiagOpts.get());
|
||||
|
||||
// Determine a formatting style from options.
|
||||
format::FormatStyle FormatStyle;
|
||||
if (DoFormat) {
|
||||
auto FormatStyleOrError =
|
||||
format::getStyle(FormatStyleOpt, FormatStyleConfig, "LLVM");
|
||||
if (!FormatStyleOrError) {
|
||||
llvm::errs() << llvm::toString(FormatStyleOrError.takeError()) << "\n";
|
||||
return 1;
|
||||
}
|
||||
FormatStyle = *FormatStyleOrError;
|
||||
auto FormatStyleOrError =
|
||||
format::getStyle(FormatStyleOpt, FormatStyleConfig, "LLVM");
|
||||
if (!FormatStyleOrError) {
|
||||
llvm::errs() << llvm::toString(FormatStyleOrError.takeError()) << "\n";
|
||||
return 1;
|
||||
}
|
||||
format::FormatStyle FormatStyle = std::move(*FormatStyleOrError);
|
||||
|
||||
TUReplacements TURs;
|
||||
TUReplacementFiles TUFiles;
|
||||
|
Loading…
x
Reference in New Issue
Block a user