profile
viewpoint

xedin/sasi 141

Improved Secondary Indexing with new Query Capabilities (OR, scoping) for Cassandra

xedin/disruptor_thrift_server 66

LMAX Disruptor backed Thrift Server implementation (half-sync/half-async).

xedin/gremlin-xpath 5

compile XPath into Gremlin Pipes.

xedin/redmine_labels 5

Brings labels to RedMine

xedin/acts_as_versionable 4

acts_as_versionable for the newest_rails versions with dirty attributes handling

xedin/facebox_render 3

FaceboxRender is a Rails plugin let you use lightbox seamlessly using Facebox library (http://famspam.com/facebox/)

xedin/webling 2

A Web Console for Gremlin

HassanElDesouky/swift 1

The Swift Programming Language

nathawes/swift 1

The Swift Programming Language

sl/swift 1

The Swift Programming Language

Pull request review commentapple/swift

[Diag] Print the diagnostic ID name from localization

 enum LocalDiagID : uint32_t {   NumDiags }; +static constexpr const char *const diagnosticNameStrings[] = {+#define ERROR(ID, Options, Text, Signature) " [" #ID "]",+#define WARNING(ID, Options, Text, Signature) " [" #ID "]",+#define NOTE(ID, Options, Text, Signature) " [" #ID "]",+#define REMARK(ID, Options, Text, Signature) " [" #ID "]",

Based on https://github.com/apple/swift/blob/main/include/swift/AST/DefineDiagnosticMacros.h I think the answer is yes.

HassanElDesouky

comment created time in 9 hours

PullRequestReviewEvent
PullRequestReviewEvent

Pull request review commentapple/swift

[SR-13503] [Sema] Special InsertExplicitCall for nominal callable types

 ConstraintSystem::simplifyApplicableFnConstraint(       type1, origType2, subflags, locator);    if (shouldAttemptFixes() && result == SolutionKind::Error) {+    // Skip those fixes in case we are only attempting to check if it's possible+    // to insert an explicit call in an anchor expr that produces a callable+    // value.+    if (locator.isForImplicitApplyCallableValue())

As I see it the logic here would be to:

  • Use performMemberLookup to form a member set, add a "fallback" choice like "don't do anything but apply a fix (e.g. ContextualMismatch one)
  • Construct an ApplicableFunction constraint to imitate presence of a missing call.

This way if any of the choices found by lookup produce other fixes they'd be considered a worse solution vs. the "fallback".

LucianoPAlmeida

comment created time in 9 hours

Pull request review commentapple/swift

[SR-13503] [Sema] Special InsertExplicitCall for nominal callable types

 ConstraintSystem::TypeMatchResult constraints::matchCallArguments(     if (!callArgumentMatch)       return cs.getTypeMatchFailure(locator); +    // When checking to see if the callable value can be explicit called to+    // produce the expected type, we need to make sure that we fail here for+    // missing argument (which normally have fix recorded in argument tracker)+    // except if all parameters have a default values.

This is going to be tricky because we'd effectively have to combine (or coalesce) missing arguments with missing call fix to make it work. I think we'd need some test cases to make sure that if this happens diagnostic logic wouldn't crash since there is no call :)

LucianoPAlmeida

comment created time in 9 hours

PullRequestReviewEvent
PullRequestReviewEvent

Pull request review commentapple/swift

[Diag] Print the diagnostic ID name from localization

 bool SerializedLocalizationWriter::emit(llvm::StringRef filePath) {   return OS.has_error(); } +llvm::StringRef+LocalizationProducer::getMessageOr(swift::DiagID id,

Sounds good!

HassanElDesouky

comment created time in 9 hours

Pull request review commentapple/swift

[Diag] Print the diagnostic ID name from localization

 bool SerializedLocalizationWriter::emit(llvm::StringRef filePath) {   return OS.has_error(); } +llvm::StringRef+LocalizationProducer::getMessageOr(swift::DiagID id,+                                   llvm::StringRef defaultMessage) const {+  auto localizedMessage = getMessage(id);+  if (localizedMessage.empty())+    return defaultMessage;+  llvm::StringRef diagnosticName(diagnosticNameStrings[(unsigned)id]);+  const std::string &localizedDebugDiagnosticMessage =+      localizedMessage.str() + diagnosticName.str();

@owenv is correct here, furthermore this method can no longer return a StringRef because localizedDebugDiagnosticMessage would get freed right after getMessageOr returns.

HassanElDesouky

comment created time in 9 hours

PullRequestReviewEvent

Pull request review commentapple/swift

[SR-13503] [Sema] Special InsertExplicitCall for nominal callable types

 ConstraintSystem::simplifyApplicableFnConstraint(       type1, origType2, subflags, locator);    if (shouldAttemptFixes() && result == SolutionKind::Error) {+    // Skip those fixes in case we are only attempting to check if it's possible+    // to insert an explicit call in an anchor expr that produces a callable+    // value.+    if (locator.isForImplicitApplyCallableValue())

Yeah, we'd probably need to do a lookup as part of a fix and adjust the overload set to have that "fallback" choice.

LucianoPAlmeida

comment created time in a day

PullRequestReviewEvent

Pull request review commentapple/swift

[SR-13503] [Sema] Special InsertExplicitCall for nominal callable types

 ConstraintSystem::TypeMatchResult constraints::matchCallArguments(     if (!callArgumentMatch)       return cs.getTypeMatchFailure(locator); +    // When checking to see if the callable value can be explicit called to+    // produce the expected type, we need to make sure that we fail here for+    // missing argument (which normally have fix recorded in argument tracker)+    // except if all parameters have a default values.

bq. Not really sure, that would mean a fix for a declaration like func callAsFunction(a: Int) -> Int { 0 } would be (a: <#editor placeholder#>)?

Yeah, that's exactly how I see it.

LucianoPAlmeida

comment created time in a day

push eventapple/swift

Pavel Yaskevich

commit sha 340d1e843a43663c71119019e05fa0691034be1a

[ConstraintSystem] Record trailing choice match choice when arguments/result are equivalent to applied function

view details

Pavel Yaskevich

commit sha a0a37d2a713731c22e2e0f9c39f817943aeae97c

Merge pull request #34356 from xedin/record-trailing-even-if-types-are-equal [ConstraintSystem] Record trailing choice match choice when arguments…

view details

push time in 2 days

PR merged apple/swift

[ConstraintSystem] Record trailing choice match choice when arguments…

…/result are equivalent to applied function

<!-- Before merging this pull request, you must run the Swift continuous integration tests. For information about triggering CI builds via @swift-ci, see: https://github.com/apple/swift/blob/master/docs/ContinuousIntegration.md#swift-ci

Thank you for your contribution to Swift! -->

+58 -9

2 comments

3 changed files

xedin

pr closed time in 2 days

Pull request review commentapple/swift

[ConstraintSystem] Record trailing choice match choice when arguments…

 ConstraintSystem::simplifyApplicableFnConstraint(   ConstraintLocatorBuilder outerLocator =     getConstraintLocator(anchor, parts, locator.getSummaryFlags()); +  // If the types are obviously equivalent, we're done. This optimization+  // is not valid for operators though, where an inout parameter does not+  // have an explicit inout argument.+  if (type1.getPointer() == desugar2) {+    if (!isOperator || !hasInOut()) {+      recordTrailingClosureMatch(+          getConstraintLocator(+              outerLocator.withPathElement(ConstraintLocator::ApplyArgument)),+          TrailingClosureMatching::Forward);

Yeah, forward is the default one. It has be to present always otherwise ExprRewriter::coerceCallArguments is going to fail here - https://github.com/apple/swift/blob/main/lib/Sema/CSApply.cpp#L5569

xedin

comment created time in 2 days

PullRequestReviewEvent

pull request commentapple/swift

[ConstraintSystem] Record trailing choice match choice when arguments…

@swift-ci please smoke test

xedin

comment created time in 2 days

pull request commentapple/swift

[ConstraintSystem] Record trailing choice match choice when arguments…

I don't think it's possible to hit this with current constraint generation because ConstraintGenerator::visitApplyExpr would always introduce a type variable for a result but I hit this while working on some changes where subtyping is not supported for result types. Good use-case for a unit test :)

xedin

comment created time in 2 days

PR opened apple/swift

Reviewers
[ConstraintSystem] Record trailing choice match choice when arguments…

…/result are equivalent to applied function

<!-- Before merging this pull request, you must run the Swift continuous integration tests. For information about triggering CI builds via @swift-ci, see: https://github.com/apple/swift/blob/master/docs/ContinuousIntegration.md#swift-ci

Thank you for your contribution to Swift! -->

+58 -9

0 comment

3 changed files

pr created time in 2 days

create barnchxedin/swift

branch : record-trailing-even-if-types-are-equal

created branch time in 2 days

push eventapple/swift

Pavel Yaskevich

commit sha 17f7ad82cac717a0be4e8417a136348fb0365ca9

[CSBindings] Record all of the protocol requirements (not just literal)

view details

Pavel Yaskevich

commit sha 0c51159228992019f029530844d7c482256b2ed2

[CSBindings] Record constraint associated with a subtype relationship While inferring bindings, let's record not only the fact that current type variable is a subtype of some other type variable but track constraint which establishes this relationship.

view details

Pavel Yaskevich

commit sha a9cce605a4a4062366ce7c4ef2afedd055e79f2c

[CSBindings] Shrink binding "sources" to supertype and equivalence only Instead of recording all of the binding "sources" let's only record subtype, supertype and equivalence relationships which didn't materialize as bindings (because other side is a type variable). This is the only information necessary to infer transitive bindings and protocol requirements.

view details

Pavel Yaskevich

commit sha d011bf3d7d72adc8235d336a202241f8cda62971

[CSBindings] Implement transtive protocol requirement inference Implements iterative protocol requirement inference through subtype, conversion and equivalence relationships. This algorithm doesn't depend on a type variable finalization order (which is currently the order of type variable introduction). If a given type variable doesn't yet have its transitive protocol requirements inferred, algorithm would use iterative depth-first walk through its supertypes and equivalences and incrementally infer transitive protocols for each type variable involved, transferring new information down the chain e.g. T1 T3 \ / T4 T5 \ / T2 Here `T1`, `T3` are supertypes of `T4`, `T4` and `T5` are supertypes of `T2`. Let's assume that algorithm starts at `T2` and none of the involved type variables have their protocol requirements inferred yet. First, it would consider supertypes of `T2` which are `T4` and `T5`, since `T5` is the last in the chain algorithm would transfer its direct protocol requirements to `T2`. `T4` has supertypes `T1` and `T3` - they transfer their direct protocol requirements to `T4` and `T4` transfers its direct and transitive (from `T1` and `T3`) protocol requirements to `T2`. At this point all the type variables in subtype chain have their transitive protocol requirements resolved and cached so they don't have to be re-inferred later.

view details

Pavel Yaskevich

commit sha 5dc9919aff788fc71ab69603db997f0a45ca258e

[ConstraintSystem] NFC: Make `SemaTest` a friend of `ConstraintSystem` This is necessary in order to have access to private members of a `ConstraintSystem` for testing purposes, such as logic related to potential binding computation.

view details

Pavel Yaskevich

commit sha 1aecea17e41bde3508326c9ae72c47b432ed5c15

[unittest/Sema] Add a helper method to infer bindings for a given type variable This mimics what `determineBestBindings` does but without sorting.

view details

Pavel Yaskevich

commit sha a24383112214c2a23a2008f5b704a0acb513b9fe

[unittest/Sema] Add a test-case for a single hop protocol requirement inference In situations like: `$T0 <convertible> $T1` `$T1 <conforms to> P` `$T0` should know about `P` as a transitive protocol requirement.

view details

Pavel Yaskevich

commit sha 8024b7bef3a3907299656eab5c0dc9ac844a5d05

[CSBindings] Improve equivalence class handling in transitive protocol inference Let all of the members of the equivalence class be represented by the first type variable encountered during the depth-first walk. This means that supertypes are inferred from the members and all of the transitive protocol requirements are distributed among the members upon return back to the "representative".

view details

Pavel Yaskevich

commit sha a3c3981a68f9672e48823fda0661c06df5c9fbc3

[unittest/Sema] NFC: Add a way to create a protocol with a given name and parent type

view details

Pavel Yaskevich

commit sha 9598f1984833a76aaa38cdb080bf997e28dacd1b

[unittest/Sema] Cover transitive protocol inference with unit tests

view details

Pavel Yaskevich

commit sha 59e8043cb97a1ea096eec92a87dda15106ab54e5

Merge pull request #34278 from xedin/transitive-protocol-inference [CSBindings] Implement transtive protocol requirement inference

view details

push time in 2 days

PR merged apple/swift

[CSBindings] Implement transtive protocol requirement inference

Implements iterative protocol requirement inference through subtype, conversion and equivalence relationships.

This algorithm doesn't depend on a type variable finalization order (which is currently the order of type variable introduction).

If a given type variable doesn't yet have its transitive protocol requirements inferred, algorithm would use iterative depth-first walk through its supertypes and equivalences and incrementally infer transitive protocols for each type variable involved, transferring new information down the chain e.g.

  T1   T3
   \   /
    T4    T5
     \    /
       T2

Here T1, T3 are supertypes of T4, T4 and T5 are supertypes of T2.

Let's assume that algorithm starts at T2 and none of the involved type variables have their protocol requirements inferred yet.

First, it would consider supertypes of T2 which are T4 and T5, since T5 is the last in the chain algorithm would transfer its direct protocol requirements to T2. T4 has supertypes T1 and T3 - they transfer their direct protocol requirements to T4 and T4 transfers its direct and transitive (from T1 and T3) protocol requirements to T2. At this point all the type variables in subtype chain have their transitive protocol requirements resolved and cached so they don't have to be re-inferred later.

<!-- Before merging this pull request, you must run the Swift continuous integration tests. For information about triggering CI builds via @swift-ci, see: https://github.com/apple/swift/blob/master/docs/ContinuousIntegration.md#swift-ci

Thank you for your contribution to Swift! -->

+412 -50

10 comments

5 changed files

xedin

pr closed time in 2 days

pull request commentapple/swift

[CSBindings] Implement transtive protocol requirement inference

Going to re-run smoke test just in case...

xedin

comment created time in 2 days

pull request commentapple/swift

[CSBindings] Implement transtive protocol requirement inference

@swift-ci please smoke test

xedin

comment created time in 2 days

Pull request review commentapple/swift

[CodeCompletion][Sema] Allow missing args when solving if the completion location indicates the user may intend to write them later.

 class AllowClosureParamDestructuring final : public ConstraintFix {                                                 ConstraintLocator *locator); }; +struct SynthesizedArg {+  unsigned paramIdx;+  AnyFunctionType::Param param;+};+

That works for me, thank you!

nathawes

comment created time in 5 days

PullRequestReviewEvent

Pull request review commentapple/swift

[CodeCompletion][Sema] Allow missing args when solving if the completion location indicates the user may intend to write them later.

 static bool fixMissingArguments(ConstraintSystem &cs, ASTNode anchor,         cs.createTypeVariable(argLoc, TVO_CanBindToNoEscape)));   } -  SmallVector<std::pair<unsigned, AnyFunctionType::Param>, 4> synthesizedArgs;+  SmallVector<SynthesizedArg, 4> synthesizedArgs;   synthesizedArgs.reserve(numMissing);   for (unsigned i = args.size() - numMissing, n = args.size(); i != n; ++i) {-    synthesizedArgs.push_back(std::make_pair(i, args[i]));+    synthesizedArgs.push_back(SynthesizedArg{i, None, args[i]});   } -  auto *fix = AddMissingArguments::create(cs, synthesizedArgs,-                                          cs.getConstraintLocator(locator));+  bool shouldFix = true; -  if (cs.recordFix(fix))-    return true;+  // Treat missing anonymous arguments as valid in closures containing the+  // code completion location, since they may have just not been written yet.+  if (cs.isForCodeCompletion()) {+    if (auto *closure = getAsExpr<ClosureExpr>(anchor)) {+      SourceManager &SM = closure->getASTContext().SourceMgr;+      SourceRange range = closure->getSourceRange();+      if (range.isValid() && SM.rangeContainsCodeCompletionLoc(range)) {+        shouldFix = !closure->hasAnonymousClosureVars() &&+          (!args.empty() || closure->getInLoc().isValid());

Yeah, I think that should be okay.

nathawes

comment created time in 5 days

PullRequestReviewEvent
PullRequestReviewEvent

Pull request review commentapple/swift

[CodeCompletion][Sema] Allow missing args when solving if the completion location indicates the user may intend to write them later.

 static bool fixMissingArguments(ConstraintSystem &cs, ASTNode anchor,         cs.createTypeVariable(argLoc, TVO_CanBindToNoEscape)));   } -  SmallVector<std::pair<unsigned, AnyFunctionType::Param>, 4> synthesizedArgs;+  SmallVector<SynthesizedArg, 4> synthesizedArgs;   synthesizedArgs.reserve(numMissing);   for (unsigned i = args.size() - numMissing, n = args.size(); i != n; ++i) {-    synthesizedArgs.push_back(std::make_pair(i, args[i]));+    synthesizedArgs.push_back(SynthesizedArg{i, None, args[i]});   } -  auto *fix = AddMissingArguments::create(cs, synthesizedArgs,-                                          cs.getConstraintLocator(locator));+  bool shouldFix = true; -  if (cs.recordFix(fix))-    return true;+  // Treat missing anonymous arguments as valid in closures containing the+  // code completion location, since they may have just not been written yet.+  if (cs.isForCodeCompletion()) {+    if (auto *closure = getAsExpr<ClosureExpr>(anchor)) {+      SourceManager &SM = closure->getASTContext().SourceMgr;+      SourceRange range = closure->getSourceRange();+      if (range.isValid() && SM.rangeContainsCodeCompletionLoc(range)) {+        shouldFix = !closure->hasAnonymousClosureVars() &&+          (!args.empty() || closure->getInLoc().isValid());

Maybe an early return here in reverse situation instead?

nathawes

comment created time in 5 days

PullRequestReviewEvent

Pull request review commentapple/swift

[CodeCompletion][Sema] Allow missing args when solving if the completion location indicates the user may intend to write them later.

 class ArgumentFailureTracker : public MatchCallArgumentListener {   getExtraneousArguments() const {     return ExtraArguments;   }++private:+  bool areMissingArgsInvalid(ConstraintLocator *locator) {

Or even better - ignore missing argument recorded if it comes after the token that way destructor of the ArgumentFailureTracker could stay untouched?

nathawes

comment created time in 5 days

PullRequestReviewEvent

Pull request review commentapple/swift

[CodeCompletion][Sema] Allow missing args when solving if the completion location indicates the user may intend to write them later.

 class ArgumentFailureTracker : public MatchCallArgumentListener {   getExtraneousArguments() const {     return ExtraArguments;   }++private:+  bool areMissingArgsInvalid(ConstraintLocator *locator) {

Maybe we should convert this into a filter over MissingArguments in argument tracker instead and only record the ones which come before the token?

nathawes

comment created time in 5 days

PullRequestReviewEvent

pull request commentapple/swift

[SR-13732] [Sema] Fix crash on simplifyFix constraint for tuple mismatch

@swift-ci please smoke test

LucianoPAlmeida

comment created time in 5 days

PullRequestReviewEvent

Pull request review commentapple/swift

[SR-13732] [Sema] Fix crash on simplifyFix constraint for tuple mismatch

 bool ConstraintSystem::recordFix(ConstraintFix *fix, unsigned impact) {   return false; } -void ConstraintSystem::recordPotentialHole(TypeVariableType *typeVar) {-  assert(typeVar);-  typeVar->getImpl().enableCanBindToHole(getSavedBindings());-}--void ConstraintSystem::recordPotentialHole(FunctionType *fnType) {-  assert(fnType);-  Type(fnType).visit([&](Type type) {+void ConstraintSystem::recordPotentialHole(Type type) {+  assert(type->isTypeVariableOrMember() || type->is<FunctionType>());

I think the only check you need here is hasTypeVariable

LucianoPAlmeida

comment created time in 5 days

PullRequestReviewEvent
PullRequestReviewEvent

Pull request review commentapple/swift

[SR-13503] [Sema] Special InsertExplicitCall for nominal callable types

 CUSTOM_LOCATOR_PATH_ELT(ArgumentAttribute) /// The result of a chain of member accesses off an UnresolvedMemberExpr SIMPLE_LOCATOR_PATH_ELT(UnresolvedMemberChainResult) +/// A reference or expression that results in value of a callable type either @dynamicCallable+/// or that defines one or more \c callAsFunction methods.+SIMPLE_LOCATOR_PATH_ELT(ImplicitApplyCallableValue)

Maybe - ImplicitCallOfCallableValue?

LucianoPAlmeida

comment created time in 5 days

Pull request review commentapple/swift

[SR-13503] [Sema] Special InsertExplicitCall for nominal callable types

 ConstraintSystem::simplifyApplicableFnConstraint(       type1, origType2, subflags, locator);    if (shouldAttemptFixes() && result == SolutionKind::Error) {+    // Skip those fixes in case we are only attempting to check if it's possible+    // to insert an explicit call in an anchor expr that produces a callable+    // value.+    if (locator.isForImplicitApplyCallableValue())

If I understand it correctly, all of the checks for isForImplicitApplyCallableValue sprinkled around the code are necessary because there is no way to come back to a generic "fix" for a type mismatch?... If that's the same then the solution would be to add one more option to the overload set for explicit call which would just register that generic fix and do nothing else - that way we don't need any special handling for call overloads which didn't match...

LucianoPAlmeida

comment created time in 5 days

Pull request review commentapple/swift

[SR-13503] [Sema] Special InsertExplicitCall for nominal callable types

 bool ConstraintSystem::simplifyAppliedOverloads(                                       numOptionalUnwraps, locator); } +static ConstraintFix *+fixImplicitApplyCallableValue(ConstraintSystem &cs, Type dstType,+                         ConstraintLocatorBuilder locator) {

Nit: formatting.

LucianoPAlmeida

comment created time in 5 days

PullRequestReviewEvent

Pull request review commentapple/swift

[SR-13503] [Sema] Special InsertExplicitCall for nominal callable types

 ConstraintSystem::TypeMatchResult constraints::matchCallArguments(     if (!callArgumentMatch)       return cs.getTypeMatchFailure(locator); +    // When checking to see if the callable value can be explicit called to+    // produce the expected type, we need to make sure that we fail here for+    // missing argument (which normally have fix recorded in argument tracker)+    // except if all parameters have a default values.

Let's rephrase this a bit:

If this is a call formed by a fix to attempt explicit call of a callable type to see if that would match expected contextual type, let's fail if some of the expected arguments are missing.

But I also don't fully understand why do we want to do that? I think the idea where would be to suggest adding a call and missing arguments, no? I guess we'd just need to adjust a fix for synthesized arguments to handle implicit calls to support that...

LucianoPAlmeida

comment created time in 5 days

Pull request review commentapple/swift

[SR-13503] [Sema] Special InsertExplicitCall for nominal callable types

 bool ConstraintSystem::simplifyAppliedOverloadsImpl(   if (hasUnhandledConstraints)     return false; +  // If we are only checking for the possibility of calling this value to+  // produce a value of expected type, adding this contraint doesn't help.+  if (locator.isForImplicitApplyCallableValue())

It might not help but I suspect it also hurts something if we have to do this explicitly? :)

LucianoPAlmeida

comment created time in 5 days

Pull request review commentapple/swift

[SR-13503] [Sema] Special InsertExplicitCall for nominal callable types

 class SpecifyContextualTypeForNil final : public ConstraintFix {                                              ConstraintLocator * locator); }; +class InsertCallableValueExplicitCall final : public ConstraintFix {

Could we re-use InsertExplicitCall for this instead of adding a new fix/diagnostic?

LucianoPAlmeida

comment created time in 5 days

Pull request review commentapple/swift

[SR-13732] [Sema] Fix crash on simplifyFix constraint for tuple mismatch

 ConstraintSystem::SolutionKind ConstraintSystem::simplifyFixConstraint(         else           newTupleTypes.push_back(smallerElt);       } else {-        if (largerElt.getType()->isTypeVariableOrMember())-          recordPotentialHole(largerElt.getType()->getAs<TypeVariableType>());+        if (largerElt.getType()->isTypeVariableOrMember()) {+          Type eltType = largerElt.getType();+          if (auto depMember = eltType->getAs<DependentMemberType>()) {+            eltType = depMember->getBase();

I was trying to avoid adding recordPotentialHole(Type) but I guess we don't have a choice, this would also mean that it supersedes both existing ones.

LucianoPAlmeida

comment created time in 5 days

PullRequestReviewEvent

Pull request review commentapple/swift

[SR-13732] [Sema] Fix crash on simplifyFix constraint for tuple mismatch

 ConstraintSystem::SolutionKind ConstraintSystem::simplifyFixConstraint(         else           newTupleTypes.push_back(smallerElt);       } else {-        if (largerElt.getType()->isTypeVariableOrMember())-          recordPotentialHole(largerElt.getType()->getAs<TypeVariableType>());+        if (largerElt.getType()->isTypeVariableOrMember()) {+          Type eltType = largerElt.getType();+          if (auto depMember = eltType->getAs<DependentMemberType>()) {+            eltType = depMember->getBase();

Ah it checks in the base type too... We might want to have a version of recordPotentialHole which asserts and uses Type::visit

LucianoPAlmeida

comment created time in 5 days

PullRequestReviewEvent

Pull request review commentapple/swift

[SR-13732] [Sema] Fix crash on simplifyFix constraint for tuple mismatch

 ConstraintSystem::SolutionKind ConstraintSystem::simplifyFixConstraint(         else           newTupleTypes.push_back(smallerElt);       } else {-        if (largerElt.getType()->isTypeVariableOrMember())-          recordPotentialHole(largerElt.getType()->getAs<TypeVariableType>());+        if (largerElt.getType()->isTypeVariableOrMember()) {+          Type eltType = largerElt.getType();+          if (auto depMember = eltType->getAs<DependentMemberType>()) {+            eltType = depMember->getBase();

I think it’s only an immediate one is isTypeVariableOrMember.

LucianoPAlmeida

comment created time in 5 days

PullRequestReviewEvent
PullRequestReviewEvent

pull request commentapple/swift

[CSBindings] Implement transtive protocol requirement inference

@swift-ci please test Windows platform

xedin

comment created time in 6 days

Pull request review commentapple/swift

[Diag] Print the diagnostic ID name from localization

 void DiagnosticEngine::emitDiagnostic(const Diagnostic &diagnostic) { llvm::StringRef DiagnosticEngine::diagnosticStringFor(const DiagID id,                                       bool printDiagnosticName) {-  // TODO: Print diagnostic names from `localization`.-  if (printDiagnosticName) {-    return debugDiagnosticStrings[(unsigned)id];-  }   auto defaultMessage = diagnosticStrings[(unsigned)id];+  auto diagnosticName = diagnosticNameStrings[(unsigned)id];   if (localization) {     auto localizedMessage =         localization.get()->getMessageOr(id, defaultMessage);+    if (printDiagnosticName) {

Yes, that's right

HassanElDesouky

comment created time in 6 days

PullRequestReviewEvent

Pull request review commentapple/swift

[Diag] Print the diagnostic ID name from localization

 void DiagnosticEngine::emitDiagnostic(const Diagnostic &diagnostic) { llvm::StringRef DiagnosticEngine::diagnosticStringFor(const DiagID id,                                       bool printDiagnosticName) {-  // TODO: Print diagnostic names from `localization`.-  if (printDiagnosticName) {-    return debugDiagnosticStrings[(unsigned)id];-  }   auto defaultMessage = diagnosticStrings[(unsigned)id];+  auto diagnosticName = diagnosticNameStrings[(unsigned)id];   if (localization) {     auto localizedMessage =         localization.get()->getMessageOr(id, defaultMessage);+    if (printDiagnosticName) {

I mean we could infer whether names should be printed or not during producer construction, that way we don't need to add any parameters to getMessageOf.

HassanElDesouky

comment created time in 6 days

PullRequestReviewEvent

pull request commentapple/swift

[CSBindings] Implement transtive protocol requirement inference

@swift-ci please test source compatibility debug

xedin

comment created time in 6 days

pull request commentapple/swift

[CSBindings] Implement transtive protocol requirement inference

@swift-ci please test

xedin

comment created time in 6 days

Pull request review commentapple/swift

[Diag] Print the diagnostic ID name from localization

 void DiagnosticEngine::emitDiagnostic(const Diagnostic &diagnostic) { llvm::StringRef DiagnosticEngine::diagnosticStringFor(const DiagID id,                                       bool printDiagnosticName) {-  // TODO: Print diagnostic names from `localization`.-  if (printDiagnosticName) {-    return debugDiagnosticStrings[(unsigned)id];-  }   auto defaultMessage = diagnosticStrings[(unsigned)id];+  auto diagnosticName = diagnosticNameStrings[(unsigned)id];   if (localization) {     auto localizedMessage =         localization.get()->getMessageOr(id, defaultMessage);+    if (printDiagnosticName) {

Can't localization producer just infer it in setLocalization instead?

HassanElDesouky

comment created time in 6 days

PullRequestReviewEvent

push eventxedin/swift

Keith Smiley

commit sha ae0c380f1b0f37e11b111a06634dd4c64e67b96c

Improve -*prefix-map help text Before: ``` -coverage-prefix-map <value> -debug-prefix-map <value> ``` After: ``` -coverage-prefix-map <prefix=replacement> -debug-prefix-map <prefix=replacement> ```

view details

Dave Lee

commit sha 52bbe11161f908d4c58cbdd2a423c68b9688b191

[build] Remove dash-dash from build-presets.ini (NFC)

view details

Arnold Schwaighofer

commit sha 96a0d0e5840045e25d2c05f02999972f804201df

Rename various IncludeUsableFromInlineAndInlineable to IncludeUsableFromInline `@inlinable` implies `@usableFromInline`. NFC intended.

view details

Doug Gregor

commit sha 21a0696e165747248ac5f4532feeb942e13e326b

[Concurrency] Clean up inference logic for @asyncHandler.

view details

Doug Gregor

commit sha dee5356021f49ea31954e3ecc2170d285d47804c

[Concurrency] Add inferred actor-isolation attributes. When we infer an actor-isolation attribute on a declaration, add an implicit attribute that will show up in the printed interface and get serialized. ... and clean up the type resolution logic for global actor attributes to make it use CustomAttrTypeRequest, so the result gets appropriately cached in CustomAttr for serialization.

view details

Doug Gregor

commit sha 4032cd8e7d4857dad9e07782212e30848580ca56

Rename CustomAttrTypeKind::PropertyDelegate to PropertyWrapper.

view details

Alexis Laferrière

commit sha e509d6883a068334df96f34ade141d8c38dfd1f0

Revert "[Sema] Fix availability checking in inlinable code"

view details

Xi Ge

commit sha 29093b15df24e98dda65cd51e26a7bd618a2d709

Driver: -L= belongs to the linker option group rdar://70300892

view details

Arnold Schwaighofer

commit sha a7259558238eadd1c69a234baef1b67ab45f8492

More renaming

view details

Arnold Schwaighofer

commit sha d6d921d7fafcfa67e500e6013f93ac30f6248b79

IRGen: Fix fixLifetime emission of enums rdar://70270724

view details

Robert Widmann

commit sha 6125d25cb4f5059f455b3c6f4bde70f6aa79f59e

[NFC] Silence Non-Exhaustive Switch Warnings on Windows

view details

Robert Widmann

commit sha 9c879c008e642278b2bce557db19b78ca391caad

Resolve Virtual Inheritance By Dominance By Being Explicit Since the alternative is name lookup selecting members from a pure virtual base, it's probably best to be explicit here.

view details

Alexis Laferrière

commit sha 0d8f689d1c50121c13980eadf7ee58917a930aef

Merge pull request #34306 from apple/revert-33855-availability-inlinable Revert "[Sema] Fix availability checking in inlinable code"

view details

Robert Widmann

commit sha ba737b563154e2e5261c57c482699d6ee8f4abf3

[NFC] Use an Explicit 64-Bit Shift

view details

Robert Widmann

commit sha 0d6a16258a1519b59644618be1ae2280476878ba

Silence a Deprecation Warning with FixedVectorType

view details

Saleem Abdulrasool

commit sha 78bc6aae363ff8e82d28aa7725c562ecf7e66ab2

Platform: link against Pathcch.lib when using pathcch.h The MSDN documentation indicates that you should link against the `Pathcch.lib` import library when using functions from `pathcch.h` which can also be verified by use functions failing to link due to unresolved symbols. Add the missing linking to enable autolinking for `WinSDK`.

view details

Arnold Schwaighofer

commit sha 1c85d201921abcedbd3a693229f597a6d015f81d

Try to appease 32bit tests

view details

Holly Borla

commit sha 1e0038c3be0f6f2fbe1ba6ccb7fa394b7320aa22

[ConstraintSystem] Remove implementation of operator designated types in the solver.

view details

Robert Widmann

commit sha 476890cac5224f1c9a2fcfee5a2267bd44d24466

Merge pull request #34312 from CodaFi/just-keep-passing-the-open-windows Silence a Raft of Warnings from the Windows Build

view details

Holly Borla

commit sha 4c0f49f7a6a7a642cd57aeec70e8b392f3296cf1

[ConstraintSystem] Remove selectApplyDisjunction, which was only used by the operator designated types implementation.

view details

push time in 6 days

push eventxedin/swift

Alexey Komnin

commit sha 4fa17bf59774ae6543a33b1a29f01320705f4dfe

SR-12022: refactor LiteralExpr to combine common initializer code

view details

Michael Gottesman

commit sha d3e6ffdbad9ed2af857508891a4530b7f11d4c6e

[lldb-toolbox] Add the ability to disassemble-to-file a specific function from a target without running the target. The routine already supports dumping the assembly to file if we are at a breakpoint using the current frame. This adds a -n option so one can without running just dump the assembly to a file of a specific function in a binary.

view details

Dave Lee

commit sha 27330f169df5d2dcb018ab2c6615d66be91d04e2

[build] Remove unused lldb cmake

view details

Anthony Latsis

commit sha 8f43d888b8fd88540c5ba3d770a857928ac0b3a7

Sema: Disallow usage of settable Self-returning storage requirements on existential base

view details

Mike Ash

commit sha 630aff7b19b80f29445b645424e20fd1bb6bd551

[Runtime] Change SimpleGlobalCache to use ConcurrentReadableHashMap instead of ConcurrentMap. This gives us faster lookups and a small advantage in memory usage. Most of these maps need stable addresses for their entries, so we add a level of indirection to ConcurrentReadableHashMap for these cases to accommodate that. This costs some extra memory, but it's still a net win. A new StableAddressConcurrentReadableHashMap type handles this indirection and adds a convenience getOrInsert to take advantage of it. ConcurrentReadableHashMap is tweaked to avoid any global constructors or destructors when using it as a global variable. ForeignWitnessTables does not need stable addresses and it now uses ConcurrentReadableHashMap directly. rdar://problem/70056398

view details

Daniel Rodríguez Troitiño

commit sha 8470a6624f08283719af2cbc6fdc10a2163d4888

[windows] Avoid %r for quoting module-cache-path in Windows. %r returns a representation of the object that is valid Python syntax. For numbers and strings this representation is very compatible with Unix shells, but for Windows, the quoting performed by Python will not be compatible. For example the Windows path separator `\` will be escaped as `\\`, which is not necessary for Windows and might make some tests that try to match path fail. Python 3.3 has `shlex.quote`, which was previously available as `pipes.quote` in earlier Python versions. `pipes.quote` was indeed used in several points of the `lit.cfg` file. For Windows, one need to do their own quoting. This change introduces `shell_quote` which uses `shlex.quote` or `pipes.quote` in Unix depending on the Python version, and provides an implementation of `shell_quote` for Windows. It replaces every usage of `pipes.quotes` for `shell_quote`, and modifies the value of `mcp_opt` to use `shell_quote` and not `%r`. This should fix the test `Driver\working-directory.swift` in the Windows Visual Studio 2017 builder.

view details

Slava Pestov

commit sha c5e138824544531fdf55935061afea1e999cc4b1

ASTScope: Remove cull()

view details

Slava Pestov

commit sha 89ea51e90ce69e62cd169b453db2e2d4d63b6728

ASTScope: Remove isLocalizable()

view details

Slava Pestov

commit sha ea9f84f66ee9f010cbedb2eff17e956ffe5db450

ASTScope: Remove addSiblingsToScopeTree()

view details

Slava Pestov

commit sha 885f6ebba3c39fe2b097631769b2ac8451e01e82

ASTScope: Rename addChildrenForAllLocalizableAccessorsInSourceOrder()

view details

Slava Pestov

commit sha b720c04f4b8f03dc93a00943ca9c3048f6305d42

ASTScope: Simplify a couple of getSourceRangeOfThisASTNode() methods

view details

Slava Pestov

commit sha 4b0d39c49d96c32f1ec0a1bdc8b54c9ef5c7365f

AST: Clean up and write better comments for source range assertions in addMember()

view details

Slava Pestov

commit sha ef26ecfb13754ca9d641bc2081410564ec4d0935

ASTScope: Allocate list of local bindings for BraceStmt in the ASTContext Scopes need to register cleanups for non-trivial ivars in the ASTContext. Instead of doing that here, let's just change the SmallVectors into ArrayRefs. Fixes <rdar://problem/69908937>.

view details

Doug Gregor

commit sha 98903b7cd2671e9147002b46b391a97885551202

[Concurrency] Add globalActor attribute. The globalActor attribute indicates that a particular type describes a global actor. Global actors allow the notion of actor state isolation to be spread across various declarations throughout a program, rather than being centered around a single actor class. There are useful primarily for existing notions such as "main thread" or subsystems accessed through global/singleton state.

view details

Doug Gregor

commit sha df883f89ad69c6e5f999614d476c38218081ef8a

[Concurrency] Allow global actor annotations on declarations. Global actor types can be used as attributes on various kinds of declarations to indicate that those declarations are part of the isolated state of that global actor. Allow such annotation and perform basic correctness checks.

view details

Alexis Laferrière

commit sha e61ffea42c943044fe4fc8c35d5040bc8815e420

[Sema] Check availability in inlinable code using the explicit version Inlinable functions can be inlined in clients with a lower OS target version than the framework defining the function. For this reason, the availability in inlinable functions should always be checked using the explicit introduction OS version as lower bound and not the minimum deployment version. rdar://problem/67975153

view details

Alexis Laferrière

commit sha 53e04cb39db86d890ff674b775a5dbda47e9d599

[Sema] Test explicit versions in TypeRefinementContext

view details

Alexis Laferrière

commit sha 2f182c2b785f5f7b68ee756d1474f21f3050ba67

[Sema] Consider unavailable functions as being unreachable This has the effect of rejecting unavailable overrides to available methods in a similar way as overrides that are less available than the introduction are rejected.

view details

Alexis Laferrière

commit sha 39ee5916bd656cf56c75ddf45a47e628d0ff1db1

[SIL] Don't print availability for unreachable/unavailable functions

view details

Alexis Laferrière

commit sha c79d5cfbd6952c5dc141a24db10a87d548bc5f4f

[Sema] Still use the current minimum deployment target as fallback

view details

push time in 6 days

Pull request review commentapple/swift

[Diag] Print the diagnostic ID name from localization

 void DiagnosticEngine::emitDiagnostic(const Diagnostic &diagnostic) { llvm::StringRef DiagnosticEngine::diagnosticStringFor(const DiagID id,                                       bool printDiagnosticName) {-  // TODO: Print diagnostic names from `localization`.-  if (printDiagnosticName) {-    return debugDiagnosticStrings[(unsigned)id];-  }   auto defaultMessage = diagnosticStrings[(unsigned)id];+  auto diagnosticName = diagnosticNameStrings[(unsigned)id];   if (localization) {     auto localizedMessage =         localization.get()->getMessageOr(id, defaultMessage);+    if (printDiagnosticName) {

I think it's a job of a localization producer to check that flag and produce expected message instead of diagnostic engine adding these postfixes explicitly. We should probably keep debugDiagnosticStrings around as a fallback too so we could do something like:

llvm::StringRef defaultMessage = printDiagnosticName 
                    ? debugDiagnosticStrings[(unsigned)id] 
                    : diagnosticNameStrings[(unsigned)id];

and pass it to getMessageOr.

HassanElDesouky

comment created time in 6 days

PullRequestReviewEvent
PullRequestReviewEvent
PullRequestReviewEvent

Pull request review commentapple/swift

[ConstraintSystem] Remove implementation of operator designated types in the solver.

 Constraint *ConstraintSystem::selectDisjunction() {   if (disjunctions.empty())     return nullptr; -  // Attempt apply disjunctions first. When we have operators with-  // designated types, this is important, because it allows us to-  // select all the preferred operator overloads prior to other-  // disjunctions that we may not be able to short-circuit, allowing-  // us to eliminate behavior that is exponential in the number of-  // operators in the expression.-  if (getASTContext().TypeCheckerOpts.SolverEnableOperatorDesignatedTypes) {-    if (auto *disjunction = selectApplyDisjunction())

I think selectApplyDisjunction could also be removed now right?

hborla

comment created time in 7 days

PullRequestReviewEvent

push eventapple/swift

Pavel Yaskevich

commit sha 9239692d00eb7a5362fe18f42dfcd9ddc687f45c

[unittests] Add a fixture for Sema unit tests

view details

Pavel Yaskevich

commit sha 0b22d91c9416e57a37829a6c471770e53f96fee2

[unittests] Extend Sema testing fixture to load stdlib (+ shims) Setup module importers, load stdlib, establish separate testing module and load a single main file there which imports standard library.

view details

Pavel Yaskevich

commit sha b2c31c394b02c0b2ae97f61e57daeeef8c770087

[unittests/Sema] Add an ability to retrieve stdlib types by name

view details

Pavel Yaskevich

commit sha dc7c9c2bfa0167180ec19f7a26029e16ef03dd60

[unittests/Sema] Add a simple integer literal type inference test

view details

Pavel Yaskevich

commit sha 6e470f5fcd55e94d5010e4621bec225314327f50

[unittest/Sema] NFC: Switch to use `AttributedImport` instead of deprecated `ImportedModuleDesc`

view details

Pavel Yaskevich

commit sha fde1af756d336cb4c22067c99fe2c83a3b026012

[unittest/Sema] Use default target triple to fix Windows build

view details

Pavel Yaskevich

commit sha 6a19d371663a4cb27975ab47c3653625862f21e5

Merge pull request #34286 from xedin/add-sema-unittest-fixture [unittests] Add a fixture for Sema unit tests

view details

push time in 8 days

PR merged apple/swift

Reviewers
[unittests] Add a fixture for Sema unit tests

Adds a SemaTest fixture which handles all book-keeping related to setting up environment and a simple literal binding inference test to demonstrate that everything works correctly.

<!-- Before merging this pull request, you must run the Swift continuous integration tests. For information about triggering CI builds via @swift-ci, see: https://github.com/apple/swift/blob/master/docs/ContinuousIntegration.md#swift-ci

Thank you for your contribution to Swift! -->

+205 -0

13 comments

6 changed files

xedin

pr closed time in 8 days

push eventapple/swift

Pavel Yaskevich

commit sha 2d6456c03e5d52372c628995f392bfc36f607a28

[ConstraintSystem] NFC: Remove obsolete `getPotentialBindings` declaration It has been related with `inferBindingsFor` but declaration was left in the header.

view details

Pavel Yaskevich

commit sha 1d8f07ac7d7e183a13bd65fcb01cb53bb6201732

Merge pull request #34288 from xedin/remove-getpotentialbindings-from-cs [ConstraintSystem] NFC: Remove obsolete `getPotentialBindings` declar…

view details

push time in 8 days

PR merged apple/swift

[ConstraintSystem] NFC: Remove obsolete `getPotentialBindings` declar…

…ation

It has been related with inferBindingsFor but declaration was left in the header.

<!-- Before merging this pull request, you must run the Swift continuous integration tests. For information about triggering CI builds via @swift-ci, see: https://github.com/apple/swift/blob/master/docs/ContinuousIntegration.md#swift-ci

Thank you for your contribution to Swift! -->

+0 -1

2 comments

1 changed file

xedin

pr closed time in 8 days

pull request commentapple/swift

[unittests] Add a fixture for Sema unit tests

@swift-ci please test macOS platform

xedin

comment created time in 8 days

Pull request review commentapple/swift

[unittests] Add a fixture for Sema unit tests

+//===--- SemaFixture.h - Helper for setting up Sema context -----*- C++ -*-===//+//+// This source file is part of the Swift.org open source project+//+// Copyright (c) 2014 - 2020 Apple Inc. and the Swift project authors+// Licensed under Apache License v2.0 with Runtime Library Exception+//+// See https://swift.org/LICENSE.txt for license information+// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors+//+//===----------------------------------------------------------------------===//++#include "swift/AST/ASTContext.h"+#include "swift/AST/DiagnosticEngine.h"+#include "swift/AST/Module.h"+#include "swift/AST/SourceFile.h"+#include "swift/AST/Type.h"+#include "swift/Basic/LangOptions.h"+#include "swift/Basic/Platform.h"+#include "swift/Basic/SourceManager.h"+#include "llvm/ADT/StringRef.h"+#include "llvm/ADT/SmallString.h"+#include "llvm/Support/Host.h"+#include "llvm/Support/Path.h"+#include "gtest/gtest.h"+#include <string>++namespace swift {+namespace unittest {++class SemaTestBase : public ::testing::Test {+public:+  LangOptions LangOpts;+  TypeCheckerOptions TypeCheckerOpts;+  SearchPathOptions SearchPathOpts;+  ClangImporterOptions ClangImporterOpts;+  SourceManager SourceMgr;+  DiagnosticEngine Diags;++  SemaTestBase() : Diags(SourceMgr) {+    LangOpts.Target = llvm::Triple(llvm::sys::getProcessTriple());++    llvm::SmallString<128> libDir(SWIFTLIB_DIR);+    llvm::sys::path::append(libDir, getPlatformNameForTriple(LangOpts.Target));

Thanks to @compnerd, we have figured that I should have used default target instead. Now everything is fine.

xedin

comment created time in 8 days

PullRequestReviewEvent

pull request commentapple/swift

[unittests] Add a fixture for Sema unit tests

@swift-ci please test macOS platform

xedin

comment created time in 8 days

pull request commentapple/swift

[unittests] Add a fixture for Sema unit tests

@swift-ci please test Linux platform

xedin

comment created time in 8 days

pull request commentapple/swift

[unittests] Add a fixture for Sema unit tests

@swift-ci please test Windows platform

xedin

comment created time in 8 days

pull request commentapple/swift

[unittests] Add a fixture for Sema unit tests

@swift-ci please test Windows platform

xedin

comment created time in 8 days

push eventxedin/swift

Pavel Yaskevich

commit sha fde1af756d336cb4c22067c99fe2c83a3b026012

[unittest/Sema] Use default target triple to fix Windows build

view details

push time in 8 days

pull request commentapple/swift

[unittests] Add a fixture for Sema unit tests

@swift-ci please test Windows platform

xedin

comment created time in 8 days

pull request commentapple/swift

[unittests] Add a fixture for Sema unit tests

@swift-ci please test Windows platform

xedin

comment created time in 8 days

push eventxedin/swift

Pavel Yaskevich

commit sha c6758d0b3910b7a72b41c8165535078ec7422f0d

Add some debug output to help figure out Windows failure without Windows machine...

view details

push time in 8 days

PullRequestReviewEvent

Pull request review commentapple/swift

[unittests] Add a fixture for Sema unit tests

+//===--- SemaFixture.h - Helper for setting up Sema context -----*- C++ -*-===//+//+// This source file is part of the Swift.org open source project+//+// Copyright (c) 2014 - 2020 Apple Inc. and the Swift project authors+// Licensed under Apache License v2.0 with Runtime Library Exception+//+// See https://swift.org/LICENSE.txt for license information+// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors+//+//===----------------------------------------------------------------------===//++#include "swift/AST/ASTContext.h"+#include "swift/AST/DiagnosticEngine.h"+#include "swift/AST/Module.h"+#include "swift/AST/SourceFile.h"+#include "swift/AST/Type.h"+#include "swift/Basic/LangOptions.h"+#include "swift/Basic/Platform.h"+#include "swift/Basic/SourceManager.h"+#include "llvm/ADT/StringRef.h"+#include "llvm/ADT/SmallString.h"+#include "llvm/Support/Host.h"+#include "llvm/Support/Path.h"+#include "gtest/gtest.h"+#include <string>++namespace swift {+namespace unittest {++class SemaTestBase : public ::testing::Test {+public:+  LangOptions LangOpts;+  TypeCheckerOptions TypeCheckerOpts;+  SearchPathOptions SearchPathOpts;+  ClangImporterOptions ClangImporterOpts;+  SourceManager SourceMgr;+  DiagnosticEngine Diags;++  SemaTestBase() : Diags(SourceMgr) {+    LangOpts.Target = llvm::Triple(llvm::sys::getProcessTriple());++    llvm::SmallString<128> libDir(SWIFTLIB_DIR);+    llvm::sys::path::append(libDir, getPlatformNameForTriple(LangOpts.Target));

It seems like it should work with my setup as well based on what lit.cfg has, maybe SWIFTLIB_DIR is not setup correctly by cmake on Windows...

xedin

comment created time in 8 days

PullRequestReviewEvent

pull request commentapple/swift

[ConstraintSystem] NFC: Remove obsolete `getPotentialBindings` declar…

@swift-ci please smoke test Linux platform

xedin

comment created time in 8 days

pull request commentapple/swift

[ConstraintSystem] NFC: Remove obsolete `getPotentialBindings` declar…

@swift-ci please smoke test

xedin

comment created time in 9 days

PR opened apple/swift

[ConstraintSystem] NFC: Remove obsolete `getPotentialBindings` declar…

…ation

It has been related with inferBindingsFor but declaration was left in the header.

<!-- Before merging this pull request, you must run the Swift continuous integration tests. For information about triggering CI builds via @swift-ci, see: https://github.com/apple/swift/blob/master/docs/ContinuousIntegration.md#swift-ci

Thank you for your contribution to Swift! -->

+0 -1

0 comment

1 changed file

pr created time in 9 days

create barnchxedin/swift

branch : remove-getpotentialbindings-from-cs

created branch time in 9 days

Pull request review commentapple/swift

[unittests] Add a fixture for Sema unit tests

+//===--- SemaFixture.h - Helper for setting up Sema context -----*- C++ -*-===//+//+// This source file is part of the Swift.org open source project+//+// Copyright (c) 2014 - 2020 Apple Inc. and the Swift project authors+// Licensed under Apache License v2.0 with Runtime Library Exception+//+// See https://swift.org/LICENSE.txt for license information+// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors+//+//===----------------------------------------------------------------------===//++#include "swift/AST/ASTContext.h"+#include "swift/AST/DiagnosticEngine.h"+#include "swift/AST/Module.h"+#include "swift/AST/SourceFile.h"+#include "swift/AST/Type.h"+#include "swift/Basic/LangOptions.h"+#include "swift/Basic/Platform.h"+#include "swift/Basic/SourceManager.h"+#include "llvm/ADT/StringRef.h"+#include "llvm/ADT/SmallString.h"+#include "llvm/Support/Host.h"+#include "llvm/Support/Path.h"+#include "gtest/gtest.h"+#include <string>++namespace swift {+namespace unittest {++class SemaTestBase : public ::testing::Test {+public:+  LangOptions LangOpts;+  TypeCheckerOptions TypeCheckerOpts;+  SearchPathOptions SearchPathOpts;+  ClangImporterOptions ClangImporterOpts;+  SourceManager SourceMgr;+  DiagnosticEngine Diags;++  SemaTestBase() : Diags(SourceMgr) {+    LangOpts.Target = llvm::Triple(llvm::sys::getProcessTriple());++    llvm::SmallString<128> libDir(SWIFTLIB_DIR);+    llvm::sys::path::append(libDir, getPlatformNameForTriple(LangOpts.Target));

I'm guessing that this doesn't work on Windows same way it does on macOS where stdlib module is located in lib/swift/macosx?

xedin

comment created time in 9 days

PullRequestReviewEvent

pull request commentapple/swift

[unittests] Add a fixture for Sema unit tests

@compnerd Does Windows have <build>/lib/swift directory with built stdlib and other modules or artifacts are placed differently there? I'd hate it if I had to limit this tests to macOS only but I have to way to figure this out on my own...

xedin

comment created time in 9 days

pull request commentapple/swift

[unittests] Add a fixture for Sema unit tests

@swift-ci please test Windows platform

xedin

comment created time in 9 days

pull request commentapple/swift

[unittests] Add a fixture for Sema unit tests

@swift-ci please clean test

xedin

comment created time in 9 days

push eventxedin/swift

Alexey Komnin

commit sha 4fa17bf59774ae6543a33b1a29f01320705f4dfe

SR-12022: refactor LiteralExpr to combine common initializer code

view details

Anthony Latsis

commit sha 8f43d888b8fd88540c5ba3d770a857928ac0b3a7

Sema: Disallow usage of settable Self-returning storage requirements on existential base

view details

Daniel Rodríguez Troitiño

commit sha 8470a6624f08283719af2cbc6fdc10a2163d4888

[windows] Avoid %r for quoting module-cache-path in Windows. %r returns a representation of the object that is valid Python syntax. For numbers and strings this representation is very compatible with Unix shells, but for Windows, the quoting performed by Python will not be compatible. For example the Windows path separator `\` will be escaped as `\\`, which is not necessary for Windows and might make some tests that try to match path fail. Python 3.3 has `shlex.quote`, which was previously available as `pipes.quote` in earlier Python versions. `pipes.quote` was indeed used in several points of the `lit.cfg` file. For Windows, one need to do their own quoting. This change introduces `shell_quote` which uses `shlex.quote` or `pipes.quote` in Unix depending on the Python version, and provides an implementation of `shell_quote` for Windows. It replaces every usage of `pipes.quotes` for `shell_quote`, and modifies the value of `mcp_opt` to use `shell_quote` and not `%r`. This should fix the test `Driver\working-directory.swift` in the Windows Visual Studio 2017 builder.

view details

Slava Pestov

commit sha c5e138824544531fdf55935061afea1e999cc4b1

ASTScope: Remove cull()

view details

Slava Pestov

commit sha 89ea51e90ce69e62cd169b453db2e2d4d63b6728

ASTScope: Remove isLocalizable()

view details

Slava Pestov

commit sha ea9f84f66ee9f010cbedb2eff17e956ffe5db450

ASTScope: Remove addSiblingsToScopeTree()

view details

Slava Pestov

commit sha 885f6ebba3c39fe2b097631769b2ac8451e01e82

ASTScope: Rename addChildrenForAllLocalizableAccessorsInSourceOrder()

view details

Slava Pestov

commit sha b720c04f4b8f03dc93a00943ca9c3048f6305d42

ASTScope: Simplify a couple of getSourceRangeOfThisASTNode() methods

view details

Slava Pestov

commit sha 4b0d39c49d96c32f1ec0a1bdc8b54c9ef5c7365f

AST: Clean up and write better comments for source range assertions in addMember()

view details

Slava Pestov

commit sha ef26ecfb13754ca9d641bc2081410564ec4d0935

ASTScope: Allocate list of local bindings for BraceStmt in the ASTContext Scopes need to register cleanups for non-trivial ivars in the ASTContext. Instead of doing that here, let's just change the SmallVectors into ArrayRefs. Fixes <rdar://problem/69908937>.

view details

Doug Gregor

commit sha 98903b7cd2671e9147002b46b391a97885551202

[Concurrency] Add globalActor attribute. The globalActor attribute indicates that a particular type describes a global actor. Global actors allow the notion of actor state isolation to be spread across various declarations throughout a program, rather than being centered around a single actor class. There are useful primarily for existing notions such as "main thread" or subsystems accessed through global/singleton state.

view details

Doug Gregor

commit sha df883f89ad69c6e5f999614d476c38218081ef8a

[Concurrency] Allow global actor annotations on declarations. Global actor types can be used as attributes on various kinds of declarations to indicate that those declarations are part of the isolated state of that global actor. Allow such annotation and perform basic correctness checks.

view details

Erik Eckstein

commit sha aced5c74df5804b7c567a1ae9cf68b7e9cb336ee

SILOptimizer: Remove InspectionMode from MemBehehaviorVisitor The InspectionMode was never set to anything else than "IgnoreRetains"

view details

Erik Eckstein

commit sha d4a6bd39b686307028b850d25a2a2fbc337160a3

SILOptimizer: improve MemBehavior for apply instructions. 1. Do a better alias analysis for "function-local" objects, like alloc_stack and inout parameters 2. Fully support try_apply and begin/end/abort_apply So far we fully relied on escape analysis. But escape analysis has some shortcomings with SIL address-types. Therefore, handle two common cases, alloc_stack and inout parameters, with alias analysis. This gives better results. The biggest change here is to do a quick check if the address escapes via an address_to_pointer instructions.

view details

Erik Eckstein

commit sha 9f85cb8576becac281397e967e67ec44e5aabc5b

TempRValueElimination: handle potential modifications of the copy-source in a called functions correctly. This fixes a miscompile in case the source of the optimized copy_addr is modified in a called function with to a not visible alias. This can happen with class properties or global variables. This fix removes the special handling of function parameters, which was just wrong. Instead it simply uses the alias analysis API to check for modifications of the source object. The fix makes TempRValueElimination more conservative and this can cause some performance regressions, but this is unavoidable. rdar://problem/69605657

view details

Erik Eckstein

commit sha 68f485424c2b655075c77877acc9ed05756c5d08

SILOptimizer: add an additional TempRValueOpt pass later in the pipeline. This can compensate the performance regression of the more conservative handling of function calls in TempRValueOpt (see previous commit). The pass runs after the inlining passes and can therefore optimize in some cases where it's not possible before inlining.

view details

Doug Gregor

commit sha 77584928da319b285a9f37b88ffce41dcc77b9a2

[Concurrency] Implement global actor isolation rules. Extend the actor isolation checking rules to account for global actors. For example, a function annotated with a given global actor can invoke synchronous methods from the same global actor, but not from a different global actor or a particular actor instance. Similarly, a method of an (instance) actor that is annotated with a global actor attribute is not part of the (instance) actor and, therefore, cannot operate on its actor-isolated state.

view details

Robert Widmann

commit sha 0ba4e338d41700b2a3f8cee2fb0c0d0e9b5d8d02

[NFC] Lambda-fy an Assertion

view details

Robert Widmann

commit sha 3cc1dbb63597745509f346fcc2c38d5dfea73a67

Drop a Needless Reset of An Inherited Type For enums with broken raw representable bounds, we should aim to make derivation tolerant of the error state rather than work around it in TypeCheckDeclPrimary. This is the last user of the MutableArrayRef form of the inheritance clauses. Those will be removed in the subsequent commit.

view details

Robert Widmann

commit sha ff8d5bc2c8347771061bb1a3ff303225e8f7ac1f

[NFC] MutableArrayRef<TypeLoc> -> ArrayRef<TypeLoc> The first step on the road to splitting the semantic type information here from the syntactic information in the other half of the TypeLoc.

view details

push time in 9 days

more