Commit Graph

12 Commits

Author SHA1 Message Date
Tony Allevato
5fe10ce86a ASTDumper: Label "interface type" -> "interface_type". 2025-01-29 13:55:00 -05:00
Allan Shortlidge
75bad99f78 Tests: Remove -disable-availability-checking in Distributed tests.
Use the `%target-swift-5.X-abi-triple` substitutions to compile the tests for
deployment to the minimum OS versions required for the APIs used in the tests,
instead of disabling availability checking.
2024-10-20 09:07:13 -07:00
Konrad `ktoso` Malawski
04f589fea9 Disable flaky distributed_actor_executor_ast.swift while we investigate
Disable while we investigate rdar://114453974
2023-09-21 08:15:16 -05:00
Becca Royal-Gordon
8770c7f826 Rework ASTDumper (#68438)
This PR refactors the ASTDumper to make it more structured, less mistake-prone, and more amenable to future changes. For example:

```cpp
  // Before:
  void visitUnresolvedDotExpr(UnresolvedDotExpr *E) {
    printCommon(E, "unresolved_dot_expr")
      << " field '" << E->getName() << "'";
    PrintWithColorRAII(OS, ExprModifierColor)
      << " function_ref=" << getFunctionRefKindStr(E->getFunctionRefKind());
    if (E->getBase()) {
      OS << '\n';
      printRec(E->getBase());
    }
    PrintWithColorRAII(OS, ParenthesisColor) << ')';
  }

  // After:
  void visitUnresolvedDotExpr(UnresolvedDotExpr *E, StringRef label) {
    printCommon(E, "unresolved_dot_expr", label);

    printFieldQuoted(E->getName(), "field");
    printField(E->getFunctionRefKind(), "function_ref", ExprModifierColor);

    if (E->getBase()) {
      printRec(E->getBase());
    }

    printFoot();
  }
```

* Values are printed through calls to base class methods, rather than direct access to the underlying `raw_ostream`.
    * These methods tend to reduce the chances of bugs like missing/extra spaces or newlines, too much/too little indentation, etc.
    * More values are quoted, and unprintable/non-ASCII characters in quoted values are escaped before printing.
* Infrastructure to label child nodes now exists.
    * Some weird breaks from the normal "style", like `PatternBindingDecl`'s original and processed initializers, have been brought into line.
* Some types that previously used ad-hoc dumping functions, like conformances and substitution maps, are now structured similarly to the dumper classes.
* I've fixed the odd dumping bug along the way. For example, distributed actors were only marked `actor`, not `distributed actor`.

This PR doesn't change the overall style of AST dumps; they're still pseudo-S-expressions. But the logic that implements this style is now isolated into a relatively small base class, making it feasible to introduce e.g. JSON dumping in the future.
2023-09-11 23:56:38 -07:00
Slava Pestov
9ebb5f2e03 AST: Rename VarDecl::getType() to VarDecl::getTypeInContext()
This is a futile attempt to discourage future use of getType() by
giving it a "scary" name.

We want people to use getInterfaceType() like with the other decl kinds.
2023-08-04 14:19:25 -04:00
Konrad `ktoso` Malawski
8c8fdf90c4 [Distributed] Try redirecting AST dump to file for test 2023-07-12 18:01:50 +09:00
Konrad `ktoso` Malawski
24a5458cbe [Distributed][Test] Avoid overlapping dump-ast which cause flaky test 2023-05-18 12:01:10 +02:00
Konrad `ktoso` Malawski
ecb9df18bf Always dump input of distributed_actor_executor_ast.swift
This test likes to fail once in a blue moon and we don't have enough information to debug when those happen.

Dump the entire input in case the failure happens again.
2023-04-13 20:26:43 +09:00
Konrad `ktoso` Malawski
b666fc672e [Executors] Remote distributed actors get "crash on enqueue" default executor (#64969) 2023-04-10 19:12:03 +09:00
Konrad `ktoso` Malawski
ac6f569a21 Fix matching in distributed_actor_executor_ast.swift 2023-04-01 10:07:22 +09:00
Konrad `ktoso` Malawski
47676f9a71 [Distributed] AST test was too picky about asserting the shape; (#64809)
depending on configuration some attributes may not be present in the AST
here it seems, causing the test to fail in some configurations
2023-03-31 21:29:09 +09:00
Konrad `ktoso` Malawski
345c221f56 [Concurrency] Distributed actor's unownedExecutor should be optional (#64499) 2023-03-22 08:40:41 +09:00