Migrating LLVM API usage on main

This patch migrates the compiler off of the deprecated LLVM APIs where I
can.

 - APInt::getAllOnesValue -> APInt::getAllOnes
 - APInt::getNullValue -> APInt::getZero
 - APInt::isNullValue -> APInt::isZero
 - APInt::getMinSignedBits -> APInt::getSignificantBits
 - clang::Module::submodule_{begin,end} -> clang::Module::submodules
This commit is contained in:
Evan Wilde
2023-07-13 11:22:35 -07:00
parent 1cf3b64e22
commit 83b044f5fb
10 changed files with 29 additions and 30 deletions

View File

@@ -576,10 +576,10 @@ void swift::ide::printModuleInterface(
// If we're supposed to visit submodules, add them now.
if (TraversalOptions & ModuleTraversal::VisitSubmodules) {
for (auto Sub = CM->submodule_begin(), SubEnd = CM->submodule_end();
Sub != SubEnd; ++Sub) {
if (Visited.insert(*Sub).second)
Worklist.push_back(*Sub);
for (clang::Module * submodule: CM->submodules()) {
if (Visited.insert(submodule).second) {
Worklist.push_back(submodule);
}
}
}
}
@@ -593,9 +593,8 @@ void swift::ide::printModuleInterface(
llvm::SmallPtrSet<const clang::Module *, 16> NoImportSubModules;
if (TargetClangMod) {
// Assume all submodules are missing.
for (auto It = TargetClangMod->submodule_begin();
It != TargetClangMod->submodule_end(); ++It) {
NoImportSubModules.insert(*It);
for (clang::Module *submodule: TargetClangMod->submodules()) {
NoImportSubModules.insert(submodule);
}
}
llvm::StringMap<std::vector<Decl*>> FileRangedDecls;