Address code-review feedback for #33430

This commit is contained in:
Artem Chikin
2020-08-12 17:39:06 -07:00
parent 2a8e4b2d49
commit 721f903567
4 changed files with 14 additions and 9 deletions

View File

@@ -129,7 +129,7 @@ public:
ArrayRef<StringRef> buildCommandLine,
ArrayRef<StringRef> extraPCMArgs,
StringRef contextHash,
bool isFramework = false
bool isFramework
) : ModuleDependenciesStorageBase(ModuleDependenciesKind::Swift,
compiledModulePath),
swiftInterfaceFile(swiftInterfaceFile),

View File

@@ -112,7 +112,6 @@
#include "swift/Frontend/ModuleInterfaceSupport.h"
#include "swift/Serialization/SerializedModuleLoader.h"
#include "llvm/Support/StringSaver.h"
#include <sstream>
namespace clang {
class CompilerInstance;
@@ -263,8 +262,14 @@ private:
} else if (key == "sourceInfoPath") {
result.moduleSourceInfoPath = val.str();
} else if (key == "isFramework") {
std::istringstream is(val.str());
is >> std::boolalpha >> result.isFramework;
auto valStr = val.str();
valStr.erase(std::remove(valStr.begin(), valStr.end(), '\n'), valStr.end());
if (valStr.compare("true") == 0)
result.isFramework = true;
else if (valStr.compare("false") == 0)
result.isFramework = false;
else
llvm_unreachable("Unexpected JSON value for isFramework");
} else {
// Being forgiving for future fields.
continue;

View File

@@ -27,11 +27,11 @@
import Foo
// This test is to verify autolinking behavior so it is macOS-specific.
// REQUIRES OS=macosx
// REQUIRES: OS=macosx
// RUN: otool -l %t/explicit-framework-irgen.o | %FileCheck %s
// CHECK: cmd LC_LINKER_OPTION
// CHECK-NEXT: cmdsize 32
// CHECK-NEXT: count 2
// CHECK-NEXT: cmdsize
// CHECK-NEXT: count
// CHECK-NEXT: string #1 -framework
// CHECK-NEXT: string #2 Foo

View File

@@ -3,7 +3,7 @@
// Check the contents of the JSON output
// RUN: %FileCheck %s < %t/deps.json
// REQUIRES: objc_interop
// REQUIRES: OS=macosx
import CryptoKit