Skip to content

Commit 721f903

Browse files
committed
Address code-review feedback for #33430
1 parent 2a8e4b2 commit 721f903

File tree

4 files changed

+14
-9
lines changed

4 files changed

+14
-9
lines changed

include/swift/AST/ModuleDependencies.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ class SwiftModuleDependenciesStorage : public ModuleDependenciesStorageBase {
129129
ArrayRef<StringRef> buildCommandLine,
130130
ArrayRef<StringRef> extraPCMArgs,
131131
StringRef contextHash,
132-
bool isFramework = false
132+
bool isFramework
133133
) : ModuleDependenciesStorageBase(ModuleDependenciesKind::Swift,
134134
compiledModulePath),
135135
swiftInterfaceFile(swiftInterfaceFile),

include/swift/Frontend/ModuleInterfaceLoader.h

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,6 @@
112112
#include "swift/Frontend/ModuleInterfaceSupport.h"
113113
#include "swift/Serialization/SerializedModuleLoader.h"
114114
#include "llvm/Support/StringSaver.h"
115-
#include <sstream>
116115

117116
namespace clang {
118117
class CompilerInstance;
@@ -263,8 +262,14 @@ class ExplicitModuleMapParser {
263262
} else if (key == "sourceInfoPath") {
264263
result.moduleSourceInfoPath = val.str();
265264
} else if (key == "isFramework") {
266-
std::istringstream is(val.str());
267-
is >> std::boolalpha >> result.isFramework;
265+
auto valStr = val.str();
266+
valStr.erase(std::remove(valStr.begin(), valStr.end(), '\n'), valStr.end());
267+
if (valStr.compare("true") == 0)
268+
result.isFramework = true;
269+
else if (valStr.compare("false") == 0)
270+
result.isFramework = false;
271+
else
272+
llvm_unreachable("Unexpected JSON value for isFramework");
268273
} else {
269274
// Being forgiving for future fields.
270275
continue;

test/ScanDependencies/explicit-framework-irgen.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,11 @@
2727
import Foo
2828

2929
// This test is to verify autolinking behavior so it is macOS-specific.
30-
// REQUIRES OS=macosx
30+
// REQUIRES: OS=macosx
3131

3232
// RUN: otool -l %t/explicit-framework-irgen.o | %FileCheck %s
3333
// CHECK: cmd LC_LINKER_OPTION
34-
// CHECK-NEXT: cmdsize 32
35-
// CHECK-NEXT: count 2
34+
// CHECK-NEXT: cmdsize
35+
// CHECK-NEXT: count
3636
// CHECK-NEXT: string #1 -framework
3737
// CHECK-NEXT: string #2 Foo

test/ScanDependencies/module_framework.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33

44
// Check the contents of the JSON output
55
// RUN: %FileCheck %s < %t/deps.json
6-
// REQUIRES: objc_interop
7-
6+
// REQUIRES: OS=macosx
7+
88
import CryptoKit
99

1010
// CHECK: "mainModuleName": "deps"

0 commit comments

Comments
 (0)