aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Frontend/CompilerInstance.cpp
diff options
context:
space:
mode:
authorJan Svoboda <jan_svoboda@apple.com>2021-11-12 14:15:24 +0100
committerJan Svoboda <jan_svoboda@apple.com>2021-11-12 14:16:06 +0100
commitab6ef5872763fd84e714c30467a49ad41d81bafc (patch)
tree0c4cf2fb70213d40b796db997192233d5c05b3a0 /clang/lib/Frontend/CompilerInstance.cpp
parent99ff697bf72af978515ecca833337965502d4e63 (diff)
downloadllvm-ab6ef5872763fd84e714c30467a49ad41d81bafc.zip
llvm-ab6ef5872763fd84e714c30467a49ad41d81bafc.tar.gz
llvm-ab6ef5872763fd84e714c30467a49ad41d81bafc.tar.bz2
[clang] NFC: Format a loop in CompilerInstance
This code will be moved to a separate function in a future patch. Reformatting now to prevent a bunch of clang-format complains on Phabricator.
Diffstat (limited to 'clang/lib/Frontend/CompilerInstance.cpp')
-rw-r--r--clang/lib/Frontend/CompilerInstance.cpp28
1 files changed, 13 insertions, 15 deletions
diff --git a/clang/lib/Frontend/CompilerInstance.cpp b/clang/lib/Frontend/CompilerInstance.cpp
index ee62d70..1432607 100644
--- a/clang/lib/Frontend/CompilerInstance.cpp
+++ b/clang/lib/Frontend/CompilerInstance.cpp
@@ -2008,10 +2008,9 @@ CompilerInstance::loadModule(SourceLocation ImportLoc,
PrivateModule, PP->getIdentifierInfo(Module->Name)->getTokenID());
PrivPath.push_back(std::make_pair(&II, Path[0].second));
- if (PP->getHeaderSearchInfo().lookupModule(PrivateModule, ImportLoc,
- true, !IsInclusionDirective))
- Sub =
- loadModule(ImportLoc, PrivPath, Visibility, IsInclusionDirective);
+ if (PP->getHeaderSearchInfo().lookupModule(PrivateModule, ImportLoc, true,
+ !IsInclusionDirective))
+ Sub = loadModule(ImportLoc, PrivPath, Visibility, IsInclusionDirective);
if (Sub) {
MapPrivateSubModToTopLevel = true;
if (!getDiagnostics().isIgnored(
@@ -2034,9 +2033,9 @@ CompilerInstance::loadModule(SourceLocation ImportLoc,
unsigned BestEditDistance = (std::numeric_limits<unsigned>::max)();
for (class Module *SubModule : Module->submodules()) {
- unsigned ED = Name.edit_distance(SubModule->Name,
- /*AllowReplacements=*/true,
- BestEditDistance);
+ unsigned ED =
+ Name.edit_distance(SubModule->Name,
+ /*AllowReplacements=*/true, BestEditDistance);
if (ED <= BestEditDistance) {
if (ED < BestEditDistance) {
Best.clear();
@@ -2049,12 +2048,11 @@ CompilerInstance::loadModule(SourceLocation ImportLoc,
// If there was a clear winner, user it.
if (Best.size() == 1) {
- getDiagnostics().Report(Path[I].second,
- diag::err_no_submodule_suggest)
- << Path[I].first << Module->getFullModuleName() << Best[0]
- << SourceRange(Path[0].second, Path[I-1].second)
- << FixItHint::CreateReplacement(SourceRange(Path[I].second),
- Best[0]);
+ getDiagnostics().Report(Path[I].second, diag::err_no_submodule_suggest)
+ << Path[I].first << Module->getFullModuleName() << Best[0]
+ << SourceRange(Path[0].second, Path[I - 1].second)
+ << FixItHint::CreateReplacement(SourceRange(Path[I].second),
+ Best[0]);
Sub = Module->findSubmodule(Best[0]);
}
@@ -2064,8 +2062,8 @@ CompilerInstance::loadModule(SourceLocation ImportLoc,
// No submodule by this name. Complain, and don't look for further
// submodules.
getDiagnostics().Report(Path[I].second, diag::err_no_submodule)
- << Path[I].first << Module->getFullModuleName()
- << SourceRange(Path[0].second, Path[I-1].second);
+ << Path[I].first << Module->getFullModuleName()
+ << SourceRange(Path[0].second, Path[I - 1].second);
break;
}