[PATCH] D139999: [clang-format][NFC] Don't run any passes if Environment::make fails
Owen Pan via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Wed Dec 14 10:27:29 PST 2022
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG0e89f1cca495: [clang-format][NFC] Don't run any passes if Environment::make fails (authored by owenpan).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D139999/new/
https://reviews.llvm.org/D139999
Files:
clang/lib/Format/Format.cpp
Index: clang/lib/Format/Format.cpp
===================================================================
--- clang/lib/Format/Format.cpp
+++ clang/lib/Format/Format.cpp
@@ -3382,6 +3382,11 @@
return {tooling::Replacements(), 0};
}
+ auto Env = Environment::make(Code, FileName, Ranges, FirstStartColumn,
+ NextStartColumn, LastStartColumn);
+ if (!Env)
+ return {};
+
typedef std::function<std::pair<tooling::Replacements, unsigned>(
const Environment &)>
AnalyzerPass;
@@ -3452,10 +3457,6 @@
});
}
- auto Env = Environment::make(Code, FileName, Ranges, FirstStartColumn,
- NextStartColumn, LastStartColumn);
- if (!Env)
- return {};
std::optional<std::string> CurrentCode;
tooling::Replacements Fixes;
unsigned Penalty = 0;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D139999.482925.patch
Type: text/x-patch
Size: 839 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20221214/b8d6c9b4/attachment.bin>
More information about the cfe-commits
mailing list