Skip to content

[pull] master from apple:master #25

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 17 commits into from
Jun 16, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
ccd7167
[TypeChecker] Add a entry point to be used for code completion
xedin Jun 15, 2020
1be17a2
[Darwin test config] Use the SDK when running swift/swiftc in tests.
DougGregor Jun 12, 2020
a1e8a35
Update test to link against the Darwin SDK
DougGregor Jun 15, 2020
1ee3342
Fix a test on Linux
DougGregor Jun 15, 2020
abf65bb
IRGen: Use the right descriminator for AutoDiffDerivativeFunctions
aschwaighofer Jun 15, 2020
702c1bc
[arc] Change guaranteed arc opts to be based on SemanticARCOpts and m…
gottesmm May 12, 2020
ff61b24
Remove Type's hash_value function
hamishknight Jun 16, 2020
6041d2a
Fix equality of TypeWitnessAndDecl
hamishknight Jun 16, 2020
f89a385
[ClangImporter] Follow-up for #32214, fix assertion hit due to missin…
akyrtzi Jun 16, 2020
bf8f50f
[Reflection] NFC: Workaround LLVM C++ standard library weirdness
davezarzycki Jun 16, 2020
77e0ad1
Merge pull request #32357 from DougGregor/test-with-sdk-on-darwin
DougGregor Jun 16, 2020
9617cfe
Merge pull request #32406 from davezarzycki/pr32406
davezarzycki Jun 16, 2020
ecaf9af
Merge pull request #32396 from aschwaighofer/irgen_fix_discriminator_…
aschwaighofer Jun 16, 2020
0de7fb8
Merge pull request #32399 from hamishknight/salted-hash
CodaFi Jun 16, 2020
fe39c72
Merge pull request #32390 from gottesmm/pr-c38328b82781ec804d14966507…
gottesmm Jun 16, 2020
cc5335c
Merge pull request #32401 from akyrtzi/fix-clang-include-inherited-co…
akyrtzi Jun 16, 2020
f159175
Merge pull request #32391 from xedin/type-check-for-code-completion
xedin Jun 16, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion include/swift/AST/Requirement.h
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ class Requirement {
case RequirementKind::Conformance:
case RequirementKind::Superclass:
case RequirementKind::SameType:
second = hash_value(requirement.getSecondType());
second = hash_value(requirement.getSecondType().getPointer());
break;

case RequirementKind::Layout:
Expand Down
9 changes: 4 additions & 5 deletions include/swift/AST/Type.h
Original file line number Diff line number Diff line change
Expand Up @@ -325,11 +325,6 @@ class Type {
/// Return the name of the type as a string, for use in diagnostics only.
std::string getString(const PrintOptions &PO = PrintOptions()) const;

friend llvm::hash_code hash_value(Type type) {
using llvm::hash_value;
return hash_value(type.getPointer());
}

/// Return the name of the type, adding parens in cases where
/// appending or prepending text to the result would cause that text
/// to be appended to only a portion of the returned type. For
Expand Down Expand Up @@ -502,6 +497,10 @@ class CanType : public Type {
bool operator==(CanType T) const { return getPointer() == T.getPointer(); }
bool operator!=(CanType T) const { return !operator==(T); }

friend llvm::hash_code hash_value(CanType T) {
return llvm::hash_value(T.getPointer());
}

bool operator<(CanType T) const { return getPointer() < T.getPointer(); }
};

Expand Down
4 changes: 2 additions & 2 deletions include/swift/AST/Witness.h
Original file line number Diff line number Diff line change
Expand Up @@ -206,13 +206,13 @@ struct TypeWitnessAndDecl {
}

friend llvm::hash_code hash_value(const TypeWitnessAndDecl &owner) {
return llvm::hash_combine(owner.witnessType,
return llvm::hash_combine(owner.witnessType.getPointer(),
owner.witnessDecl);
}

friend bool operator==(const TypeWitnessAndDecl &lhs,
const TypeWitnessAndDecl &rhs) {
return lhs.witnessType->isEqual(rhs.witnessType) &&
return lhs.witnessType.getPointer() == rhs.witnessType.getPointer() &&
lhs.witnessDecl == rhs.witnessDecl;
}

Expand Down
11 changes: 6 additions & 5 deletions include/swift/Reflection/ReflectionContext.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
#include "swift/Runtime/Unreachable.h"

#include <set>
#include <sstream>
#include <unordered_map>
#include <utility>
#include <vector>
Expand Down Expand Up @@ -946,10 +945,12 @@ class ReflectionContext
reinterpret_cast<const MetadataAllocationBacktraceHeader<Runtime> *>(
HeaderBytes.get());
if (HeaderPtr == nullptr) {
std::stringstream stream;
stream << "unable to read Next pointer 0x" << std::hex
<< BacktraceListNext.getAddressData();
return stream.str();
// FIXME: std::stringstream would be better, but LLVM's standard library
// introduces a vtable and we don't want that.
char result[128];
std::snprintf(result, sizeof(result), "unable to read Next pointer %p",
BacktraceListNext.getAddressData());
return std::string(result);
}
auto BacktraceAddrPtr =
BacktraceListNext +
Expand Down
10 changes: 10 additions & 0 deletions include/swift/SIL/SILDeclRef.h
Original file line number Diff line number Diff line change
Expand Up @@ -397,6 +397,16 @@ struct SILDeclRef {

bool canBeDynamicReplacement() const;

bool isAutoDiffDerivativeFunction() const {
return derivativeFunctionIdentifier != nullptr;
}

AutoDiffDerivativeFunctionIdentifier *
getAutoDiffDerivativeFunctionIdentifier() const {
assert(isAutoDiffDerivativeFunction());
return derivativeFunctionIdentifier;
}

private:
friend struct llvm::DenseMapInfo<swift::SILDeclRef>;
/// Produces a SILDeclRef from an opaque value.
Expand Down
4 changes: 3 additions & 1 deletion lib/ClangImporter/ImportDecl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7401,7 +7401,9 @@ void SwiftDeclConverter::importInheritedConstructors(

Impl.importAttributes(objcMethod, newCtor, curObjCClass);
newMembers.push_back(newCtor);
} else if (existing && existing->getClangDecl()) {
} else if (existing && existing->getInitKind() ==
CtorInitializerKind::ConvenienceFactory &&
existing->getClangDecl()) {
// Check that the existing constructor the prevented new creation is
// really an inherited factory initializer and not a class member.
auto existingMD = cast<clang::ObjCMethodDecl>(existing->getClangDecl());
Expand Down
3 changes: 3 additions & 0 deletions lib/IRGen/GenMeta.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -739,6 +739,9 @@ namespace {
isa<ConstructorDecl>(func.getDecl())
? SILDeclRef::Kind::Allocator
: SILDeclRef::Kind::Func);
if (entry.getFunction().isAutoDiffDerivativeFunction())
declRef = declRef.asAutoDiffDerivativeFunction(
entry.getFunction().getAutoDiffDerivativeFunctionIdentifier());
addDiscriminator(flags, schema, declRef);
}

Expand Down
1 change: 0 additions & 1 deletion lib/SILOptimizer/Mandatory/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ target_sources(swiftSILOptimizer PRIVATE
DiagnoseStaticExclusivity.cpp
DiagnoseUnreachable.cpp
Differentiation.cpp
GuaranteedARCOpts.cpp
IRGenPrepare.cpp
MandatoryInlining.cpp
PredictableMemOpt.cpp
Expand Down
260 changes: 0 additions & 260 deletions lib/SILOptimizer/Mandatory/GuaranteedARCOpts.cpp

This file was deleted.

Loading