Skip to content

Commit baf4902

Browse files
authored
Merge pull request #31401 from MForster/m/fix-master-next
Fix two compilation issues on master-next
2 parents e152c19 + 1e1aa46 commit baf4902

File tree

6 files changed

+15
-15
lines changed

6 files changed

+15
-15
lines changed

lib/AST/ModuleDependencies.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ ModuleDependencies::getAsClangModule() const {
3939
void ModuleDependencies::addModuleDependency(
4040
StringRef module, llvm::StringSet<> &alreadyAddedModules) {
4141
if (alreadyAddedModules.insert(module).second)
42-
storage->moduleDependencies.push_back(module);
42+
storage->moduleDependencies.push_back(module.str());
4343
}
4444

4545
void ModuleDependencies::addModuleDependencies(
@@ -69,7 +69,7 @@ void ModuleDependencies::addModuleDependencies(
6969
}
7070

7171
// Otherwise, record the source file.
72-
swiftStorage->sourceFiles.push_back(fileName);
72+
swiftStorage->sourceFiles.push_back(fileName.str());
7373
}
7474

7575
Optional<std::string> ModuleDependencies::getBridgingHeader() const {
@@ -80,21 +80,21 @@ Optional<std::string> ModuleDependencies::getBridgingHeader() const {
8080
void ModuleDependencies::addBridgingHeader(StringRef bridgingHeader) {
8181
auto swiftStorage = cast<SwiftModuleDependenciesStorage>(storage.get());
8282
assert(!swiftStorage->bridgingHeaderFile);
83-
swiftStorage->bridgingHeaderFile = bridgingHeader;
83+
swiftStorage->bridgingHeaderFile = bridgingHeader.str();
8484
}
8585

8686
/// Add source files that the bridging header depends on.
8787
void ModuleDependencies::addBridgingSourceFile(StringRef bridgingSourceFile) {
8888
auto swiftStorage = cast<SwiftModuleDependenciesStorage>(storage.get());
89-
swiftStorage->bridgingSourceFiles.push_back(bridgingSourceFile);
89+
swiftStorage->bridgingSourceFiles.push_back(bridgingSourceFile.str());
9090
}
9191

9292
/// Add (Clang) module on which the bridging header depends.
9393
void ModuleDependencies::addBridgingModuleDependency(
9494
StringRef module, llvm::StringSet<> &alreadyAddedModules) {
9595
auto swiftStorage = cast<SwiftModuleDependenciesStorage>(storage.get());
9696
if (alreadyAddedModules.insert(module).second)
97-
swiftStorage->bridgingModuleDependencies.push_back(module);
97+
swiftStorage->bridgingModuleDependencies.push_back(module.str());
9898
}
9999

100100
llvm::StringMap<ModuleDependencies> &
@@ -158,7 +158,7 @@ void ModuleDependenciesCache::recordDependencies(
158158
assert(map.count(moduleName) == 0 && "Already added to map");
159159
map.insert({moduleName, std::move(dependencies)});
160160

161-
AllModules.push_back({moduleName, kind});
161+
AllModules.push_back({moduleName.str(), kind});
162162
}
163163

164164
void ModuleDependenciesCache::updateDependencies(

lib/ClangImporter/ClangModuleDependencyScanner.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ static std::vector<std::string> getClangDepScanningInvocationArguments(
134134
commandLineArgs.begin(), commandLineArgs.end(),
135135
"<swift-imported-modules>");
136136
assert(sourceFilePos != commandLineArgs.end());
137-
*sourceFilePos = sourceFileName;
137+
*sourceFilePos = sourceFileName.str();
138138

139139
// HACK! Drop the -fmodule-format= argument and the one that
140140
// precedes it.
@@ -202,7 +202,7 @@ static void recordModuleDependencies(
202202
// File dependencies for this module.
203203
std::vector<std::string> fileDeps;
204204
for (const auto &fileDep : clangModuleDep.FileDeps) {
205-
fileDeps.push_back(fileDep.getKey());
205+
fileDeps.push_back(fileDep.getKey().str());
206206
}
207207

208208
// Module-level dependencies.
@@ -334,7 +334,7 @@ bool ClangImporter::addBridgingHeaderDependencies(
334334

335335
// Update the cache with the new information for the module.
336336
cache.updateDependencies(
337-
{moduleName, ModuleDependenciesKind::Swift},
337+
{moduleName.str(), ModuleDependenciesKind::Swift},
338338
std::move(targetModule));
339339

340340
return false;

lib/FrontendTool/ScanDependencies.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ static void findAllImportedClangModules(ASTContext &ctx, StringRef moduleName,
4646
llvm::StringSet<> &knownModules) {
4747
if (!knownModules.insert(moduleName).second)
4848
return;
49-
allModules.push_back(moduleName);
49+
allModules.push_back(moduleName.str());
5050

5151
auto dependencies = cache.findDependencies(
5252
moduleName, ModuleDependenciesKind::Clang);
@@ -352,7 +352,7 @@ bool swift::scanDependencies(CompilerInstance &instance) {
352352

353353
// Compute the dependencies of the main module.
354354
auto mainDependencies =
355-
ModuleDependencies::forSwiftModule(mainModulePath.str());
355+
ModuleDependencies::forSwiftModule(mainModulePath.str().str());
356356
{
357357
llvm::StringSet<> alreadyAddedModules;
358358
for (auto fileUnit : mainModule->getFiles()) {
@@ -410,7 +410,7 @@ bool swift::scanDependencies(CompilerInstance &instance) {
410410
llvm::SetVector<ModuleDependencyID, std::vector<ModuleDependencyID>,
411411
std::set<ModuleDependencyID>> allModules;
412412

413-
allModules.insert({mainModuleName, mainDependencies.getKind()});
413+
allModules.insert({mainModuleName.str(), mainDependencies.getKind()});
414414

415415
// Create the module dependency cache.
416416
ModuleDependenciesCache cache;

lib/IRGen/GenCall.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1615,7 +1615,7 @@ llvm::CallInst *CallEmission::emitCallSite() {
16151615

16161616
// Insert a call to @llvm.coro.prepare.retcon, then bitcast to the right
16171617
// function type.
1618-
auto origCallee = call->getCalledValue();
1618+
auto origCallee = call->getCalledOperand();
16191619
llvm::Value *opaqueCallee = origCallee;
16201620
opaqueCallee =
16211621
IGF.Builder.CreateBitCast(opaqueCallee, IGF.IGM.Int8PtrTy);

lib/LLVMPasses/LLVMMergeFunctions.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1078,7 +1078,7 @@ bool SwiftMergeFunctions::replaceDirectCallers(Function *Old, Function *New,
10781078
removeEquivalenceClassFromTree(FE);
10791079

10801080
auto *CI = dyn_cast<CallInst>(I);
1081-
if (!CI || CI->getCalledValue() != Old) {
1081+
if (!CI || CI->getCalledOperand() != Old) {
10821082
AllReplaced = false;
10831083
continue;
10841084
}

lib/Serialization/ModuleDependencyScanner.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ ErrorOr<ModuleDependencies> ModuleDependencyScanner::scanInterfaceFile(
116116
// Walk the source file to find the import declarations.
117117
llvm::StringSet<> alreadyAddedModules;
118118
auto dependencies = ModuleDependencies::forSwiftInterface(
119-
modulePath.str(), moduleInterfacePath.str());
119+
modulePath.str().str(), moduleInterfacePath.str());
120120

121121
// FIXME: Suppressing diagnostics here is incorrect, and is currently
122122
// used to paper over the fact that we should be creating a fresh

0 commit comments

Comments
 (0)