Merge pull request #11751 from DougGregor/gsb-nested-same-type-match
diff --git a/docs/ABI/Mangling.rst b/docs/ABI/Mangling.rst
index 76fb827..8f21b7c 100644
--- a/docs/ABI/Mangling.rst
+++ b/docs/ABI/Mangling.rst
@@ -178,12 +178,13 @@
entity-spec ::= 'Te' bridge-spec // outlined objective c method call
entity-spec ::= decl-name function-signature generic-signature? 'F' // function
- entity-spec ::= decl-name type 'i' // subscript ('i'ndex) itself (not the individual accessors)
- entity-spec ::= decl-name type 'v' // variable
- entity-spec ::= decl-name type 'f' ACCESSOR
+ entity-spec ::= storage-spec
entity-spec ::= decl-name type 'fp' // generic type parameter
entity-spec ::= decl-name type 'fo' // enum element (currently not used)
+ storage-spec ::= type file-discriminator? 'i' ACCESSOR
+ storage-spec ::= decl-name type 'v' ACCESSOR
+
ACCESSOR ::= 'm' // materializeForSet
ACCESSOR ::= 's' // setter
ACCESSOR ::= 'g' // getter
@@ -192,6 +193,7 @@
ACCESSOR ::= 'W' // didSet
ACCESSOR ::= 'a' ADDRESSOR-KIND // mutable addressor
ACCESSOR ::= 'l' ADDRESSOR-KIND // non-mutable addressor
+ ACCESSOR ::= 'p' // pseudo accessor referring to the storage itself
ADDRESSOR-KIND ::= 'u' // unsafe addressor (no owner)
ADDRESSOR-KIND ::= 'O' // owning addressor (non-native owner)
diff --git a/docs/OptimizerCountersAnalysis.md b/docs/OptimizerCountersAnalysis.md
new file mode 100644
index 0000000..b6763fc
--- /dev/null
+++ b/docs/OptimizerCountersAnalysis.md
@@ -0,0 +1,348 @@
+# Optimizer Counter Analysis
+
+It is possible possible by means of providing some special command-line
+options to ask the Swift compiler to produce different statistics about
+the optimizer counters. Optimizer counters are most typically counters
+representing different aspects of a SIL representation for a Swift module
+being compiled, e.g. the number of SIL basic blocks or instructions.
+These counters may also reveal some details about transformations
+and optimizations performed on SIL, e.g. the duration of an optimization
+or how much memory was consumed by the compiler. Therefore having the
+information about the changes of optimizer counters over time allows for
+analysis of changes to the SIL representation during the compilation.
+
+This document describes how you collect and analyze the counters produced by
+the optimizer of the Swift compiler. This analysis is useful if you need to get
+a detailed insight into the optimizer passes, their effect on the SIL code,
+compile times, compiler's memory consumption, etc. For example, you can find
+out which optimization passes or phases of optimization produce most new SIL
+instructions or delete most SIL functions.
+
+## Table of contents
+<!-- TOC -->
+- [Optimizer Counter Analysis](#optimizer-counter-analysis)
+ - [Table of contents](#table-of-contents)
+ - [Which optimizer counters are available for recording](#which-optimizer-counters-are-available-for-recording)
+ - [How and when the optimizer counters are collected and recorded](#how-and-when-the-optimizer-counters-are-collected-and-recorded)
+ - [Differences between different modes of optimizer counters collection](#differences-between-different-modes-of-optimizer-counters-collection)
+ - [Module level counters](#module-level-counters)
+ - [Function level counters](#function-level-counters)
+ - [Instruction level counters](#instruction-level-counters)
+ - [Configuring which counters changes should be recorded](#configuring-which-counters-changes-should-be-recorded)
+ - [On-line and off-line processing of optimizer counters](#on-line-and-off-line-processing-of-optimizer-counters)
+ - [Specifying where the optimizer counters should be stored](#specifying-where-the-optimizer-counters-should-be-stored)
+ - [The format of the recorded optimizer counters](#the-format-of-the-recorded-optimizer-counters)
+ - [Storing the produced statistics into a database](#storing-the-produced-statistics-into-a-database)
+ - [The database schema for counters](#the-database-schema-for-counters)
+ - [Analyzing collected counters using SQL](#analyzing-collected-counters-using-sql)
+ - [Examples of interesting SQL queries](#examples-of-interesting-sql-queries)
+ - [Compute aggregate times for each optimization pass/transformation](#compute-aggregate-times-for-each-optimization-passtransformation)
+ - [Which pass created/deleted most functions?](#which-pass-createddeleted-most-functions)
+ - [Which pass at which optimization pipeline stage created/deleted most functions?](#which-pass-at-which-optimization-pipeline-stage-createddeleted-most-functions)
+ - [Which pass created/removed most instructions?](#which-pass-createdremoved-most-instructions)
+ - [Which pass at which stage created/removed most instructions?](#which-pass-at-which-stage-createdremoved-most-instructions)
+ - [Which functions were changed most by which stage when it comes to the instruction counts](#which-functions-were-changed-most-by-which-stage-when-it-comes-to-the-instruction-counts)
+ - [Get the number of instructions at the beginning and at the end of the optimization pipeline for each function](#get-the-number-of-instructions-at-the-beginning-and-at-the-end-of-the-optimization-pipeline-for-each-function)
+ - [Show functions which have the biggest size at the end of the optimization pipeline](#show-functions-which-have-the-biggest-size-at-the-end-of-the-optimization-pipeline)
+ - [Which optimization pipeline stage took most time?](#which-optimization-pipeline-stage-took-most-time)
+ - [Which stage added/removed most instructions (in term of deltas)?](#which-stage-addedremoved-most-instructions-in-term-of-deltas)
+<!-- /TOC -->
+
+## Which optimizer counters are available for recording
+
+The following statistics can be recorded:
+
+ * For SILFunctions: the number of SIL basic blocks for each SILFunction, the
+ number of SIL instructions, the number of SILInstructions of a specific
+ kind (e.g. a number of alloc_ref instructions)
+
+ * For SILModules: the number of SIL basic blocks in the SILModule, the number
+ of SIL instructions, the number of SILFunctions, the number of
+ SILInstructions of a specific kind (e.g. a number of alloc_ref
+ instructions) the amount of memory used by the compiler.
+
+## How and when the optimizer counters are collected and recorded
+
+The pass manager of the SIL optimizer invokes special hooks before and after it
+executes any optimization transformation (often called an optimization pass).
+
+The hook checks if there are any changes of counter values since the last time
+it was invoked. If there are any changes, then the counters are re-computed.
+They are first re-computed for SILFunctions and then for the SILModule being
+compiled. The re-computation algorithm is trying to be incremental and fast by
+re-computing only the minimal amount of counters instead of scanning the whole
+SILModule every time.
+
+Those counters that are changed are reported if they satisfy different
+filtering conditions, which are configurable. For example, you may want to see
+only counters that have changed by more than 50% since last time.
+Alternatively, you may want to log as many counters as possible, in which case
+they will be logged on every invocation of the hook.
+
+If there were no changes to the counters that satisfy the filtering conditions,
+those changes would not be logged. This means that the final set of logged
+changes may be incomplete, i.e. it would not reflect all changes that happened
+to those counters.
+
+## Differences between different modes of optimizer counters collection
+
+You can collect optimizer counters at different levels of granularity depending
+on your needs. The granularity also affects the amount of recorded data that
+will be produced, because the amount of recorded data grows if you decide to
+collect more fine-grained counters.
+
+### Module level counters
+The most coarse-grained counters are the module level counters, which are
+enabled by using `-Xllvm -sil-stats-modules` command-line option. They are
+usually logged only if a given optimizer counter changed a lot for the whole
+SILModule, which does not happen that often, because most optimization passes
+perform just very small transformations on a single function and thus do not
+significantly change any module-wide counters.
+
+### Function level counters
+The next level of granularity are SILFunction counters, which are enabled by
+using `-Xllvm -sil-stats-functions` command-line option. They track statistics
+for SILFunctions. Every SILFunction has its own set of these counters.
+Obviously, interesting changes to these counters happen more often than to the
+module-wide counters.
+
+### Instruction level counters
+The finest level of granularity are SILInstruction counters, which are enabled
+by using `-Xllvm -sil-stats-only-instructions` command-line option. You can use
+them to e.g. collect statistics about how many specific SIL instructions are
+used by a given SILFunction or a SILModule. For example, you can count how many
+`alloc_ref` instructions occur in a given SILFunction or SILModule. If you are
+interested in collecting the stats only for some specific SIL instructions, you
+can use a comma-separated list of instructions as a value of the option,
+e.g. `-Xllvm -sil-stats-only-instructions=alloc_ref,alloc_stack`. If you need to
+collect stats about all kinds of SIL instructions, you can use this syntax:
+`-Xllvm -sil-stats-only-instructions=all`.
+
+## Configuring which counters changes should be recorded
+
+The user has a possibility to configure a number of thresholds, which control
+what needs to be recorded. Many of those thresholds are formulated for the
+deltas, e.g. the delta should be more than 50%.
+
+The value of the delta for a given old and new values of a counter are computed
+using the following simple formula:
+
+ `delta = 100% * (new_value - old_value)/old_value`
+
+So, a delta basically reflects how big is the change of the counter value
+when expressed as a percentage of the old value.
+
+TBD Provide more information about different command-line options for
+configuring the thresholds.
+
+## On-line and off-line processing of optimizer counters
+
+As explained above, some of the counters filtering happens on-line at
+compile-time already. If this is enough for your purposes, you can use them "as
+is".
+
+But in many cases, you may want to perform more complex analysis of the
+collected counters, e.g. you may want to aggregate them by the optimization
+pass or by a stage of the optimization pipeline, etc. This is not directly
+supported by the on-line filtering mode. Instead, you can record all the
+interesting counters and then post-process it off-line by first storing them
+into a SQLite database by means if a special utility and then using the regular
+SQL queries to perform any kind of analysis and aggregation that you may need.
+
+## Specifying where the optimizer counters should be stored
+
+By default, all the collected statistics are written to the
+standard error.
+
+But it is possible to write into a custom file by specifying the following
+command-line option:
+
+ `-Xllvm -sil-stats-output-file=your_file_name`
+
+## The format of the recorded optimizer counters
+
+The counters are recorded using a simple CSV (comma separated value) format.
+Each line represents a single counter value or a counter value change.
+
+For counter value updates, the CSV line looks like this:
+ * `Kind, CounterName, StageName, TransformName,
+ TransformPassNumber, DeltaValue, OldCounterValue,
+ NewCounterValue, Duration, Symbol`
+
+And for counter stats it looks like this:
+ * `Kind, CounterName, StageName, TransformName,
+ TransformPassNumber, CounterValue, Duration, Symbol`
+
+ where the names used above have the following meaning:
+
+* `Kind` is one of `function`, `module`, `function_history`.
+ * `function` and
+ `module` correspond directly to the module-level and function-level counters
+ * `function_history` corresponds to the verbose mode of function
+ counters collection, when changes to the SILFunction counters are logged
+ unconditionally, without any on-line filtering.
+* `CounterName` is typically one of `block`, `inst`, `function`, `memory`,
+ or `inst_instruction_name` if you collect counters for specific kinds of SIL
+ instructions.
+* `Symbol` is e.g. the name of a function
+* `StageName` is the name of the current optimizer pipeline stage
+* `TransformName` is the name of the current optimizer transformation/pass
+* `Duration` is the duration of the transformation
+* `TransformPassNumber` is the optimizer pass number. It is useful if you
+ want to reproduce the result later using
+ `-Xllvm -sil-opt-pass-count -Xllvm TransformPassNumber`
+
+## Storing the produced statistics into a database
+
+To store the set of produced counters into a database, you can use the
+following command:
+
+`utils/optimizer_counters_to_sql.py csv_file_with_counters your_database.db`
+
+## The database schema for counters
+
+The database uses a very simple self-explaining schema:
+
+```sql
+CREATE TABLE Counters(
+ Id INTEGER PRIMARY KEY AUTOINCREMENT,
+ Stage TEXT NOT NULL,
+ Transform TEXT NOT NULL,
+ Kind TEXT,
+ Counter TEXT NOT NULL,
+ PassNum INT NOT NULL,
+ Delta NUMBER,
+ Old INT,
+ New INT,
+ Duration INT,
+ Symbol TEXT NOT NULL DEFAULT '');
+```
+
+## Analyzing collected counters using SQL
+
+First, you need to connect to your database, so that you can issue SQL queries.
+This can be accomplished e.g. by the following command:
+
+ `sqlite3 your_database.db`
+
+After executing this command, you will be presented with a SQLite command
+prompt and you can start entering SQL queries. Each query should end with
+a semicolon.
+
+### Examples of interesting SQL queries
+
+SQL gives you a lot of freedom to perform different kinds of analysis. Below
+you can find some examples of typical queries, which you can use "as is" or as
+a basis for formulating more complex queries.
+
+#### Compute aggregate times for each optimization pass/transformation
+
+```sql
+select C.Transform, sum(C.Duration)
+from Counters C
+where C.counter = 'inst' and C.kind = 'module'
+group by C.Transform;
+```
+
+#### Which pass created/deleted most functions?
+```sql
+select C.Transform, sum(C.Delta)
+from Counters C
+where C.counter = 'functions' and C.kind = 'module'
+group by C.Transform;
+```
+
+#### Which pass at which optimization pipeline stage created/deleted most functions?
+```sql
+select C.Stage, C.Transform, sum(C.Delta)
+from Counters C where C.counter = 'functions' and C.kind = 'module'
+group by C.Stage, C.Transform;
+```
+
+#### Which pass created/removed most instructions?
+
+```sql
+# Sort by biggest changes
+select C.Transform, sum(C.Delta)
+from Counters C where C.counter = 'inst' and C.kind = 'module'
+group by C.Transform
+order by abs(sum(C.Delta));
+```
+
+#### Which pass at which stage created/removed most instructions?
+```sql
+# Sort by biggest changes
+select C.Stage, C.Transform, sum(C.Delta)
+from Counters C where C.counter = 'inst' and C.kind = 'module'
+group by C.Stage, C.Transform
+order by abs(sum(C.Delta));
+```
+
+#### Which functions were changed most by which stage when it comes to the instruction counts
+
+```sql
+select C.Stage, min(C.Old), max(C.Old), Symbol
+from Counters C where C.counter = 'inst' and C.kind = 'function_history'
+group by C.Symbol, C.Stage
+having min(C.Old) <> max(C.Old)
+order by abs(max(C.Old)-min(C.Old));
+```
+
+#### Get the number of instructions at the beginning and at the end of the optimization pipeline for each function
+```sql
+select MinOld.Id, MinOld.Old, MaxOld.Id, MaxOld.Old, MinOld.Symbol
+from
+(
+ select C.Id, C.Old, C.Symbol
+ from Counters C where C.counter = 'inst' and C.kind = 'function_history'
+ group by C.Symbol
+ having C.Id = max(Id)
+) as MaxOld,
+(select C.Id, C.Old, C.Symbol
+ from Counters C
+ where C.counter = 'inst' and C.kind = 'function_history'
+ group by C.Symbol
+ having C.Id = min(Id)
+) as MinOld
+where MinOld.Symbol == MaxOld.Symbol;
+```
+
+#### Show functions which have the biggest size at the end of the optimization pipeline
+```sql
+select MinOld.Id, MinOld.Old, MaxOld.Id, MaxOld.Old, MinOld.Symbol
+from
+(
+ select C.Id, C.Old, C.Symbol
+ from Counters C
+ where C.counter = 'inst' and C.kind = 'function_history'
+ group by C.Symbol
+ having C.Id = max(Id)
+) as MaxOld,
+(
+ select C.Id, C.Old, C.Symbol
+ from Counters C
+ where C.counter = 'inst' and C.kind = 'function_history'
+ group by C.Symbol
+ having C.Id = min(Id)
+) as MinOld
+where MinOld.Symbol == MaxOld.Symbol
+order by MaxOld.Old;
+```
+
+#### Which optimization pipeline stage took most time?
+```sql
+select sum(Duration), Stage
+from Counters C
+where C.counter = 'inst' and C.kind = 'module'
+group by Stage
+order by sum(C.Duration);
+```
+
+#### Which stage added/removed most instructions (in term of deltas)?
+```sql
+select sum(Delta), Stage
+from Counters C where C.counter = 'inst' and C.kind = 'module'
+group by Stage
+order by sum(C.Delta);
+```
+
diff --git a/include/swift/AST/ASTMangler.h b/include/swift/AST/ASTMangler.h
index ce296dd..4fd228a 100644
--- a/include/swift/AST/ASTMangler.h
+++ b/include/swift/AST/ASTMangler.h
@@ -73,7 +73,7 @@
std::string mangleAccessorEntity(AccessorKind kind,
AddressorKind addressorKind,
- const ValueDecl *decl,
+ const AbstractStorageDecl *decl,
bool isStatic,
SymbolKind SKind);
@@ -138,7 +138,7 @@
std::string mangleAccessorEntityAsUSR(AccessorKind kind,
AddressorKind addressorKind,
- const ValueDecl *decl,
+ const AbstractStorageDecl *decl,
StringRef USRPrefix);
protected:
@@ -225,10 +225,12 @@
void appendDestructorEntity(const DestructorDecl *decl, bool isDeallocating);
- void appendAccessorEntity(AccessorKind kind,
- AddressorKind addressorKind,
- const ValueDecl *decl,
- bool isStatic);
+ /// \param accessorKindCode The code to describe the accessor and addressor
+ /// kind. Usually retrieved using getCodeForAccessorKind.
+ /// \param decl The storage decl for which to mangle the accessor
+ /// \param isStatic Whether or not the accessor is static
+ void appendAccessorEntity(StringRef accessorKindCode,
+ const AbstractStorageDecl *decl, bool isStatic);
void appendEntity(const ValueDecl *decl, StringRef EntityOp, bool isStatic);
diff --git a/include/swift/AST/Decl.h b/include/swift/AST/Decl.h
index 73fac0f..b484580 100644
--- a/include/swift/AST/Decl.h
+++ b/include/swift/AST/Decl.h
@@ -305,10 +305,16 @@
/// Whether we are overridden later
unsigned Overridden : 1;
+ /// Whether the getter is mutating.
+ unsigned IsGetterMutating : 1;
+
+ /// Whether the setter is mutating.
+ unsigned IsSetterMutating : 1;
+
/// The storage kind.
unsigned StorageKind : 4;
};
- enum { NumAbstractStorageDeclBits = NumValueDeclBits + 5 };
+ enum { NumAbstractStorageDeclBits = NumValueDeclBits + 7 };
static_assert(NumAbstractStorageDeclBits <= 32, "fits in an unsigned");
class VarDeclBitfields {
@@ -3970,6 +3976,8 @@
SourceLoc NameLoc)
: ValueDecl(Kind, DC, Name, NameLoc), OverriddenDecl(nullptr) {
AbstractStorageDeclBits.StorageKind = Stored;
+ AbstractStorageDeclBits.IsGetterMutating = false;
+ AbstractStorageDeclBits.IsSetterMutating = true;
AbstractStorageDeclBits.Overridden = false;
}
public:
@@ -4072,13 +4080,23 @@
llvm_unreachable("bad storage kind");
}
- /// \brief Return true if the 'getter' is 'mutating', i.e. that it requires an
- /// lvalue base to be accessed.
- bool isGetterMutating() const;
+ /// \brief Return true if reading this storage requires the ability to
+ /// modify the base value.
+ bool isGetterMutating() const {
+ return AbstractStorageDeclBits.IsGetterMutating;
+ }
+ void setIsGetterMutating(bool isMutating) {
+ AbstractStorageDeclBits.IsGetterMutating = isMutating;
+ }
- /// \brief Return true if the 'setter' is 'nonmutating', i.e. that it can be
- /// called even on an immutable base value.
- bool isSetterNonMutating() const;
+ /// \brief Return true if modifying this storage requires the ability to
+ /// modify the base value.
+ bool isSetterMutating() const {
+ return AbstractStorageDeclBits.IsSetterMutating;
+ }
+ void setIsSetterMutating(bool isMutating) {
+ AbstractStorageDeclBits.IsSetterMutating = isMutating;
+ }
FuncDecl *getAccessorFunction(AccessorKind accessor) const;
diff --git a/include/swift/AST/Expr.h b/include/swift/AST/Expr.h
index 46607d1..e78e864 100644
--- a/include/swift/AST/Expr.h
+++ b/include/swift/AST/Expr.h
@@ -1612,9 +1612,22 @@
/// subscript is available.
class DynamicLookupExpr : public Expr {
protected:
- explicit DynamicLookupExpr(ExprKind kind) : Expr(kind, /*Implicit=*/false) { }
+ Expr *Base;
+ ConcreteDeclRef Member;
+
+ explicit DynamicLookupExpr(ExprKind kind, ConcreteDeclRef member, Expr *base)
+ : Expr(kind, /*Implicit=*/false), Base(base), Member(member) { }
public:
+ /// Retrieve the member to which this access refers.
+ ConcreteDeclRef getMember() const { return Member; }
+
+ /// Retrieve the base of the expression.
+ Expr *getBase() const { return Base; }
+
+ /// Replace the base of the expression.
+ void setBase(Expr *base) { Base = base; }
+
static bool classof(const Expr *E) {
return E->getKind() >= ExprKind::First_DynamicLookupExpr &&
E->getKind() <= ExprKind::Last_DynamicLookupExpr;
@@ -1637,8 +1650,6 @@
/// print(x.foo!(17)) // x.foo has type ((i : Int) -> String)?
/// \endcode
class DynamicMemberRefExpr : public DynamicLookupExpr {
- Expr *Base;
- ConcreteDeclRef Member;
SourceLoc DotLoc;
DeclNameLoc NameLoc;
@@ -1646,19 +1657,10 @@
DynamicMemberRefExpr(Expr *base, SourceLoc dotLoc,
ConcreteDeclRef member,
DeclNameLoc nameLoc)
- : DynamicLookupExpr(ExprKind::DynamicMemberRef),
- Base(base), Member(member), DotLoc(dotLoc), NameLoc(nameLoc) {
+ : DynamicLookupExpr(ExprKind::DynamicMemberRef, member, base),
+ DotLoc(dotLoc), NameLoc(nameLoc) {
}
- /// Retrieve the base of the expression.
- Expr *getBase() const { return Base; }
-
- /// Replace the base of the expression.
- void setBase(Expr *base) { Base = base; }
-
- /// Retrieve the member to which this access refers.
- ConcreteDeclRef getMember() const { return Member; }
-
/// Retrieve the location of the member name.
DeclNameLoc getNameLoc() const { return NameLoc; }
@@ -1707,9 +1709,7 @@
public TrailingCallArguments<DynamicSubscriptExpr> {
friend TrailingCallArguments;
- Expr *Base;
Expr *Index;
- ConcreteDeclRef Member;
DynamicSubscriptExpr(Expr *base, Expr *index, ArrayRef<Identifier> argLabels,
ArrayRef<SourceLoc> argLabelLocs,
@@ -1762,9 +1762,6 @@
return DynamicSubscriptExprBits.HasTrailingClosure;
}
- /// Retrieve the member to which this access refers.
- ConcreteDeclRef getMember() const { return Member; }
-
SourceLoc getLoc() const { return Index->getStartLoc(); }
SourceLoc getStartLoc() const { return Base->getStartLoc(); }
diff --git a/include/swift/AST/Module.h b/include/swift/AST/Module.h
index 34b4bda..7b7c482 100644
--- a/include/swift/AST/Module.h
+++ b/include/swift/AST/Module.h
@@ -1073,23 +1073,22 @@
}
std::vector<Token> &getTokenVector() {
- assert(EnabledAndAllCorrectedTokens.first && "Disabled");
- return EnabledAndAllCorrectedTokens.second;
+ assert(shouldKeepTokens() && "Disabled");
+ return *AllCorrectedTokens;
}
ArrayRef<Token> getAllTokens() const {
- assert(EnabledAndAllCorrectedTokens.first && "Disabled");
- return EnabledAndAllCorrectedTokens.second;
+ assert(shouldKeepTokens() && "Disabled");
+ return *AllCorrectedTokens;
}
bool shouldKeepTokens() const {
- return EnabledAndAllCorrectedTokens.first;
+ return (bool)AllCorrectedTokens;
}
private:
- /// Whether the SourceFile instance opts to collect underlying tokens and
- /// the vector containing these tokens if so.
- std::pair<bool, std::vector<Token>> EnabledAndAllCorrectedTokens;
+ /// If not None, the underlying vector should contain tokens of this source file.
+ Optional<std::vector<Token>> AllCorrectedTokens;
};
diff --git a/include/swift/Basic/LangOptions.h b/include/swift/Basic/LangOptions.h
index 64dae1b..97b4cff 100644
--- a/include/swift/Basic/LangOptions.h
+++ b/include/swift/Basic/LangOptions.h
@@ -174,7 +174,7 @@
/// \brief The upper bound to number of sub-expressions unsolved
/// before termination of the shrink phrase of the constraint solver.
- unsigned SolverShrinkUnsolvedThreshold = 5;
+ unsigned SolverShrinkUnsolvedThreshold = 10;
/// The maximum depth to which to test decl circularity.
unsigned MaxCircularityDepth = 500;
diff --git a/include/swift/Basic/Mangler.h b/include/swift/Basic/Mangler.h
index a358532..79c8dad 100644
--- a/include/swift/Basic/Mangler.h
+++ b/include/swift/Basic/Mangler.h
@@ -109,6 +109,7 @@
/// Verify that demangling and remangling works.
static void verify(StringRef mangledName);
+ static void verifyOld(StringRef mangledName);
/// Appends a mangled identifier string.
void appendIdentifier(StringRef ident);
diff --git a/include/swift/Basic/STLExtras.h b/include/swift/Basic/STLExtras.h
index 8587af4..ce20fb6 100644
--- a/include/swift/Basic/STLExtras.h
+++ b/include/swift/Basic/STLExtras.h
@@ -219,17 +219,33 @@
set_union_for_each(C1.begin(), C1.end(), C2.begin(), C2.end(), f);
}
+/// If \p it is equal to \p end, then return \p defaultIter. Otherwise, return
+/// std::next(\p it).
+template <typename Iterator>
+inline Iterator next_or_default(Iterator it, Iterator end,
+ Iterator defaultIter) {
+ return (it == end) ? defaultIter : std::next(it);
+}
+
+/// If \p it is equal to \p begin, then return \p defaultIter. Otherwise, return
+/// std::prev(\p it).
+template <typename Iterator>
+inline Iterator prev_or_default(Iterator it, Iterator begin,
+ Iterator defaultIter) {
+ return (it == begin) ? defaultIter : std::prev(it);
+}
+
/// Takes an iterator and an iterator pointing to the end of the iterator range.
/// If the iterator already points to the end of its range, simply return it,
/// otherwise return the next element.
template <typename Iterator>
inline Iterator next_or_end(Iterator it, Iterator end) {
- return (it == end) ? end : std::next(it);
+ return next_or_default(it, end, end);
}
template <typename Iterator>
inline Iterator prev_or_begin(Iterator it, Iterator begin) {
- return (it == begin) ? begin : std::prev(it);
+ return prev_or_default(it, begin, begin);
}
/// @}
diff --git a/include/swift/Demangling/Demangler.h b/include/swift/Demangling/Demangler.h
index 84848f6..ce28160 100644
--- a/include/swift/Demangling/Demangler.h
+++ b/include/swift/Demangling/Demangler.h
@@ -447,8 +447,11 @@
NodePointer demangleWitness();
NodePointer demangleSpecialType();
NodePointer demangleMetatypeRepresentation();
+ NodePointer demangleAccessor(NodePointer ChildNode);
NodePointer demangleFunctionEntity();
NodePointer demangleEntity(Node::Kind Kind);
+ NodePointer demangleVariable();
+ NodePointer demangleSubscript();
NodePointer demangleProtocolList();
NodePointer demangleProtocolListType();
NodePointer demangleGenericSignature(bool hasParamCounts);
diff --git a/include/swift/Parse/Lexer.h b/include/swift/Parse/Lexer.h
index ebb2f4a..3f908c0 100644
--- a/include/swift/Parse/Lexer.h
+++ b/include/swift/Parse/Lexer.h
@@ -536,6 +536,16 @@
bool tryLexConflictMarker();
};
+/// Given an ordered token \param Array , get the iterator pointing to the first
+/// token that is not before \param Loc .
+template<typename ArrayTy, typename Iterator = typename ArrayTy::iterator>
+Iterator token_lower_bound(ArrayTy &Array, SourceLoc Loc) {
+ return std::lower_bound(Array.begin(), Array.end(), Loc,
+ [](const Token &T, SourceLoc L) {
+ return T.getLoc().getOpaquePointerValue() < L.getOpaquePointerValue();
+ });
+}
+
} // end namespace swift
#endif
diff --git a/include/swift/SIL/SILBuilder.h b/include/swift/SIL/SILBuilder.h
index 2405ccf..e2bba6f 100644
--- a/include/swift/SIL/SILBuilder.h
+++ b/include/swift/SIL/SILBuilder.h
@@ -36,6 +36,10 @@
SILFunction *F;
SILModule &Mod;
+ /// Allow the SIL module conventions to be overriden within the builder.
+ /// This supports passes that lower SIL to a new stage.
+ SILModuleConventions silConv = SILModuleConventions(Mod);
+
/// If this is non-null, the instruction is inserted in the specified
/// basic block, at the specified InsertPt. If null, created instructions
/// are not auto-inserted.
@@ -103,6 +107,13 @@
setInsertionPoint(BB, InsertPt);
}
+ // Allow a pass to override the current SIL module conventions. This should
+ // only be done by a pass responsible for lowering SIL to a new stage
+ // (e.g. AddressLowering).
+ void setSILConventions(SILModuleConventions silConv) {
+ this->silConv = silConv;
+ }
+
SILFunction &getFunction() const {
assert(F && "cannot create this instruction without a function context");
return *F;
@@ -333,10 +344,9 @@
ApplyInst *createApply(
SILLocation Loc, SILValue Fn, SubstitutionList Subs,
ArrayRef<SILValue> Args, bool isNonThrowing,
- const GenericSpecializationInformation *SpecializationInfo = nullptr,
- Optional<SILModuleConventions> ModuleConventions = None) {
+ const GenericSpecializationInformation *SpecializationInfo = nullptr) {
return insert(ApplyInst::create(getSILDebugLocation(Loc), Fn, Subs, Args,
- isNonThrowing, ModuleConventions, *F,
+ isNonThrowing, silConv, *F,
OpenedArchetypes, SpecializationInfo));
}
diff --git a/include/swift/SIL/SILInstruction.h b/include/swift/SIL/SILInstruction.h
index b2af131..c32b4a6 100644
--- a/include/swift/SIL/SILInstruction.h
+++ b/include/swift/SIL/SILInstruction.h
@@ -68,6 +68,12 @@
#include "SILNodes.def"
};
+/// Map SILInstruction's mnemonic name to its SILInstructionKind.
+SILInstructionKind getSILInstructionKind(StringRef InstName);
+
+/// Map SILInstructionKind to a corresponding SILInstruction name.
+StringRef getSILInstructionName(SILInstructionKind Kind);
+
/// This is the root class for all instructions that can be used as the contents
/// of a Swift SILBasicBlock.
class SILInstruction : public ValueBase,public llvm::ilist_node<SILInstruction>{
@@ -96,10 +102,21 @@
/// SILClonerWithScope instead.
void setDebugScope(SILBuilder &B, const SILDebugScope *DS);
+ /// Total number of created and deleted SILInstructions.
+ /// It is used only for collecting the compiler statistics.
+ static int NumCreatedInstructions;
+ static int NumDeletedInstructions;
+
protected:
SILInstruction(ValueKind Kind, SILDebugLocation DebugLoc,
SILType Ty = SILType())
- : ValueBase(Kind, Ty), ParentBB(0), Location(DebugLoc) {}
+ : ValueBase(Kind, Ty), ParentBB(0), Location(DebugLoc) {
+ NumCreatedInstructions++;
+ }
+
+ ~SILInstruction() {
+ NumDeletedInstructions++;
+ }
public:
/// Instructions should be allocated using a dedicated instruction allocation
@@ -335,6 +352,16 @@
/// Verify that all operands of this instruction have compatible ownership
/// with this instruction.
void verifyOperandOwnership() const;
+
+ /// Get the number of created SILInstructions.
+ static int getNumCreatedInstructions() {
+ return NumCreatedInstructions;
+ }
+
+ /// Get the number of deleted SILInstructions.
+ static int getNumDeletedInstructions() {
+ return NumDeletedInstructions;
+ }
};
/// Returns the combined behavior of \p B1 and \p B2.
@@ -6529,6 +6556,16 @@
FOREACH_IMPL_RETURN(getSubstitutions());
}
+ /// Return a begin iterator for the substitution array.
+ auto subs_begin() const -> decltype(getSubstitutions().begin()) {
+ return getSubstitutions().begin();
+ }
+
+ /// Return an end iterator for the substitution array.
+ auto subs_end() const -> decltype(getSubstitutions().end()) {
+ return getSubstitutions().end();
+ }
+
/// The arguments passed to this instruction.
MutableArrayRef<Operand> getArgumentOperands() const {
FOREACH_IMPL_RETURN(getArgumentOperands());
diff --git a/include/swift/SIL/SILNodes.def b/include/swift/SIL/SILNodes.def
index e4623d9..2894d6b 100644
--- a/include/swift/SIL/SILNodes.def
+++ b/include/swift/SIL/SILNodes.def
@@ -285,11 +285,20 @@
INST(ObjCMetatypeToObjectInst, ConversionInst, objc_metatype_to_object, None, DoesNotRelease)
INST(ObjCExistentialMetatypeToObjectInst, ConversionInst, objc_existential_metatype_to_object, None,
DoesNotRelease)
- // We have to use a MayRead here to block moving the ultimate release
- // accross the cast (which reads the type metadata). With Semantic SIL we
- // should be able to move this back to None - it should model the scoping
- // and forbid the compiler from moving the ultimate retain.
+ // unconditional_checked_cast_value reads the source value and produces
+ // a new value with a potentially different representation.
INST(UnconditionalCheckedCastValueInst, ConversionInst, unconditional_checked_cast_value, MayRead, MayRelease)
+ // unconditional_checked_cast_inst is only MayRead to prevent a subsequent
+ // release of the cast's source from being hoisted above the cast:
+ // retain X
+ // Y = unconditional_checked_cast_inst X
+ // _ = Y
+ // release X // This release cannot be reordered with the cast.
+ //
+ // With Semantic SIL, this pattern of unbalanced retain/release
+ // should never happen. Since unconditional_checked_cast is a
+ // scalar cast that doesn't affect the value's representation, its
+ // side effect can then be modeled as None.
INST(UnconditionalCheckedCastInst, ConversionInst, unconditional_checked_cast, MayRead, DoesNotRelease)
VALUE_RANGE(ConversionInst, UpcastInst, UnconditionalCheckedCastInst)
INST(IsNonnullInst, SILInstruction, is_nonnull, None, DoesNotRelease)
diff --git a/include/swift/SIL/SILValue.h b/include/swift/SIL/SILValue.h
index 16f5253..bc7d869 100644
--- a/include/swift/SIL/SILValue.h
+++ b/include/swift/SIL/SILValue.h
@@ -260,7 +260,7 @@
public:
SILValue(const ValueBase *V = nullptr)
- : Value((ValueBase *)V) { }
+ : Value(const_cast<ValueBase *>(V)) { }
ValueBase *operator->() const { return Value; }
ValueBase &operator*() const { return *Value; }
@@ -785,6 +785,12 @@
return OS;
}
+/// Map a SILValue mnemonic name to its ValueKind.
+ValueKind getSILValueKind(StringRef Name);
+
+/// Map ValueKind to a corresponding mnemonic name.
+StringRef getSILValueName(ValueKind Kind);
+
} // end namespace swift
diff --git a/include/swift/SILOptimizer/Analysis/Analysis.def b/include/swift/SILOptimizer/Analysis/Analysis.def
index 0dd8d46..8cbf23c 100644
--- a/include/swift/SILOptimizer/Analysis/Analysis.def
+++ b/include/swift/SILOptimizer/Analysis/Analysis.def
@@ -36,6 +36,7 @@
ANALYSIS(InductionVariable)
ANALYSIS(Loop)
ANALYSIS(LoopRegion)
+ANALYSIS(OptimizerStats)
ANALYSIS(PostDominance)
ANALYSIS(PostOrder)
ANALYSIS(RCIdentity)
diff --git a/include/swift/SILOptimizer/PassManager/PassManager.h b/include/swift/SILOptimizer/PassManager/PassManager.h
index 5a09d81..0324d10 100644
--- a/include/swift/SILOptimizer/PassManager/PassManager.h
+++ b/include/swift/SILOptimizer/PassManager/PassManager.h
@@ -211,9 +211,16 @@
/// owned by the pass manager. Analysis passes will be kept.
void resetAndRemoveTransformations();
- // Sets the name of the current optimization stage used for debugging.
+ /// \brief Set the name of the current optimization stage.
+ ///
+ /// This is useful for debugging.
void setStageName(llvm::StringRef NextStage = "");
+ /// \brief Get the name of the current optimization stage.
+ ///
+ /// This is useful for debugging.
+ StringRef getStageName() const;
+
/// D'tor.
~SILPassManager();
diff --git a/include/swift/SILOptimizer/Utils/Devirtualize.h b/include/swift/SILOptimizer/Utils/Devirtualize.h
index 44bede7..ec523c3 100644
--- a/include/swift/SILOptimizer/Utils/Devirtualize.h
+++ b/include/swift/SILOptimizer/Utils/Devirtualize.h
@@ -31,6 +31,7 @@
#include "llvm/ADT/ArrayRef.h"
namespace swift {
+
/// A pair representing results of devirtualization.
/// - The first element is the value representing the result of the
/// devirtualized call.
@@ -41,6 +42,10 @@
/// Two elements are required, because a result of the new devirtualized
/// apply/try_apply instruction (second element) eventually needs to be
/// casted to produce a properly typed value (first element).
+///
+/// *NOTE* The reason why we use a ValueBase here instead of a SILInstruction is
+/// that a devirtualization result may be a BB arg if there was a cast in
+/// between optional types.
typedef std::pair<ValueBase *, ApplySite> DevirtualizationResult;
DevirtualizationResult tryDevirtualizeApply(ApplySite AI,
diff --git a/include/swift/SILOptimizer/Utils/OptimizerStatsUtils.h b/include/swift/SILOptimizer/Utils/OptimizerStatsUtils.h
new file mode 100644
index 0000000..9920d76
--- /dev/null
+++ b/include/swift/SILOptimizer/Utils/OptimizerStatsUtils.h
@@ -0,0 +1,41 @@
+//===--- OptimizerStatsUtils.h - Utils for collecting stats --*- C++ ---*-===//
+//
+// This source file is part of the Swift.org open source project
+//
+// Copyright (c) 2014 - 2017 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef SWIFT_OPTIMIZER_STATS_UTILS_H
+#define SWIFT_OPTIMIZER_STATS_UTILS_H
+
+namespace swift {
+class SILModule;
+class SILTransform;
+class SILPassManager;
+
+/// Updates SILModule stats before executing the transform \p Transform.
+///
+/// \param M SILModule to be processed
+/// \param Transform the SIL transformation that was just executed
+/// \param PM the PassManager being used
+void updateSILModuleStatsBeforeTransform(SILModule &M, SILTransform *Transform,
+ SILPassManager &PM, int PassNumber);
+
+/// Updates SILModule stats after finishing executing the
+/// transform \p Transform.
+///
+/// \param M SILModule to be processed
+/// \param Transform the SIL transformation that was just executed
+/// \param PM the PassManager being used
+void updateSILModuleStatsAfterTransform(SILModule &M, SILTransform *Transform,
+ SILPassManager &PM, int PassNumber,
+ int Duration);
+
+} // end namespace swift
+
+#endif
diff --git a/include/swift/SILOptimizer/Utils/SILInliner.h b/include/swift/SILOptimizer/Utils/SILInliner.h
index f88769e..a7f5921 100644
--- a/include/swift/SILOptimizer/Utils/SILInliner.h
+++ b/include/swift/SILOptimizer/Utils/SILInliner.h
@@ -55,6 +55,12 @@
Callback(Callback) {
}
+ /// Returns true if we are able to inline \arg AI.
+ ///
+ /// *NOTE* This must be checked before attempting to inline \arg AI. If one
+ /// attempts to inline \arg AI and this returns false, an assert will fire.
+ bool canInlineFunction(FullApplySite AI);
+
/// inlineFunction - This method inlines a callee function, assuming that it
/// is called with the given arguments, into the caller at a given instruction
/// (as specified by a basic block iterator), assuming that the instruction
@@ -62,11 +68,15 @@
/// performs one step of inlining: it does not recursively inline functions
/// called by the callee.
///
- /// Returns true on success or false if it is unable to inline the function
- /// (for any reason). If successful, I now points to the first inlined
- /// instruction, or the next instruction after the removed instruction in the
- /// original function, in case the inlined function is completely trivial
- bool inlineFunction(FullApplySite AI, ArrayRef<SILValue> Args);
+ /// After completion, I now points to the first inlined instruction, or the
+ /// next instruction after the removed instruction in the original function,
+ /// in case the inlined function is completely trivial
+ ///
+ /// *NOTE*: This attempts to perform inlining unconditionally and thus asserts
+ /// if inlining will fail. All users /must/ check that a function is allowed
+ /// to be inlined using SILInliner::canInlineFunction before calling this
+ /// function.
+ void inlineFunction(FullApplySite AI, ArrayRef<SILValue> Args);
private:
void visitDebugValueInst(DebugValueInst *Inst);
diff --git a/include/swift/Serialization/ModuleFormat.h b/include/swift/Serialization/ModuleFormat.h
index 3f036fc..875b8be 100644
--- a/include/swift/Serialization/ModuleFormat.h
+++ b/include/swift/Serialization/ModuleFormat.h
@@ -54,7 +54,7 @@
/// in source control, you should also update the comment to briefly
/// describe what change you made. The content of this comment isn't important;
/// it just ensures a conflict if two people change the module format.
-const uint16_t VERSION_MINOR = 362; // Last change: associated type inherited clause
+const uint16_t VERSION_MINOR = 363; // Last change: storage get/set mutating
using DeclID = PointerEmbeddedInt<unsigned, 31>;
using DeclIDField = BCFixed<31>;
@@ -910,6 +910,8 @@
BCFixed<1>, // static?
VarDeclSpecifierField, // specifier
BCFixed<1>, // HasNonPatternBindingInit?
+ BCFixed<1>, // is getter mutating?
+ BCFixed<1>, // is setter mutating?
StorageKindField, // StorageKind
TypeIDField, // interface type
DeclIDField, // getter
@@ -1018,6 +1020,8 @@
DeclContextIDField, // context decl
BCFixed<1>, // implicit?
BCFixed<1>, // objc?
+ BCFixed<1>, // is getter mutating?
+ BCFixed<1>, // is setter mutating?
StorageKindField, // StorageKind
GenericEnvironmentIDField, // generic environment
TypeIDField, // interface type
diff --git a/lib/AST/ASTMangler.cpp b/lib/AST/ASTMangler.cpp
index 53a70dd..8e0db26 100644
--- a/lib/AST/ASTMangler.cpp
+++ b/lib/AST/ASTMangler.cpp
@@ -41,6 +41,54 @@
using namespace swift;
using namespace swift::Mangle;
+static StringRef getCodeForAccessorKind(AccessorKind kind,
+ AddressorKind addressorKind) {
+ switch (kind) {
+ case AccessorKind::NotAccessor:
+ llvm_unreachable("bad accessor kind!");
+ case AccessorKind::IsGetter:
+ return "g";
+ case AccessorKind::IsSetter:
+ return "s";
+ case AccessorKind::IsWillSet:
+ return "w";
+ case AccessorKind::IsDidSet:
+ return "W";
+ case AccessorKind::IsAddressor:
+ // 'l' is for location. 'A' was taken.
+ switch (addressorKind) {
+ case AddressorKind::NotAddressor:
+ llvm_unreachable("bad combo");
+ case AddressorKind::Unsafe:
+ return "lu";
+ case AddressorKind::Owning:
+ return "lO";
+ case AddressorKind::NativeOwning:
+ return "lo";
+ case AddressorKind::NativePinning:
+ return "lp";
+ }
+ llvm_unreachable("bad addressor kind");
+ case AccessorKind::IsMutableAddressor:
+ switch (addressorKind) {
+ case AddressorKind::NotAddressor:
+ llvm_unreachable("bad combo");
+ case AddressorKind::Unsafe:
+ return "au";
+ case AddressorKind::Owning:
+ return "aO";
+ case AddressorKind::NativeOwning:
+ return "ao";
+ case AddressorKind::NativePinning:
+ return "aP";
+ }
+ llvm_unreachable("bad addressor kind");
+ case AccessorKind::IsMaterializeForSet:
+ return "m";
+ }
+ llvm_unreachable("bad accessor kind");
+}
+
std::string ASTMangler::mangleClosureEntity(const AbstractClosureExpr *closure,
SymbolKind SKind) {
beginMangling();
@@ -92,19 +140,21 @@
std::string ASTMangler::mangleAccessorEntity(AccessorKind kind,
AddressorKind addressorKind,
- const ValueDecl *decl,
+ const AbstractStorageDecl *decl,
bool isStatic,
SymbolKind SKind) {
beginMangling();
- appendAccessorEntity(kind, addressorKind, decl, isStatic);
+ appendAccessorEntity(getCodeForAccessorKind(kind, addressorKind), decl,
+ isStatic);
appendSymbolKind(SKind);
return finalize();
}
std::string ASTMangler::mangleGlobalGetterEntity(const ValueDecl *decl,
SymbolKind SKind) {
+ assert(isa<VarDecl>(decl) && "Only variables can have global getters");
beginMangling();
- appendEntity(decl, "fG", false);
+ appendEntity(decl, "vG", /*isStatic*/false);
appendSymbolKind(SKind);
return finalize();
}
@@ -381,6 +431,7 @@
Node *NewGlobal = Dem.createNode(Node::Kind::Global);
NewGlobal->addChild(TyMangling, Dem);
std::string OldName = mangleNodeOld(NewGlobal);
+ verifyOld(OldName);
return OldName;
#endif
}
@@ -419,12 +470,13 @@
std::string ASTMangler::mangleAccessorEntityAsUSR(AccessorKind kind,
AddressorKind addressorKind,
- const ValueDecl *decl,
+ const AbstractStorageDecl *decl,
StringRef USRPrefix) {
beginManglingWithoutPrefix();
llvm::SaveAndRestore<bool> allowUnnamedRAII(AllowNamelessEntities, true);
Buffer << USRPrefix;
- appendAccessorEntity(kind, addressorKind, decl, /*isStatic*/ false);
+ appendAccessorEntity(getCodeForAccessorKind(kind, addressorKind), decl,
+ /*isStatic*/ false);
// We have a custom prefix, so finalize() won't verify for us. Do it manually.
verify(Storage.str().drop_front(USRPrefix.size()));
return finalize();
@@ -540,17 +592,8 @@
break;
}
} else if (decl->hasName()) {
- // FIXME: Should a mangled subscript name contain the string "subscript"?
- switch (decl->getBaseName().getKind()) {
- case DeclBaseName::Kind::Normal:
- appendIdentifier(decl->getBaseName().getIdentifier().str());
- break;
- case DeclBaseName::Kind::Subscript:
- appendIdentifier("subscript");
- break;
- case DeclBaseName::Kind::Destructor:
- llvm_unreachable("Destructors are not mangled using appendDeclName");
- }
+ assert(!decl->getBaseName().isSpecial() && "Cannot print special names");
+ appendIdentifier(decl->getBaseName().getIdentifier().str());
} else {
assert(AllowNamelessEntities && "attempt to mangle unnamed decl");
// Fall back to an unlikely name, so that we still generate a valid
@@ -1666,7 +1709,7 @@
}
void ASTMangler::appendInitializerEntity(const VarDecl *var) {
- appendEntity(var, "v", var->isStatic());
+ appendEntity(var, "vp", var->isStatic());
appendOperator("fi");
}
@@ -1847,48 +1890,28 @@
appendOperator(isDeallocating ? "fD" : "fd");
}
-static StringRef getCodeForAccessorKind(AccessorKind kind,
- AddressorKind addressorKind) {
- switch (kind) {
- case AccessorKind::NotAccessor: llvm_unreachable("bad accessor kind!");
- case AccessorKind::IsGetter: return "g";
- case AccessorKind::IsSetter: return "s";
- case AccessorKind::IsWillSet: return "w";
- case AccessorKind::IsDidSet: return "W";
- case AccessorKind::IsAddressor:
- // 'l' is for location. 'A' was taken.
- switch (addressorKind) {
- case AddressorKind::NotAddressor: llvm_unreachable("bad combo");
- case AddressorKind::Unsafe: return "lu";
- case AddressorKind::Owning: return "lO";
- case AddressorKind::NativeOwning: return "lo";
- case AddressorKind::NativePinning: return "lp";
- }
- llvm_unreachable("bad addressor kind");
- case AccessorKind::IsMutableAddressor:
- switch (addressorKind) {
- case AddressorKind::NotAddressor: llvm_unreachable("bad combo");
- case AddressorKind::Unsafe: return "au";
- case AddressorKind::Owning: return "aO";
- case AddressorKind::NativeOwning: return "ao";
- case AddressorKind::NativePinning: return "aP";
- }
- llvm_unreachable("bad addressor kind");
- case AccessorKind::IsMaterializeForSet: return "m";
- }
- llvm_unreachable("bad accessor kind");
-}
-
-void ASTMangler::appendAccessorEntity(AccessorKind kind,
- AddressorKind addressorKind,
- const ValueDecl *decl,
+void ASTMangler::appendAccessorEntity(StringRef accessorKindCode,
+ const AbstractStorageDecl *decl,
bool isStatic) {
- assert(kind != AccessorKind::NotAccessor);
appendContextOf(decl);
bindGenericParameters(decl->getDeclContext());
- appendDeclName(decl);
- appendDeclType(decl);
- appendOperator("f", getCodeForAccessorKind(kind, addressorKind));
+ if (isa<VarDecl>(decl)) {
+ appendDeclName(decl);
+ appendDeclType(decl);
+ appendOperator("v", accessorKindCode);
+ } else if (isa<SubscriptDecl>(decl)) {
+ appendDeclType(decl);
+
+ StringRef privateDiscriminator = getPrivateDiscriminatorIfNecessary(decl);
+ if (!privateDiscriminator.empty()) {
+ appendIdentifier(privateDiscriminator);
+ appendOperator("Ll");
+ }
+
+ appendOperator("i", accessorKindCode);
+ } else {
+ llvm_unreachable("Unknown type of AbstractStorageDecl");
+ }
if (isStatic)
appendOperator("Z");
}
@@ -1914,15 +1937,13 @@
if (auto func = dyn_cast<FuncDecl>(decl)) {
auto accessorKind = func->getAccessorKind();
if (accessorKind != AccessorKind::NotAccessor)
- return appendAccessorEntity(accessorKind, func->getAddressorKind(),
- func->getAccessorStorageDecl(),
- decl->isStatic());
+ return appendAccessorEntity(
+ getCodeForAccessorKind(accessorKind, func->getAddressorKind()),
+ func->getAccessorStorageDecl(), decl->isStatic());
}
- if (isa<VarDecl>(decl))
- return appendEntity(decl, "v", decl->isStatic());
- if (isa<SubscriptDecl>(decl))
- return appendEntity(decl, "i", decl->isStatic());
+ if (auto storageDecl = dyn_cast<AbstractStorageDecl>(decl))
+ return appendAccessorEntity("p", storageDecl, decl->isStatic());
if (isa<GenericTypeParamDecl>(decl))
return appendEntity(decl, "fp", decl->isStatic());
diff --git a/lib/AST/ASTPrinter.cpp b/lib/AST/ASTPrinter.cpp
index a76ab69..292e50c 100644
--- a/lib/AST/ASTPrinter.cpp
+++ b/lib/AST/ASTPrinter.cpp
@@ -1451,7 +1451,7 @@
bool mutatingGetter = ASD->getGetter() && ASD->isGetterMutating();
bool settable = ASD->isSettable(nullptr);
bool nonmutatingSetter = false;
- if (settable && ASD->isSetterNonMutating() && ASD->isInstanceMember() &&
+ if (settable && !ASD->isSetterMutating() && ASD->isInstanceMember() &&
!ASD->getDeclContext()->getDeclaredTypeInContext()
->hasReferenceSemantics())
nonmutatingSetter = true;
diff --git a/lib/AST/ASTVerifier.cpp b/lib/AST/ASTVerifier.cpp
index 23e276f..2b96084 100644
--- a/lib/AST/ASTVerifier.cpp
+++ b/lib/AST/ASTVerifier.cpp
@@ -2044,6 +2044,44 @@
}
}
+ if (auto getter = ASD->getGetter()) {
+ if (getter->isMutating() != ASD->isGetterMutating()) {
+ Out << "AbstractStorageDecl::isGetterMutating is out of sync"
+ " with whether the getter is actually mutating";
+ abort();
+ }
+ }
+ if (auto setter = ASD->getSetter()) {
+ if (setter->isMutating() != ASD->isSetterMutating()) {
+ Out << "AbstractStorageDecl::isSetterMutating is out of sync"
+ " with whether the setter is actually mutating";
+ abort();
+ }
+ }
+ if (auto materializeForSet = ASD->getMaterializeForSetFunc()) {
+ if (materializeForSet->isMutating() != ASD->isSetterMutating()) {
+ Out << "AbstractStorageDecl::isSetterMutating is out of sync"
+ " with whether materializeForSet is mutating";
+ abort();
+ }
+ }
+ if (ASD->hasAddressors()) {
+ if (auto addressor = ASD->getAddressor()) {
+ if (addressor->isMutating() != ASD->isGetterMutating()) {
+ Out << "AbstractStorageDecl::isGetterMutating is out of sync"
+ " with whether immutable addressor is mutating";
+ abort();
+ }
+ }
+ if (auto addressor = ASD->getMutableAddressor()) {
+ if (addressor->isMutating() != ASD->isSetterMutating()) {
+ Out << "AbstractStorageDecl::isSetterMutating is out of sync"
+ " with whether mutable addressor is mutating";
+ abort();
+ }
+ }
+ }
+
// Make sure we consistently set accessor overrides.
if (auto *baseASD = ASD->getOverriddenDecl()) {
if (ASD->getGetter() && baseASD->getGetter())
diff --git a/lib/AST/Decl.cpp b/lib/AST/Decl.cpp
index b1fe924..cc321e7 100644
--- a/lib/AST/Decl.cpp
+++ b/lib/AST/Decl.cpp
@@ -3352,63 +3352,6 @@
(void) pair;
}
-/// \brief Return true if the 'getter' is mutating, i.e. that it requires an
-/// lvalue base to be accessed.
-bool AbstractStorageDecl::isGetterMutating() const {
- switch (getStorageKind()) {
- case AbstractStorageDecl::Stored:
- return false;
-
- case AbstractStorageDecl::StoredWithObservers:
- case AbstractStorageDecl::StoredWithTrivialAccessors:
- case AbstractStorageDecl::InheritedWithObservers:
- case AbstractStorageDecl::ComputedWithMutableAddress:
- case AbstractStorageDecl::Computed:
- case AbstractStorageDecl::AddressedWithTrivialAccessors:
- case AbstractStorageDecl::AddressedWithObservers:
- assert(getGetter());
- return getGetter()->isMutating();
-
- case AbstractStorageDecl::Addressed:
- assert(getAddressor());
- return getAddressor()->isMutating();
- }
-
- llvm_unreachable("Unhandled AbstractStorageDecl in switch.");
-}
-
-/// \brief Return true if the 'setter' is nonmutating, i.e. that it can be
-/// called even on an immutable base value.
-bool AbstractStorageDecl::isSetterNonMutating() const {
- // Setters declared in reference type contexts are never mutating.
- if (auto contextType = getDeclContext()->getDeclaredInterfaceType()) {
- if (contextType->hasReferenceSemantics())
- return true;
- }
-
- switch (getStorageKind()) {
- case AbstractStorageDecl::Stored:
- case AbstractStorageDecl::StoredWithTrivialAccessors:
- // Instance member setters are mutating; static property setters and
- // top-level setters are not.
- return !isInstanceMember();
-
- case AbstractStorageDecl::StoredWithObservers:
- case AbstractStorageDecl::InheritedWithObservers:
- case AbstractStorageDecl::Computed:
- assert(getSetter());
- return !getSetter()->isMutating();
-
- case AbstractStorageDecl::Addressed:
- case AbstractStorageDecl::AddressedWithTrivialAccessors:
- case AbstractStorageDecl::AddressedWithObservers:
- case AbstractStorageDecl::ComputedWithMutableAddress:
- assert(getMutableAddressor());
- return !getMutableAddressor()->isMutating();
- }
- llvm_unreachable("bad storage kind");
-}
-
FuncDecl *AbstractStorageDecl::getAccessorFunction(AccessorKind kind) const {
switch (kind) {
case AccessorKind::IsGetter: return getGetter();
diff --git a/lib/AST/Expr.cpp b/lib/AST/Expr.cpp
index 8567dc4..819fd19 100644
--- a/lib/AST/Expr.cpp
+++ b/lib/AST/Expr.cpp
@@ -301,7 +301,7 @@
if ((accessKind != AccessKind::Write &&
memberDecl->isGetterMutating()) ||
(accessKind != AccessKind::Read &&
- !memberDecl->isSetterNonMutating())) {
+ memberDecl->isSetterMutating())) {
return AccessKind::ReadWrite;
}
@@ -1582,8 +1582,8 @@
bool hasTrailingClosure,
ConcreteDeclRef member,
bool implicit)
- : DynamicLookupExpr(ExprKind::DynamicSubscript),
- Base(base), Index(index), Member(member) {
+ : DynamicLookupExpr(ExprKind::DynamicSubscript, member, base),
+ Index(index) {
DynamicSubscriptExprBits.NumArgLabels = argLabels.size();
DynamicSubscriptExprBits.HasArgLabelLocs = !argLabelLocs.empty();
DynamicSubscriptExprBits.HasTrailingClosure = hasTrailingClosure;
diff --git a/lib/AST/Module.cpp b/lib/AST/Module.cpp
index 3d4396d..7146adc 100644
--- a/lib/AST/Module.cpp
+++ b/lib/AST/Module.cpp
@@ -1325,8 +1325,7 @@
bool KeepTokens)
: FileUnit(FileUnitKind::Source, M),
BufferID(bufferID ? *bufferID : -1),
- Kind(K),
- EnabledAndAllCorrectedTokens(KeepTokens, std::vector<Token>()) {
+ Kind(K) {
M.getASTContext().addDestructorCleanup(*this);
performAutoImport(*this, ModImpKind);
@@ -1335,6 +1334,9 @@
assert(!problem && "multiple main files?");
(void)problem;
}
+ if (KeepTokens) {
+ AllCorrectedTokens = std::vector<Token>();
+ }
}
SourceFile::~SourceFile() {}
diff --git a/lib/Basic/Mangler.cpp b/lib/Basic/Mangler.cpp
index 71eac3f..41e9b0d 100644
--- a/lib/Basic/Mangler.cpp
+++ b/lib/Basic/Mangler.cpp
@@ -197,6 +197,35 @@
#endif
}
+void Mangler::verifyOld(StringRef nameStr) {
+#ifndef NDEBUG
+ Demangler Dem;
+ NodePointer Root = demangleOldSymbolAsNode(nameStr, Dem);
+ if (!Root || treeContains(Root, Node::Kind::Suffix)) {
+ llvm::errs() << "Can't demangle: " << nameStr << '\n';
+ abort();
+ }
+ std::string Remangled = mangleNodeOld(Root);
+ if (Remangled == nameStr)
+ return;
+
+ // There are cases (e.g. with dependent associated types) which results in
+ // different remangled names. See ASTMangler::appendAssociatedTypeName.
+ // This is no problem for the compiler, but we have to be more tolerant for
+ // those cases. Instead we try to re-de-mangle the remangled name.
+ NodePointer RootOfRemangled = Dem.demangleSymbol(Remangled);
+ std::string ReDemangled = mangleNode(RootOfRemangled);
+ if (Remangled == ReDemangled)
+ return;
+
+ llvm::errs() << "Remangling failed:\n"
+ "original = " << nameStr << "\n"
+ "remangled = " << Remangled << "\n"
+ "re-demangled = " << ReDemangled << '\n';
+ abort();
+#endif
+}
+
void Mangler::appendIdentifier(StringRef ident) {
auto Iter = StringSubstitutions.find(ident);
if (Iter != StringSubstitutions.end())
diff --git a/lib/ClangImporter/ImportDecl.cpp b/lib/ClangImporter/ImportDecl.cpp
index a3f9515..27f152b 100644
--- a/lib/ClangImporter/ImportDecl.cpp
+++ b/lib/ClangImporter/ImportDecl.cpp
@@ -4584,6 +4584,7 @@
// Turn this into a computed property.
// FIXME: Fake locations for '{' and '}'?
+ result->setIsSetterMutating(false);
result->makeComputed(SourceLoc(), getter, setter, nullptr, SourceLoc());
addObjCAttribute(result, Impl.importIdentifier(decl->getIdentifier()));
applyPropertyOwnership(result, decl->getPropertyAttributesAsWritten());
@@ -5573,6 +5574,9 @@
markAsVariant(swiftSetter, *swift3SetterName);
}
+ if (swiftGetter) property->setIsGetterMutating(swiftGetter->isMutating());
+ if (swiftSetter) property->setIsSetterMutating(swiftSetter->isMutating());
+
// Make this a computed property.
property->makeComputed(SourceLoc(), swiftGetter, swiftSetter, nullptr,
SourceLoc());
@@ -6295,6 +6299,7 @@
subscript->setGenericEnvironment(dc->getGenericEnvironmentOfContext());
+ subscript->setIsSetterMutating(false);
subscript->makeComputed(SourceLoc(), getterThunk, setterThunk, nullptr,
SourceLoc());
auto indicesType = bodyParams->getType(C);
diff --git a/lib/Demangling/Demangler.cpp b/lib/Demangling/Demangler.cpp
index 7eb36de..665b7a2 100644
--- a/lib/Demangling/Demangler.cpp
+++ b/lib/Demangling/Demangler.cpp
@@ -404,7 +404,7 @@
case 'f': return demangleFunctionEntity();
case 'h': return createType(createWithChild(Node::Kind::Shared,
popTypeAndGetChild()));
- case 'i': return demangleEntity(Node::Kind::Subscript);
+ case 'i': return demangleSubscript();
case 'l': return demangleGenericSignature(/*hasParamCounts*/ false);
case 'm': return createType(createWithChild(Node::Kind::Metatype,
popNode(Node::Kind::Type)));
@@ -415,7 +415,7 @@
case 's': return createNode(Node::Kind::Module, STDLIB_NAME);
case 't': return popTuple();
case 'u': return demangleGenericType();
- case 'v': return demangleEntity(Node::Kind::Variable);
+ case 'v': return demangleVariable();
case 'w': return demangleValueWitness();
case 'x': return createType(getDependentGenericParamType(0, 0));
case 'y': return createNode(Node::Kind::EmptyList);
@@ -1744,11 +1744,44 @@
}
}
+NodePointer Demangler::demangleAccessor(NodePointer ChildNode) {
+ Node::Kind Kind;
+ switch (nextChar()) {
+ case 'm': Kind = Node::Kind::MaterializeForSet; break;
+ case 's': Kind = Node::Kind::Setter; break;
+ case 'g': Kind = Node::Kind::Getter; break;
+ case 'G': Kind = Node::Kind::GlobalGetter; break;
+ case 'w': Kind = Node::Kind::WillSet; break;
+ case 'W': Kind = Node::Kind::DidSet; break;
+ case 'a':
+ switch (nextChar()) {
+ case 'O': Kind = Node::Kind::OwningMutableAddressor; break;
+ case 'o': Kind = Node::Kind::NativeOwningMutableAddressor; break;
+ case 'P': Kind = Node::Kind::NativePinningMutableAddressor; break;
+ case 'u': Kind = Node::Kind::UnsafeMutableAddressor; break;
+ default: return nullptr;
+ }
+ break;
+ case 'l':
+ switch (nextChar()) {
+ case 'O': Kind = Node::Kind::OwningAddressor; break;
+ case 'o': Kind = Node::Kind::NativeOwningAddressor; break;
+ case 'p': Kind = Node::Kind::NativePinningAddressor; break;
+ case 'u': Kind = Node::Kind::UnsafeAddressor; break;
+ default: return nullptr;
+ }
+ break;
+ case 'p': // Pseudo-accessor referring to the variable/subscript itself
+ return ChildNode;
+ default: return nullptr;
+ }
+ NodePointer Entity = createWithChild(Kind, ChildNode);
+ return Entity;
+}
+
NodePointer Demangler::demangleFunctionEntity() {
enum {
None,
- Type,
- TypeAndName,
TypeAndMaybePrivateName,
TypeAndIndex,
Index
@@ -1765,32 +1798,6 @@
Args = TypeAndMaybePrivateName; Kind = Node::Kind::Allocator; break;
case 'c':
Args = TypeAndMaybePrivateName; Kind = Node::Kind::Constructor; break;
- case 'g': Args = TypeAndName; Kind = Node::Kind::Getter; break;
- case 'G': Args = TypeAndName; Kind = Node::Kind::GlobalGetter; break;
- case 's': Args = TypeAndName; Kind = Node::Kind::Setter; break;
- case 'm': Args = TypeAndName; Kind = Node::Kind::MaterializeForSet; break;
- case 'w': Args = TypeAndName; Kind = Node::Kind::WillSet; break;
- case 'W': Args = TypeAndName; Kind = Node::Kind::DidSet; break;
- case 'a':
- Args = TypeAndName;
- switch (nextChar()) {
- case 'O': Kind = Node::Kind::OwningMutableAddressor; break;
- case 'o': Kind = Node::Kind::NativeOwningMutableAddressor; break;
- case 'P': Kind = Node::Kind::NativePinningMutableAddressor; break;
- case 'u': Kind = Node::Kind::UnsafeMutableAddressor; break;
- default: return nullptr;
- }
- break;
- case 'l':
- Args = TypeAndName;
- switch (nextChar()) {
- case 'O': Kind = Node::Kind::OwningAddressor; break;
- case 'o': Kind = Node::Kind::NativeOwningAddressor; break;
- case 'p': Kind = Node::Kind::NativePinningAddressor; break;
- case 'u': Kind = Node::Kind::UnsafeAddressor; break;
- default: return nullptr;
- }
- break;
case 'U': Args = TypeAndIndex; Kind = Node::Kind::ExplicitClosure; break;
case 'u': Args = TypeAndIndex; Kind = Node::Kind::ImplicitClosure; break;
case 'A': Args = Index; Kind = Node::Kind::DefaultArgumentInitializer; break;
@@ -1802,13 +1809,6 @@
switch (Args) {
case None:
break;
- case Type:
- Child1 = popNode(Node::Kind::Type);
- break;
- case TypeAndName:
- Child2 = popNode(Node::Kind::Type);
- Child1 = popNode(isDeclName);
- break;
case TypeAndMaybePrivateName:
Child1 = popNode(Node::Kind::PrivateDeclName);
Child2 = popNode(Node::Kind::Type);
@@ -1825,7 +1825,6 @@
switch (Args) {
case None:
break;
- case Type:
case Index:
Entity = addChild(Entity, Child1);
break;
@@ -1834,7 +1833,6 @@
Entity = addChild(Entity, Child1);
Entity = addChild(Entity, Child2);
break;
- case TypeAndName:
case TypeAndIndex:
Entity = addChild(Entity, Child1);
Entity = addChild(Entity, Child2);
@@ -1850,6 +1848,25 @@
return createWithChildren(Kind, Context, Name, Type);
}
+NodePointer Demangler::demangleVariable() {
+ NodePointer Variable = demangleEntity(Node::Kind::Variable);
+ return demangleAccessor(Variable);
+}
+
+NodePointer Demangler::demangleSubscript() {
+ NodePointer PrivateName = popNode(Node::Kind::PrivateDeclName);
+ NodePointer Type = popNode(Node::Kind::Type);
+ NodePointer Context = popContext();
+
+ NodePointer Subscript = createNode(Node::Kind::Subscript);
+ Subscript->addChild(Context, *this);
+ Subscript->addChild(Type, *this);
+ if (PrivateName)
+ Subscript->addChild(PrivateName, *this);
+
+ return demangleAccessor(Subscript);
+}
+
NodePointer Demangler::demangleProtocolList() {
NodePointer TypeList = createNode(Node::Kind::TypeList);
NodePointer ProtoList = createWithChild(Node::Kind::ProtocolList, TypeList);
diff --git a/lib/Demangling/NodePrinter.cpp b/lib/Demangling/NodePrinter.cpp
index 8fec27a..1a617b3 100644
--- a/lib/Demangling/NodePrinter.cpp
+++ b/lib/Demangling/NodePrinter.cpp
@@ -611,6 +611,9 @@
/// The main big print function.
NodePointer print(NodePointer Node, bool asPrefixContext = false);
+ NodePointer printAbstractStorage(NodePointer Node, bool asPrefixContent,
+ StringRef ExtraName);
+
/// Utility function to print entities.
///
/// \param Entity The entity node to print
@@ -623,11 +626,14 @@
/// \param ExtraName An extra name added to the entity name (if any).
/// \param ExtraIndex An extra index added to the entity name (if any),
/// e.g. closure #1
+ /// \param OverwriteName If non-empty, print this name instead of the one
+ /// provided by the node. Gets printed even if hasName is false.
/// \return If a non-null node is returned it's a context which must be
/// printed in postfix-form after the entity: "<entity> in <context>".
NodePointer printEntity(NodePointer Entity, bool asPrefixContext,
TypePrinting TypePr, bool hasName,
- StringRef ExtraName = "", int ExtraIndex = -1);
+ StringRef ExtraName = "", int ExtraIndex = -1,
+ StringRef OverwriteName = "");
};
} // end anonymous namespace
@@ -822,9 +828,12 @@
return printEntity(Node, asPrefixContext, TypePrinting::WithColon,
/*hasName*/true);
case Node::Kind::Function:
- case Node::Kind::Subscript:
return printEntity(Node, asPrefixContext, TypePrinting::FunctionStyle,
/*hasName*/true);
+ case Node::Kind::Subscript:
+ return printEntity(Node, asPrefixContext, TypePrinting::FunctionStyle,
+ /*hasName*/false, /*ExtraName*/"", /*ExtraIndex*/-1,
+ "subscript");
case Node::Kind::GenericTypeParamDecl:
return printEntity(Node, asPrefixContext, TypePrinting::NoType,
/*hasName*/true);
@@ -1444,47 +1453,47 @@
return nullptr;
}
case Node::Kind::OwningAddressor:
- return printEntity(Node, asPrefixContext, TypePrinting::WithColon,
- /*hasName*/true, "owningAddressor");
+ return printAbstractStorage(Node->getFirstChild(), asPrefixContext,
+ "owningAddressor");
case Node::Kind::OwningMutableAddressor:
- return printEntity(Node, asPrefixContext, TypePrinting::WithColon,
- /*hasName*/true, "owningMutableAddressor");
+ return printAbstractStorage(Node->getFirstChild(), asPrefixContext,
+ "owningMutableAddressor");
case Node::Kind::NativeOwningAddressor:
- return printEntity(Node, asPrefixContext, TypePrinting::WithColon,
- /*hasName*/true, "nativeOwningAddressor");
+ return printAbstractStorage(Node->getFirstChild(), asPrefixContext,
+ "nativeOwningAddressor");
case Node::Kind::NativeOwningMutableAddressor:
- return printEntity(Node, asPrefixContext, TypePrinting::WithColon,
- /*hasName*/true, "nativeOwningMutableAddressor");
+ return printAbstractStorage(Node->getFirstChild(), asPrefixContext,
+ "nativeOwningMutableAddressor");
case Node::Kind::NativePinningAddressor:
- return printEntity(Node, asPrefixContext, TypePrinting::WithColon,
- /*hasName*/true, "nativePinningAddressor");
+ return printAbstractStorage(Node->getFirstChild(), asPrefixContext,
+ "nativePinningAddressor");
case Node::Kind::NativePinningMutableAddressor:
- return printEntity(Node, asPrefixContext, TypePrinting::WithColon,
- /*hasName*/true, "nativePinningMutableAddressor");
+ return printAbstractStorage(Node->getFirstChild(), asPrefixContext,
+ "nativePinningMutableAddressor");
case Node::Kind::UnsafeAddressor:
- return printEntity(Node, asPrefixContext, TypePrinting::WithColon,
- /*hasName*/true, "unsafeAddressor");
+ return printAbstractStorage(Node->getFirstChild(), asPrefixContext,
+ "unsafeAddressor");
case Node::Kind::UnsafeMutableAddressor:
- return printEntity(Node, asPrefixContext, TypePrinting::WithColon,
- /*hasName*/true, "unsafeMutableAddressor");
+ return printAbstractStorage(Node->getFirstChild(), asPrefixContext,
+ "unsafeMutableAddressor");
case Node::Kind::GlobalGetter:
- return printEntity(Node, asPrefixContext, TypePrinting::WithColon,
- /*hasName*/true, "getter");
+ return printAbstractStorage(Node->getFirstChild(), asPrefixContext,
+ "getter");
case Node::Kind::Getter:
- return printEntity(Node, asPrefixContext, TypePrinting::WithColon,
- /*hasName*/true, "getter");
+ return printAbstractStorage(Node->getFirstChild(), asPrefixContext,
+ "getter");
case Node::Kind::Setter:
- return printEntity(Node, asPrefixContext, TypePrinting::WithColon,
- /*hasName*/true, "setter");
+ return printAbstractStorage(Node->getFirstChild(), asPrefixContext,
+ "setter");
case Node::Kind::MaterializeForSet:
- return printEntity(Node, asPrefixContext, TypePrinting::WithColon,
- /*hasName*/true, "materializeForSet");
+ return printAbstractStorage(Node->getFirstChild(), asPrefixContext,
+ "materializeForSet");
case Node::Kind::WillSet:
- return printEntity(Node, asPrefixContext, TypePrinting::WithColon,
- /*hasName*/true, "willset");
+ return printAbstractStorage(Node->getFirstChild(), asPrefixContext,
+ "willset");
case Node::Kind::DidSet:
- return printEntity(Node, asPrefixContext, TypePrinting::WithColon,
- /*hasName*/true, "didset");
+ return printAbstractStorage(Node->getFirstChild(), asPrefixContext,
+ "didset");
case Node::Kind::Allocator:
return printEntity(Node, asPrefixContext, TypePrinting::FunctionStyle,
/*hasName*/false, isClassType(Node->getChild(0)) ?
@@ -1749,9 +1758,26 @@
printer_unreachable("bad node kind!");
}
+NodePointer NodePrinter::printAbstractStorage(NodePointer Node,
+ bool asPrefixContent,
+ StringRef ExtraName) {
+ switch (Node->getKind()) {
+ case Node::Kind::Variable:
+ return printEntity(Node, asPrefixContent, TypePrinting::WithColon,
+ /*hasName*/true, ExtraName);
+ case Node::Kind::Subscript:
+ return printEntity(Node, asPrefixContent, TypePrinting::WithColon,
+ /*hasName*/false, ExtraName, /*ExtraIndex*/-1,
+ "subscript");
+ default:
+ printer_unreachable("Not an abstract storage node");
+ }
+}
+
NodePointer NodePrinter::
printEntity(NodePointer Entity, bool asPrefixContext, TypePrinting TypePr,
- bool hasName, StringRef ExtraName, int ExtraIndex) {
+ bool hasName, StringRef ExtraName, int ExtraIndex,
+ StringRef OverwriteName) {
// Either we print the context in prefix form "<context>.<name>" or in
// suffix form "<name> in <context>".
bool MultiWordName = ExtraName.contains(' ');
@@ -1783,7 +1809,7 @@
}
}
- if (hasName) {
+ if (hasName || !OverwriteName.empty()) {
assert(ExtraIndex < 0 && "Can't have a name and extra index");
if (!ExtraName.empty() && MultiWordName) {
Printer << ExtraName;
@@ -1791,7 +1817,11 @@
ExtraName = "";
}
size_t CurrentPos = Printer.getStringRef().size();
- print(Entity->getChild(1));
+ if (!OverwriteName.empty()) {
+ Printer << OverwriteName;
+ } else {
+ print(Entity->getChild(1));
+ }
if (Printer.getStringRef().size() != CurrentPos && !ExtraName.empty())
Printer << '.';
}
diff --git a/lib/Demangling/OldDemangler.cpp b/lib/Demangling/OldDemangler.cpp
index 9f92584..20ce3f0 100644
--- a/lib/Demangling/OldDemangler.cpp
+++ b/lib/Demangling/OldDemangler.cpp
@@ -1166,6 +1166,8 @@
// entity-name
Node::Kind entityKind;
bool hasType = true;
+ // Wrap the enclosed entity in a variable or subscript node
+ bool wrapEntity = false;
NodePointer name = nullptr;
if (Mangled.nextIf('D')) {
entityKind = Node::Kind::Deallocator;
@@ -1184,6 +1186,7 @@
} else if (Mangled.nextIf('c')) {
entityKind = Node::Kind::Constructor;
} else if (Mangled.nextIf('a')) {
+ wrapEntity = true;
if (Mangled.nextIf('O')) {
entityKind = Node::Kind::OwningMutableAddressor;
} else if (Mangled.nextIf('o')) {
@@ -1198,6 +1201,7 @@
name = demangleDeclName();
if (!name) return nullptr;
} else if (Mangled.nextIf('l')) {
+ wrapEntity = true;
if (Mangled.nextIf('O')) {
entityKind = Node::Kind::OwningAddressor;
} else if (Mangled.nextIf('o')) {
@@ -1212,26 +1216,32 @@
name = demangleDeclName();
if (!name) return nullptr;
} else if (Mangled.nextIf('g')) {
+ wrapEntity = true;
entityKind = Node::Kind::Getter;
name = demangleDeclName();
if (!name) return nullptr;
} else if (Mangled.nextIf('G')) {
+ wrapEntity = true;
entityKind = Node::Kind::GlobalGetter;
name = demangleDeclName();
if (!name) return nullptr;
} else if (Mangled.nextIf('s')) {
+ wrapEntity = true;
entityKind = Node::Kind::Setter;
name = demangleDeclName();
if (!name) return nullptr;
} else if (Mangled.nextIf('m')) {
+ wrapEntity = true;
entityKind = Node::Kind::MaterializeForSet;
name = demangleDeclName();
if (!name) return nullptr;
} else if (Mangled.nextIf('w')) {
+ wrapEntity = true;
entityKind = Node::Kind::WillSet;
name = demangleDeclName();
if (!name) return nullptr;
} else if (Mangled.nextIf('W')) {
+ wrapEntity = true;
entityKind = Node::Kind::DidSet;
name = demangleDeclName();
if (!name) return nullptr;
@@ -1263,14 +1273,69 @@
}
NodePointer entity = Factory.createNode(entityKind);
- entity->addChild(context, Factory);
+ if (wrapEntity) {
+ // Create a subscript or variable node and make it the accessor's child
+ NodePointer wrappedEntity;
+ bool isSubscript = false;
- if (name) entity->addChild(name, Factory);
+ // Rewrite the subscript's name to match the new mangling scheme
+ switch (name->getKind()) {
+ case Node::Kind::Identifier:
+ if (name->getText() == "subscript") {
+ isSubscript = true;
+ // Subscripts have no 'subscript' identifier name
+ name = nullptr;
+ }
+ break;
+ case Node::Kind::PrivateDeclName: // identifier file-discriminator?
+ if (name->getNumChildren() > 1 &&
+ name->getChild(1)->getText() == "subscript") {
+ isSubscript = true;
- if (hasType) {
- auto type = demangleType();
- if (!type) return nullptr;
- entity->addChild(type, Factory);
+ auto discriminator = name->getChild(0);
+
+ // Create new PrivateDeclName with no 'subscript' identifer child
+ name = Factory.createNode(Node::Kind::PrivateDeclName);
+ name->addChild(discriminator, Factory);
+ }
+ break;
+ default:
+ break;
+ }
+
+ // Create wrapped entity node
+ if (isSubscript) {
+ wrappedEntity = Factory.createNode(Node::Kind::Subscript);
+ } else {
+ wrappedEntity = Factory.createNode(Node::Kind::Variable);
+ }
+ wrappedEntity->addChild(context, Factory);
+
+ // Variables mangle their name before their type
+ if (!isSubscript)
+ wrappedEntity->addChild(name, Factory);
+
+ if (hasType) {
+ auto type = demangleType();
+ if (!type) return nullptr;
+ wrappedEntity->addChild(type, Factory);
+ }
+
+ // Subscripts mangle their file-discriminator after the type
+ if (isSubscript && name)
+ wrappedEntity->addChild(name, Factory);
+
+ entity->addChild(wrappedEntity, Factory);
+ } else {
+ entity->addChild(context, Factory);
+
+ if (name) entity->addChild(name, Factory);
+
+ if (hasType) {
+ auto type = demangleType();
+ if (!type) return nullptr;
+ entity->addChild(type, Factory);
+ }
}
if (isStatic) {
diff --git a/lib/Demangling/OldRemangler.cpp b/lib/Demangling/OldRemangler.cpp
index 55f4e37..0f790ca 100644
--- a/lib/Demangling/OldRemangler.cpp
+++ b/lib/Demangling/OldRemangler.cpp
@@ -257,6 +257,8 @@
void mangleIndex(Node::IndexType index);
void mangleIdentifier(StringRef name, OperatorKind operatorKind);
+ void mangleAccessor(Node *storageNode, StringRef accessorCode,
+ EntityContext &ctx);
void mangleChildNodes(Node *node) { mangleNodes(node->begin(), node->end()); }
void mangleNodes(Node::iterator i, Node::iterator e) {
@@ -766,6 +768,29 @@
mangleNamedAndTypedEntity(node, 'i', "", ctx);
}
+void Remangler::mangleAccessor(Node *storageNode, StringRef accessorCode,
+ EntityContext &ctx) {
+ Out << 'F';
+ mangleEntityContext(storageNode->getChild(0), ctx);
+ Out << accessorCode;
+ switch (storageNode->getKind()) {
+ case Demangle::Node::Kind::Variable:
+ mangleChildNode(storageNode, 1);
+ mangleEntityType(storageNode->getChild(2), ctx);
+ break;
+ case Demangle::Node::Kind::Subscript:
+ if (storageNode->getNumChildren() > 2 &&
+ storageNode->getChild(2)->getKind() == Node::Kind::PrivateDeclName) {
+ mangleChildNode(storageNode, 2);
+ }
+ mangleIdentifier("subscript", OperatorKind::NotOperator);
+ mangleEntityType(storageNode->getChild(1), ctx);
+ break;
+ default:
+ unreachable("Not a storage node");
+ }
+}
+
void Remangler::mangleInitializer(Node *node, EntityContext &ctx) {
mangleSimpleEntity(node, 'I', "i", ctx);
}
@@ -800,61 +825,61 @@
}
void Remangler::mangleGetter(Node *node, EntityContext &ctx) {
- mangleNamedAndTypedEntity(node, 'F', "g", ctx);
+ mangleAccessor(node->getFirstChild(), "g", ctx);
}
void Remangler::mangleGlobalGetter(Node *node, EntityContext &ctx) {
- mangleNamedAndTypedEntity(node, 'F', "G", ctx);
+ mangleAccessor(node->getFirstChild(), "G", ctx);
}
void Remangler::mangleSetter(Node *node, EntityContext &ctx) {
- mangleNamedAndTypedEntity(node, 'F', "s", ctx);
+ mangleAccessor(node->getFirstChild(), "s", ctx);
}
void Remangler::mangleMaterializeForSet(Node *node, EntityContext &ctx) {
- mangleNamedAndTypedEntity(node, 'F', "m", ctx);
+ mangleAccessor(node->getFirstChild(), "m", ctx);
}
void Remangler::mangleWillSet(Node *node, EntityContext &ctx) {
- mangleNamedAndTypedEntity(node, 'F', "w", ctx);
+ mangleAccessor(node->getFirstChild(), "w", ctx);
}
void Remangler::mangleDidSet(Node *node, EntityContext &ctx) {
- mangleNamedAndTypedEntity(node, 'F', "W", ctx);
+ mangleAccessor(node->getFirstChild(), "W", ctx);
}
void Remangler::mangleOwningMutableAddressor(Node *node, EntityContext &ctx) {
- mangleNamedAndTypedEntity(node, 'F', "aO", ctx);
+ mangleAccessor(node->getFirstChild(), "aO", ctx);
}
void Remangler::mangleNativeOwningMutableAddressor(Node *node,
EntityContext &ctx) {
- mangleNamedAndTypedEntity(node, 'F', "ao", ctx);
+ mangleAccessor(node->getFirstChild(), "ao", ctx);
}
void Remangler::mangleNativePinningMutableAddressor(Node *node,
EntityContext &ctx) {
- mangleNamedAndTypedEntity(node, 'F', "ap", ctx);
+ mangleAccessor(node->getFirstChild(), "ap", ctx);
}
void Remangler::mangleUnsafeMutableAddressor(Node *node, EntityContext &ctx) {
- mangleNamedAndTypedEntity(node, 'F', "au", ctx);
+ mangleAccessor(node->getFirstChild(), "au", ctx);
}
void Remangler::mangleOwningAddressor(Node *node, EntityContext &ctx) {
- mangleNamedAndTypedEntity(node, 'F', "lO", ctx);
+ mangleAccessor(node->getFirstChild(), "lO", ctx);
}
void Remangler::mangleNativeOwningAddressor(Node *node, EntityContext &ctx) {
- mangleNamedAndTypedEntity(node, 'F', "lo", ctx);
+ mangleAccessor(node->getFirstChild(), "lo", ctx);
}
void Remangler::mangleNativePinningAddressor(Node *node, EntityContext &ctx) {
- mangleNamedAndTypedEntity(node, 'F', "lp", ctx);
+ mangleAccessor(node->getFirstChild(), "lp", ctx);
}
void Remangler::mangleUnsafeAddressor(Node *node, EntityContext &ctx) {
- mangleNamedAndTypedEntity(node, 'F', "lu", ctx);
+ mangleAccessor(node->getFirstChild(), "lu", ctx);
}
void Remangler::mangleExplicitClosure(Node *node, EntityContext &ctx) {
diff --git a/lib/Demangling/Remangler.cpp b/lib/Demangling/Remangler.cpp
index efdda05..13110e5 100644
--- a/lib/Demangling/Remangler.cpp
+++ b/lib/Demangling/Remangler.cpp
@@ -274,6 +274,7 @@
void mangleAnyGenericType(Node *node, char TypeOp);
void mangleGenericArgs(Node *node, char &Separator);
void mangleAnyConstructor(Node *node, char kindOp);
+ void mangleAbstractStorage(Node *node, StringRef accessorCode);
#define NODE(ID) \
void mangle##ID(Node *node);
@@ -478,6 +479,16 @@
}
}
+void Remangler::mangleAbstractStorage(Node *node, StringRef accessorCode) {
+ mangleChildNodes(node);
+ switch (node->getKind()) {
+ case Node::Kind::Subscript: Buffer << "i"; break;
+ case Node::Kind::Variable: Buffer << "v"; break;
+ default: unreachable("Not a storage node");
+ }
+ Buffer << accessorCode;
+}
+
void Remangler::mangleAllocator(Node *node) {
mangleAnyConstructor(node, 'C');
}
@@ -770,8 +781,7 @@
}
void Remangler::mangleDidSet(Node *node) {
- mangleChildNodes(node);
- Buffer << "fW";
+ mangleAbstractStorage(node->getFirstChild(), "W");
}
void Remangler::mangleDirectness(Node *node) {
@@ -1052,8 +1062,7 @@
}
void Remangler::mangleGetter(Node *node) {
- mangleChildNodes(node);
- Buffer << "fg";
+ mangleAbstractStorage(node->getFirstChild(), "g");
}
void Remangler::mangleGlobal(Node *node) {
@@ -1093,8 +1102,7 @@
}
void Remangler::mangleGlobalGetter(Node *node) {
- mangleChildNodes(node);
- Buffer << "fG";
+ mangleAbstractStorage(node->getFirstChild(), "G");
}
void Remangler::mangleIdentifier(Node *node) {
@@ -1274,8 +1282,7 @@
}
void Remangler::mangleMaterializeForSet(Node *node) {
- mangleChildNodes(node);
- Buffer << "fm";
+ mangleAbstractStorage(node->getFirstChild(), "m");
}
void Remangler::mangleMetatype(Node *node) {
@@ -1319,23 +1326,19 @@
}
void Remangler::mangleNativeOwningAddressor(Node *node) {
- mangleChildNodes(node);
- Buffer << "flo";
+ mangleAbstractStorage(node->getFirstChild(), "lo");
}
void Remangler::mangleNativeOwningMutableAddressor(Node *node) {
- mangleChildNodes(node);
- Buffer << "fao";
+ mangleAbstractStorage(node->getFirstChild(), "ao");
}
void Remangler::mangleNativePinningAddressor(Node *node) {
- mangleChildNodes(node);
- Buffer << "flp";
+ mangleAbstractStorage(node->getFirstChild(), "lp");
}
void Remangler::mangleNativePinningMutableAddressor(Node *node) {
- mangleChildNodes(node);
- Buffer << "faP";
+ mangleAbstractStorage(node->getFirstChild(), "aP");
}
void Remangler::mangleNominalTypeDescriptor(Node *node) {
@@ -1366,13 +1369,11 @@
}
void Remangler::mangleOwningAddressor(Node *node) {
- mangleChildNodes(node);
- Buffer << "flO";
+ mangleAbstractStorage(node->getFirstChild(), "lO");
}
void Remangler::mangleOwningMutableAddressor(Node *node) {
- mangleChildNodes(node);
- Buffer << "faO";
+ mangleAbstractStorage(node->getFirstChild(), "aO");
}
void Remangler::manglePartialApplyForwarder(Node *node) {
@@ -1526,8 +1527,7 @@
}
void Remangler::mangleSetter(Node *node) {
- mangleChildNodes(node);
- Buffer << "fs";
+ mangleAbstractStorage(node->getFirstChild(), "s");
}
void Remangler::mangleSpecializationPassID(Node *node) {
@@ -1548,8 +1548,7 @@
}
void Remangler::mangleSubscript(Node *node) {
- mangleChildNodes(node);
- Buffer << 'i';
+ mangleAbstractStorage(node, "p");
}
void Remangler::mangleSuffix(Node *node) {
@@ -1625,13 +1624,11 @@
}
void Remangler::mangleUnsafeAddressor(Node *node) {
- mangleChildNodes(node);
- Buffer << "flu";
+ mangleAbstractStorage(node->getFirstChild(), "lu");
}
void Remangler::mangleUnsafeMutableAddressor(Node *node) {
- mangleChildNodes(node);
- Buffer << "fau";
+ mangleAbstractStorage(node->getFirstChild(), "au");
}
void Remangler::mangleValueWitness(Node *node) {
@@ -1651,8 +1648,7 @@
}
void Remangler::mangleVariable(Node *node) {
- mangleChildNodes(node);
- Buffer << 'v';
+ mangleAbstractStorage(node, "p");
}
void Remangler::mangleVTableAttribute(Node *node) {
@@ -1670,8 +1666,7 @@
}
void Remangler::mangleWillSet(Node *node) {
- mangleChildNodes(node);
- Buffer << "fw";
+ mangleAbstractStorage(node->getFirstChild(), "w");
}
void Remangler::mangleReflectionMetadataBuiltinDescriptor(Node *node) {
diff --git a/lib/IDE/Refactoring.cpp b/lib/IDE/Refactoring.cpp
index 00280fc..7bf51d8 100644
--- a/lib/IDE/Refactoring.cpp
+++ b/lib/IDE/Refactoring.cpp
@@ -1025,7 +1025,7 @@
std::vector<NoteRegion> NoteRegions(Renamer.Ranges.size());
std::transform(Ranges.begin(), Ranges.end(), NoteRegions.begin(),
- [&SM, BufferId](RenameRangeDetail &Detail) -> NoteRegion {
+ [&SM](RenameRangeDetail &Detail) -> NoteRegion {
auto Start = SM.getLineAndColumn(Detail.Range.getStart());
auto End = SM.getLineAndColumn(Detail.Range.getEnd());
return {Detail.RangeKind, Start.first, Start.second, End.first, End.second, Detail.Index};
@@ -1257,15 +1257,10 @@
/// Find all tokens included by an expression.
llvm::ArrayRef<Token> getExprSlice(Expr *E) {
- auto TokenComp = [&](const Token &LHS, SourceLoc Loc) {
- return SM.isBeforeInBuffer(LHS.getLoc(), Loc);
- };
SourceLoc StartLoc = E->getStartLoc();
SourceLoc EndLoc = E->getEndLoc();
- auto StartIt = std::lower_bound(AllTokens.begin(), AllTokens.end(),
- StartLoc, TokenComp);
- auto EndIt = std::lower_bound(AllTokens.begin(), AllTokens.end(),
- EndLoc, TokenComp);
+ auto StartIt = token_lower_bound(AllTokens, StartLoc);
+ auto EndIt = token_lower_bound(AllTokens, EndLoc);
assert(StartIt->getLoc() == StartLoc);
assert(EndIt->getLoc() == EndLoc);
return AllTokens.slice(StartIt - AllTokens.begin(), EndIt - StartIt + 1);
@@ -1333,16 +1328,16 @@
Collector.walk(BS);
if (ExtractRepeated) {
- unsigned BufferId = *TheFile->getBufferID();
-
// Tokenize the brace statement; all expressions should have their tokens
// in this array.
- std::vector<Token> AllToks(tokenize(Ctx.LangOpts, SM, BufferId,
- /*start offset*/SM.getLocOffsetInBuffer(BS->getStartLoc(), BufferId),
- /*end offset*/SM.getLocOffsetInBuffer(BS->getEndLoc(), BufferId)));
+ auto AllTokens = TheFile->getAllTokens();
+ auto StartIt = token_lower_bound(AllTokens, BS->getStartLoc());
+ auto EndIt = token_lower_bound(AllTokens, BS->getEndLoc());
// Collect all expressions we are going to extract.
- SimilarExprCollector(SM, SelectedExpr, AllToks, AllExpressions).walk(BS);
+ SimilarExprCollector(SM, SelectedExpr,
+ AllTokens.slice(StartIt - AllTokens.begin(), EndIt - StartIt + 1),
+ AllExpressions).walk(BS);
} else {
AllExpressions.insert(SelectedExpr);
}
@@ -2135,10 +2130,8 @@
});
}
- std::vector<Token> Tokens =
- swift::tokenize(SF.getASTContext().LangOpts, SM, BufferID, 0, 0, true);
NameMatcher Resolver(SF);
- return Resolver.resolve(UnresolvedLocs, Tokens);
+ return Resolver.resolve(UnresolvedLocs, SF.getAllTokens());
}
int swift::ide::syntacticRename(SourceFile *SF, ArrayRef<RenameLoc> RenameLocs,
diff --git a/lib/IDE/SwiftSourceDocInfo.cpp b/lib/IDE/SwiftSourceDocInfo.cpp
index 1de7b39..92befc6 100644
--- a/lib/IDE/SwiftSourceDocInfo.cpp
+++ b/lib/IDE/SwiftSourceDocInfo.cpp
@@ -875,7 +875,7 @@
};
- std::vector<Token> TokensInRange;
+ ArrayRef<Token> TokensInRange;
SourceLoc Start;
SourceLoc End;
@@ -1066,32 +1066,41 @@
createInstance(SourceFile &File, unsigned StartOff, unsigned Length) {
SourceManager &SM = File.getASTContext().SourceMgr;
unsigned BufferId = File.getBufferID().getValue();
-
- LangOptions Opts = File.getASTContext().LangOpts;
- Opts.AttachCommentsToDecls = true;
- std::vector<Token> AllTokens = tokenize(Opts, SM, BufferId, 0, 0, false);
- auto TokenComp = [&](Token &LHS, SourceLoc Loc) {
- return SM.isBeforeInBuffer(LHS.getLoc(), Loc);
- };
-
+ auto AllTokens = File.getAllTokens();
SourceLoc StartRaw = SM.getLocForOffset(BufferId, StartOff);
SourceLoc EndRaw = SM.getLocForOffset(BufferId, StartOff + Length);
// This points to the first token after or on the start loc.
- auto StartIt = std::lower_bound(AllTokens.begin(), AllTokens.end(), StartRaw,
- TokenComp);
- // This points to the first token after or on the end loc;
- auto EndIt = std::lower_bound(AllTokens.begin(), AllTokens.end(), EndRaw,
- TokenComp);
+ auto StartIt = token_lower_bound(AllTokens, StartRaw);
+
+ // Skip all the comments.
+ while(StartIt != AllTokens.end()) {
+ if (StartIt->getKind() != tok::comment)
+ break;
+ StartIt ++;
+ }
+
// Erroneous case.
- if (StartIt == AllTokens.end() || EndIt == AllTokens.begin())
+ if (StartIt == AllTokens.end())
return nullptr;
- // The start token is inclusive.
- unsigned StartIdx = StartIt - AllTokens.begin();
+ // This points to the first token after or on the end loc;
+ auto EndIt = token_lower_bound(AllTokens, EndRaw);
+ // Adjust end token to skip comments.
+ while (EndIt != AllTokens.begin()) {
+ EndIt --;
+ if (EndIt->getKind() != tok::comment)
+ break;
+ }
+
+ // Erroneous case.
+ if (EndIt < StartIt)
+ return nullptr;
+
+ unsigned StartIdx = StartIt - AllTokens.begin();
return std::unique_ptr<Implementation>(new Implementation(File,
- llvm::makeArrayRef(AllTokens.data() + StartIdx, EndIt - StartIt)));
+ AllTokens.slice(StartIdx, EndIt - StartIt + 1)));
}
static std::unique_ptr<Implementation>
diff --git a/lib/IDE/TypeReconstruction.cpp b/lib/IDE/TypeReconstruction.cpp
index 9a1cf2c..78baaf1 100644
--- a/lib/IDE/TypeReconstruction.cpp
+++ b/lib/IDE/TypeReconstruction.cpp
@@ -71,7 +71,7 @@
decltype(m_decls)::const_iterator end() { return m_decls.end(); }
};
- bool lookupQualified(ModuleDecl *entry, Identifier name, NLOptions options,
+ bool lookupQualified(ModuleDecl *entry, DeclBaseName name, NLOptions options,
LazyResolver *typeResolver, ValueDecls &decls) {
if (!entry)
return false;
@@ -81,7 +81,7 @@
return decls.size() > decls_size;
}
- bool lookupValue(ModuleDecl *entry, Identifier name,
+ bool lookupValue(ModuleDecl *entry, DeclBaseName name,
ModuleDecl::AccessPathTy accessPath, NLKind lookupKind,
ValueDecls &decls) {
if (!entry)
@@ -129,7 +129,7 @@
return DeclsLookupSource(source._module, decl);
}
- void lookupQualified(Identifier name, NLOptions options,
+ void lookupQualified(DeclBaseName name, NLOptions options,
LazyResolver *typeResolver, ValueDecls &result) {
if (_type == LookupKind::Crawler) {
ASTContext *ast_ctx = _crawler._ast;
@@ -154,7 +154,7 @@
return;
}
- void lookupValue(ModuleDecl::AccessPathTy path, Identifier name, NLKind kind,
+ void lookupValue(ModuleDecl::AccessPathTy path, DeclBaseName name, NLKind kind,
ValueDecls &result) {
if (_type == LookupKind::Crawler) {
ASTContext *ast_ctx = _crawler._ast;
@@ -412,7 +412,7 @@
}
static bool FindFirstNamedDeclWithKind(
- ASTContext *ast, const StringRef &name, DeclKind decl_kind,
+ ASTContext *ast, const DeclBaseName &name, DeclKind decl_kind,
VisitNodeResult &result,
DeclsLookupSource::PrivateDeclIdentifier priv_decl_id =
DeclsLookupSource::PrivateDeclIdentifier())
@@ -429,8 +429,7 @@
DeclsLookupSource lookup(
DeclsLookupSource::GetDeclsLookupSource(nominal_decl));
SmallVector<ValueDecl *, 4> decls;
- lookup.lookupMember(ast->getIdentifier(name),
- GetIdentifier(ast, priv_decl_id), decls);
+ lookup.lookupMember(name, GetIdentifier(ast, priv_decl_id), decls);
for (auto decl : decls) {
const DeclKind curr_decl_kind = decl->getKind();
@@ -478,14 +477,13 @@
}
} else if (result._module) {
ModuleDecl::AccessPathTy access_path;
- Identifier name_ident(ast->getIdentifier(name));
SmallVector<ValueDecl *, 4> decls;
if (priv_decl_id)
result._module.lookupMember(
- name_ident, ast->getIdentifier(priv_decl_id.getValue().c_str()),
+ name, ast->getIdentifier(priv_decl_id.getValue().c_str()),
decls);
else
- result._module.lookupQualified(name_ident, NLOptions(), nullptr, decls);
+ result._module.lookupQualified(name, NLOptions(), nullptr, decls);
if (!decls.empty()) {
bool check_type_aliases = false;
// Look for an exact match first
@@ -532,7 +530,7 @@
}
static size_t
-FindNamedDecls(ASTContext *ast, const StringRef &name, VisitNodeResult &result,
+FindNamedDecls(ASTContext *ast, const DeclBaseName &name, VisitNodeResult &result,
DeclsLookupSource::PrivateDeclIdentifier priv_decl_id =
DeclsLookupSource::PrivateDeclIdentifier()) {
if (!result._decls.empty()) {
@@ -545,11 +543,11 @@
DeclsLookupSource lookup(
DeclsLookupSource::GetDeclsLookupSource(nominal_decl));
SmallVector<ValueDecl *, 4> decls;
- lookup.lookupMember(ast->getIdentifier(name),
- GetIdentifier(ast, priv_decl_id), decls);
+ lookup.lookupMember(name, GetIdentifier(ast, priv_decl_id), decls);
if (decls.empty()) {
result._error = stringWithFormat(
- "no decl found in '%s' (DeclKind=%u)", name.str().c_str(),
+ "no decl found in '%s' (DeclKind=%u)",
+ name.userFacingName().str().c_str(),
nominal_decl->getName().get(), (uint32_t)nominal_decl->getKind());
} else {
for (ValueDecl *decl : decls) {
@@ -574,8 +572,7 @@
// being able to see all the local variables.
// FIXME: Need a more complete/robust lookup mechanism that can handle
// declarations in sub-stmts, etc.
- UnqualifiedLookup lookup(ast->getIdentifier(name), FD,
- ast->getLazyResolver(),
+ UnqualifiedLookup lookup(name, FD, ast->getLazyResolver(),
/*IsKnownPrivate=*/false, FD->getEndLoc());
if (!lookup.isSuccess()) {
result._error = "no decl found in function";
@@ -591,23 +588,24 @@
} else {
result._error = stringWithFormat(
"decl is not a nominal_decl (DeclKind=%u), lookup for '%s' failed",
- (uint32_t)parent_decl->getKind(), name.str().c_str());
+ (uint32_t)parent_decl->getKind(),
+ name.userFacingName().str().c_str());
}
}
} else if (result._module) {
ModuleDecl::AccessPathTy access_path;
SmallVector<ValueDecl *, 4> decls;
if (priv_decl_id)
- result._module.lookupMember(
- ast->getIdentifier(name),
+ result._module.lookupMember(name,
ast->getIdentifier(priv_decl_id.getValue().c_str()), decls);
else
- result._module.lookupValue(access_path, ast->getIdentifier(name),
- NLKind::QualifiedLookup, decls);
+ result._module.lookupValue(access_path, name, NLKind::QualifiedLookup,
+ decls);
if (decls.empty()) {
result._error =
stringWithFormat("no decl named '%s' found in module '%s'",
- name.str().c_str(), result._module.GetName().data());
+ name.userFacingName().str().c_str(),
+ result._module.GetName().data());
} else {
for (auto decl : decls) {
if (decl->hasInterfaceType()) {
@@ -786,7 +784,7 @@
result._module =
DeclsLookupSource::GetDeclsLookupSource(*ast, ConstString("Builtin"));
- if (!FindNamedDecls(ast, stripped_name_ref, result)) {
+ if (!FindNamedDecls(ast, ast->getIdentifier(stripped_name_ref), result)) {
result.Clear();
result._error = stringWithFormat("Couldn't find %s in the builtin module",
builtin_name.c_str());
@@ -822,7 +820,7 @@
if (kind_type_result.HasSingleType() && type_result.HasSingleType()) {
bool found = false;
- const size_t n = FindNamedDecls(ast, StringRef("init"), kind_type_result);
+ const size_t n = FindNamedDecls(ast, ast->Id_init, kind_type_result);
if (n == 1) {
found = true;
kind_type_result._types[0] = FixCallingConv(
@@ -895,7 +893,8 @@
}
if (kind_type_result.HasSingleType()) {
- const size_t n = FindNamedDecls(ast, StringRef("deinit"), kind_type_result);
+ const size_t n = FindNamedDecls(ast, DeclBaseName::createDestructor(),
+ kind_type_result);
if (n == 1) {
kind_type_result._types[0] = FixCallingConv(
kind_type_result._decls[0], kind_type_result._types[0].getPointer());
@@ -1152,7 +1151,8 @@
}
auto name = child->getChild(1); // First child is number.
- FindNamedDecls(ast, name->getText(), decl_scope_result);
+ FindNamedDecls(ast, ast->getIdentifier(name->getText()),
+ decl_scope_result);
if (decl_scope_result._decls.size() == 0) {
llvm::raw_string_ostream OS(result._error);
OS << "demangled identifier " << name->getText()
@@ -1174,7 +1174,8 @@
case Demangle::Node::Kind::InfixOperator:
case Demangle::Node::Kind::PrefixOperator:
case Demangle::Node::Kind::PostfixOperator:
- FindNamedDecls(ast, (*pos)->getText(), decl_scope_result);
+ FindNamedDecls(ast, ast->getIdentifier((*pos)->getText()),
+ decl_scope_result);
if (decl_scope_result._decls.size() == 0) {
result._error = stringWithFormat(
"demangled identifier %s could not be found by name lookup",
@@ -1352,9 +1353,18 @@
VisitNodeResult decl_ctx_result;
std::string identifier;
VisitNodeResult type_result;
+
+ assert(cur_node->getNumChildren() == 1 &&
+ "Accessor should have a single abstract storage child");
+ Demangle::NodePointer referenced_node = cur_node->getFirstChild();
+ assert((referenced_node->getKind() == Demangle::Node::Kind::Variable ||
+ referenced_node->getKind() == Demangle::Node::Kind::Subscript) &&
+ "Accessor child should be a storage node");
+
Demangle::Node::Kind node_kind = cur_node->getKind();
- for (Demangle::Node::iterator pos = cur_node->begin(), end = cur_node->end();
+ for (Demangle::Node::iterator pos = referenced_node->begin(),
+ end = referenced_node->end();
pos != end; ++pos) {
const Demangle::Node::Kind child_node_kind = (*pos)->getKind();
switch (child_node_kind) {
@@ -1377,13 +1387,11 @@
}
}
- if (identifier == "subscript") {
- // Subscript setters and getters are named with the reserved word
- // "subscript".
+ if (referenced_node->getKind() == Demangle::Node::Kind::Subscript) {
// Since there can be many subscripts for the same nominal type, we need to
// find the one matching the specified type.
- FindNamedDecls(ast, identifier, decl_ctx_result);
+ FindNamedDecls(ast, DeclBaseName::createSubscript(), decl_ctx_result);
size_t num_decls = decl_ctx_result._decls.size();
if (num_decls == 0) {
@@ -1409,7 +1417,7 @@
identifier_func = subscript_decl->getGetter();
break;
case Demangle::Node::Kind::Setter:
- identifier_func = subscript_decl->getGetter();
+ identifier_func = subscript_decl->getSetter();
break;
case Demangle::Node::Kind::DidSet:
identifier_func = subscript_decl->getDidSetFunc();
@@ -1463,7 +1471,8 @@
// one possible function.
AbstractStorageDecl *var_decl = nullptr;
- FindFirstNamedDeclWithKind(ast, identifier, DeclKind::Var, decl_ctx_result);
+ FindFirstNamedDeclWithKind(ast, ast->getIdentifier(identifier),
+ DeclKind::Var, decl_ctx_result);
if (decl_ctx_result._decls.size() == 1) {
var_decl = dyn_cast_or_null<VarDecl>(decl_ctx_result._decls[0]);
@@ -1521,8 +1530,8 @@
Demangle::NodePointer cur_node, VisitNodeResult &result) {
DeclKind decl_kind = GetKindAsDeclKind(parent_node->getKind());
- if (!FindFirstNamedDeclWithKind(ast, cur_node->getText(), decl_kind,
- result)) {
+ if (!FindFirstNamedDeclWithKind(ast, ast->getIdentifier(cur_node->getText()),
+ decl_kind, result)) {
if (result._error.empty())
result._error =
stringWithFormat("unable to find Node::Kind::Identifier '%s'",
@@ -1575,7 +1584,8 @@
return;
}
- if (!FindFirstNamedDeclWithKind(ast, id_node->getText(), decl_kind, result,
+ if (!FindFirstNamedDeclWithKind(ast, ast->getIdentifier(id_node->getText()),
+ decl_kind, result,
priv_decl_id_node->getText().str())) {
if (result._error.empty())
result._error = stringWithFormat(
diff --git a/lib/Parse/Parser.cpp b/lib/Parse/Parser.cpp
index 486371b..30a3381 100644
--- a/lib/Parse/Parser.cpp
+++ b/lib/Parse/Parser.cpp
@@ -308,10 +308,7 @@
llvm::DenseMap<const void*, tok> TokenKindChangeMap;
std::vector<Token>::iterator lower_bound(SourceLoc Loc) {
- return std::lower_bound(Bag.begin(), Bag.end(), Loc,
- [](const Token &T, SourceLoc L) {
- return T.getLoc().getOpaquePointerValue() < L.getOpaquePointerValue();
- });
+ return token_lower_bound(Bag, Loc);
}
std::vector<Token>::iterator lower_bound(Token Tok) {
@@ -400,7 +397,6 @@
llvm::SmallVector<Token, 4> TokensToConsume;
if (Tok.hasComment()) {
relexComment(Tok.getCommentRange(), TokensToConsume);
- Tok.clearCommentLength();
}
TokensToConsume.push_back(Tok);
diff --git a/lib/SIL/SILDeclRef.cpp b/lib/SIL/SILDeclRef.cpp
index 993be89..6fc3285 100644
--- a/lib/SIL/SILDeclRef.cpp
+++ b/lib/SIL/SILDeclRef.cpp
@@ -757,7 +757,7 @@
assert(!isCurried);
return mangler.mangleAccessorEntity(AccessorKind::IsMutableAddressor,
AddressorKind::Unsafe,
- getDecl(),
+ cast<AbstractStorageDecl>(getDecl()),
/*isStatic*/ false,
SKind);
diff --git a/lib/SIL/SILInstruction.cpp b/lib/SIL/SILInstruction.cpp
index ef0d9fc..72e37d2 100644
--- a/lib/SIL/SILInstruction.cpp
+++ b/lib/SIL/SILInstruction.cpp
@@ -168,6 +168,29 @@
}
}
+// Initialize the static members of SILInstruction.
+int SILInstruction::NumCreatedInstructions = 0;
+int SILInstruction::NumDeletedInstructions = 0;
+
+/// Map a SILInstruction name to its SILInstructionKind.
+SILInstructionKind swift::getSILInstructionKind(StringRef InstName) {
+ auto Kind = getSILValueKind(InstName);
+ if (Kind >= ValueKind::First_SILInstruction &&
+ Kind <= ValueKind::Last_SILInstruction)
+ return SILInstructionKind(Kind);
+
+#ifdef NDEBUG
+ llvm::errs() << "Unknown SIL instruction name\n";
+ abort();
+#endif
+ llvm_unreachable("Unknown SIL insruction name");
+}
+
+/// Map SILInstructionKind to a corresponding SILInstruction name.
+StringRef swift::getSILInstructionName(SILInstructionKind Kind) {
+ return getSILValueName(ValueKind(Kind));
+}
+
namespace {
class InstructionDestroyer
: public SILInstructionVisitor<InstructionDestroyer> {
diff --git a/lib/SIL/SILPrinter.cpp b/lib/SIL/SILPrinter.cpp
index 0da4db1..3ff1f37 100644
--- a/lib/SIL/SILPrinter.cpp
+++ b/lib/SIL/SILPrinter.cpp
@@ -826,14 +826,7 @@
}
void printInstOpCode(SILInstruction *I) {
- // If we have a SILInstruction, print out the opcode.
- switch (SILInstructionKind(I->getKind())) {
-#define INST(Id, Parent, TextualName, MemoryBehavior, ReleasingBehavior) \
- case SILInstructionKind::Id: \
- *this << #TextualName " "; \
- break;
-#include "swift/SIL/SILNodes.def"
- }
+ *this << getSILValueName(I->getKind()) << " ";
}
void print(SILValue V) {
diff --git a/lib/SIL/SILValue.cpp b/lib/SIL/SILValue.cpp
index d9cb62f..6ed5a0e 100644
--- a/lib/SIL/SILValue.cpp
+++ b/lib/SIL/SILValue.cpp
@@ -182,3 +182,40 @@
sil::ValueOwnershipKindClassifier Classifier;
return Classifier.visit(const_cast<ValueBase *>(Value));
}
+
+/// Map a SILValue mnemonic name to its ValueKind.
+ValueKind swift::getSILValueKind(StringRef Name) {
+#define INST(Id, Parent, TextualName, MemoryBehavior, ReleasingBehavior) \
+ if (Name == #TextualName) \
+ return ValueKind::Id;
+
+#define VALUE(Id, Parent) \
+ if (Name == #Id) \
+ return ValueKind::Id;
+
+#include "swift/SIL/SILNodes.def"
+
+#ifdef NDEBUG
+ llvm::errs()
+ << "Unknown SILValue name\n";
+ abort();
+#endif
+ llvm_unreachable("Unknown SILValue name");
+}
+
+/// Map ValueKind to a corresponding mnemonic name.
+StringRef swift::getSILValueName(ValueKind Kind) {
+ switch (Kind) {
+#define INST(Id, Parent, TextualName, MemoryBehavior, ReleasingBehavior) \
+ case ValueKind::Id: \
+ return #TextualName; \
+ break;
+
+#define VALUE(Id, Parent) \
+ case ValueKind::Id: \
+ return #Id; \
+ break;
+
+#include "swift/SIL/SILNodes.def"
+ }
+}
diff --git a/lib/SIL/SILVerifier.cpp b/lib/SIL/SILVerifier.cpp
index 9770a99..7fd2e1f 100644
--- a/lib/SIL/SILVerifier.cpp
+++ b/lib/SIL/SILVerifier.cpp
@@ -2367,8 +2367,8 @@
break;
case ValueKind::LoadInst:
// A 'non-taking' value load is harmless.
- return cast<LoadInst>(inst)->getOwnershipQualifier() !=
- LoadOwnershipQualifier::Copy;
+ return cast<LoadInst>(inst)->getOwnershipQualifier() ==
+ LoadOwnershipQualifier::Take;
break;
case ValueKind::DebugValueAddrInst:
// Harmless use.
@@ -2380,8 +2380,8 @@
}
return false;
};
- require(!isMutatingOrConsuming(OEI) ||
- allowedAccessKind == OpenedExistentialAccess::Mutable,
+ require(allowedAccessKind == OpenedExistentialAccess::Mutable
+ || !isMutatingOrConsuming(OEI),
"open_existential_addr uses that consumes or mutates but is not "
"opened for mutation");
}
diff --git a/lib/SILGen/RValue.cpp b/lib/SILGen/RValue.cpp
index ce29063..cf01dec 100644
--- a/lib/SILGen/RValue.cpp
+++ b/lib/SILGen/RValue.cpp
@@ -789,7 +789,7 @@
}
bool RValue::isPlusZero(SILGenFunction &SGF) const & {
- return llvm::none_of(values, [&SGF](ManagedValue mv) -> bool {
+ return llvm::none_of(values, [](ManagedValue mv) -> bool {
return mv.hasCleanup();
});
}
diff --git a/lib/SILGen/SILGen.cpp b/lib/SILGen/SILGen.cpp
index cbdb188..fd15d36 100644
--- a/lib/SILGen/SILGen.cpp
+++ b/lib/SILGen/SILGen.cpp
@@ -693,6 +693,7 @@
emitOrDelayFunction(*this, constant, [this,constant,fd](SILFunction *f){
preEmitFunction(constant, fd, f, fd);
+ PrettyStackTraceSILFunction X("silgen emitFunction", f);
if (fd->getAccessorKind() == AccessorKind::IsMaterializeForSet)
SILGenFunction(*this, *f).emitMaterializeForSet(fd);
else
diff --git a/lib/SILGen/SILGenApply.cpp b/lib/SILGen/SILGenApply.cpp
index 1f31904..3269a9e 100644
--- a/lib/SILGen/SILGenApply.cpp
+++ b/lib/SILGen/SILGenApply.cpp
@@ -1212,13 +1212,14 @@
ManagedValue superMV = std::move(super).getScalarValue();
// Check if super is not the same as our base type. This means that we
- // performed an upcast. Set SuperInitDelegationState to super.
+ // performed an upcast, and we must have consumed the special cleanup
+ // we installed. Install a new special cleanup.
if (superMV.getValue() != SGF.InitDelegationSelf.getValue()) {
- SILValue underlyingSelf = SGF.InitDelegationSelf.forward(SGF);
+ SILValue underlyingSelf = SGF.InitDelegationSelf.getValue();
SGF.InitDelegationSelf = ManagedValue::forUnmanaged(underlyingSelf);
CleanupHandle newWriteback = SGF.enterDelegateInitSelfWritebackCleanup(
SGF.InitDelegationLoc.getValue(), SGF.InitDelegationSelfBox,
- superMV.getValue());
+ superMV.forward(SGF));
SGF.SuperInitDelegationSelf =
ManagedValue(superMV.getValue(), newWriteback);
super = RValue(SGF, SGF.InitDelegationLoc.getValue(), superFormalType,
@@ -1275,10 +1276,7 @@
}
auto loweredResultTy = SGF.getLoweredLoadableType(resultTy);
if (loweredResultTy != selfValue.getType()) {
- auto upcast = SGF.B.createUpcast(ice,
- selfValue.getValue(),
- loweredResultTy);
- selfValue = ManagedValue(upcast, selfValue.getCleanup());
+ selfValue = SGF.B.createUpcast(ice, selfValue, loweredResultTy);
}
selfArg = ice->getSubExpr();
diff --git a/lib/SILGen/SILGenExpr.cpp b/lib/SILGen/SILGenExpr.cpp
index 84ddb4b..3be283f 100644
--- a/lib/SILGen/SILGenExpr.cpp
+++ b/lib/SILGen/SILGenExpr.cpp
@@ -1293,10 +1293,9 @@
.getScalarValue();
// Perform an upcast to convert self to the indicated super type.
- auto Result = SGF.B.createUpcast(E, Self.getValue(),
- SGF.getLoweredType(E->getType()));
+ auto result = SGF.B.createUpcast(E, Self, SGF.getLoweredType(E->getType()));
- return RValue(SGF, E, ManagedValue(Result, Self.getCleanup()));
+ return RValue(SGF, E, result);
}
RValue RValueEmitter::
@@ -1770,10 +1769,9 @@
ManagedValue archetype = SGF.emitRValueAsSingleValue(E->getSubExpr());
// Replace the cleanup with a new one on the superclass value so we always use
// concrete retain/release operations.
- SILValue base = SGF.B.createUpcast(E,
- archetype.forward(SGF),
- SGF.getLoweredLoadableType(E->getType()));
- return RValue(SGF, E, SGF.emitManagedRValueWithCleanup(base));
+ auto base = SGF.B.createUpcast(E, archetype,
+ SGF.getLoweredLoadableType(E->getType()));
+ return RValue(SGF, E, base);
}
static ManagedValue convertCFunctionSignature(SILGenFunction &SGF,
@@ -3044,9 +3042,9 @@
ParameterConvention::Indirect_In);
SILParameterInfo baseParam(loweredBaseTy.getSwiftRValueType(),
- property->isSetterNonMutating()
- ? ParameterConvention::Indirect_In
- : ParameterConvention::Indirect_Inout);
+ property->isSetterMutating()
+ ? ParameterConvention::Indirect_Inout
+ : ParameterConvention::Indirect_In);
auto signature = SILFunctionType::get(genericSig,
SILFunctionType::ExtInfo(SILFunctionType::Representation::Thin,
@@ -3099,7 +3097,7 @@
propertyType);
LValue lv;
- if (property->isSetterNonMutating()) {
+ if (!property->isSetterMutating()) {
auto baseSubst = emitKeyPathRValueBase(subSGF, property,
loc, baseArg,
baseType);
@@ -3363,10 +3361,8 @@
nullptr,
keyPathTy->getGenericArgs())
->getCanonicalType();
- auto upcast = SGF.B.createUpcast(SILLocation(E),
- keyPath.forward(SGF),
+ keyPath = SGF.B.createUpcast(SILLocation(E), keyPath,
SILType::getPrimitiveObjectType(castToTy));
- keyPath = SGF.emitManagedRValueWithCleanup(upcast);
}
}
}
diff --git a/lib/SILGen/SILGenPoly.cpp b/lib/SILGen/SILGenPoly.cpp
index 6ea40fe..829c219 100644
--- a/lib/SILGen/SILGenPoly.cpp
+++ b/lib/SILGen/SILGenPoly.cpp
@@ -607,39 +607,50 @@
///
/// If the tuple is in memory, the result elements will also be in
/// memory.
-typedef std::pair<ManagedValue, const TypeLowering *> ManagedValueAndType;
-static void explodeTuple(SILGenFunction &SGF,
- SILLocation loc,
+static void explodeTuple(SILGenFunction &SGF, SILLocation loc,
ManagedValue managedTuple,
- SmallVectorImpl<ManagedValueAndType> &out) {
- // None of the operations we do here can fail, so we can atomically
- // disable the tuple's cleanup and then create cleanups for all the
- // elements.
- SILValue tuple = managedTuple.forward(SGF);
+ SmallVectorImpl<ManagedValue> &out) {
- auto tupleSILType = tuple->getType();
+ assert(managedTuple.getOwnershipKind() == ValueOwnershipKind::Trivial
+ || managedTuple.hasCleanup());
+
+ // For non-address types, borrow the tuple before extracting and copying its
+ // elements. Creating a scope here ensures that the end_borrow is inserted
+ // correctly and prevents any other cleanup activity from taking meanwhile. We
+ // allow the incoming managedTuple to be destroyed later in its original
+ // scope.
+ //
+ // SEMANTIC SIL TODO: Once we support a SIL "destructure" instruction, we can
+ // remove this borrow scope and all element copies. Instead directly forward
+ // managedTuple into its destructure.
+ Scope destructureScope(SGF, loc);
+ ManagedValue tuple =
+ managedTuple.getType().isAddress()
+ ? ManagedValue::forUnmanaged(managedTuple.forward(SGF))
+ : managedTuple.borrow(SGF, loc);
+
+ auto tupleSILType = tuple.getType();
auto tupleType = tupleSILType.castTo<TupleType>();
- out.reserve(tupleType->getNumElements());
+ llvm::SmallVector<ManagedValue, 16> elements;
+ elements.reserve(tupleType->getNumElements());
for (auto index : indices(tupleType.getElementTypes())) {
// We're starting with a SIL-lowered tuple type, so the elements
// must also all be SIL-lowered.
SILType eltType = tupleSILType.getTupleElementType(index);
- auto &eltTL = SGF.getTypeLowering(eltType);
-
- ManagedValue elt;
if (tupleSILType.isAddress()) {
- auto addr = SGF.B.createTupleElementAddr(loc, tuple, index, eltType);
- elt = SGF.emitManagedBufferWithCleanup(addr, eltTL);
+ elements.push_back(
+ SGF.B.createTupleElementAddr(loc, tuple, index, eltType));
} else {
- auto value = SGF.B.createTupleExtract(loc, tuple, index, eltType);
- elt = SGF.emitManagedRValueWithCleanup(value, eltTL);
+ ManagedValue extract =
+ SGF.B.createTupleExtract(loc, tuple, index, eltType);
+ elements.push_back(extract.copy(SGF, loc));
}
-
- out.push_back(ManagedValueAndType(elt, &eltTL));
}
+ out.resize(elements.size());
+ destructureScope.popPreservingValues(elements, out);
}
/// Apply this transformation to all the elements of a tuple value,
@@ -673,7 +684,7 @@
ctxt);
// Explode the tuple into individual managed values.
- SmallVector<ManagedValueAndType, 4> inputElts;
+ SmallVector<ManagedValue, 4> inputElts;
explodeTuple(SGF, Loc, inputTuple, inputElts);
// Track all the managed elements whether or not we're actually
@@ -681,8 +692,8 @@
SmallVector<ManagedValue, 4> outputElts;
for (auto index : indices(inputType->getElementTypes())) {
- auto &inputEltTL = *inputElts[index].second;
- ManagedValue inputElt = inputElts[index].first;
+ auto &inputEltTL = SGF.getTypeLowering(inputElts[index].getType());
+ ManagedValue inputElt = inputElts[index];
if (inputElt.getType().isAddress() && !inputEltTL.isAddressOnly()) {
inputElt = emitManagedLoad(SGF, Loc, inputElt, inputEltTL);
}
@@ -1179,7 +1190,7 @@
assert(inputSubstType->getNumElements() ==
outputSubstType->getNumElements());
- SmallVector<ManagedValueAndType, 4> inputEltAddrs;
+ SmallVector<ManagedValue, 4> inputEltAddrs;
explodeTuple(SGF, Loc, inputTupleAddr, inputEltAddrs);
assert(inputEltAddrs.size() == outputSubstType->getNumElements());
@@ -1188,7 +1199,7 @@
auto inputEltSubstType = inputSubstType.getElementType(index);
auto outputEltOrigType = outputOrigType.getTupleElementType(index);
auto outputEltSubstType = outputSubstType.getElementType(index);
- auto inputEltAddr = inputEltAddrs[index].first;
+ auto inputEltAddr = inputEltAddrs[index];
assert(inputEltAddr.getType().isAddress() ||
!SGF.silConv.useLoweredAddresses());
diff --git a/lib/SILGen/SILGenStmt.cpp b/lib/SILGen/SILGenStmt.cpp
index f9a8533..6a3b987 100644
--- a/lib/SILGen/SILGenStmt.cpp
+++ b/lib/SILGen/SILGenStmt.cpp
@@ -748,7 +748,7 @@
SILValue addrOnlyBuf;
ManagedValue nextBufOrValue;
- if (optTL.isAddressOnly())
+ if (optTL.isAddressOnly() && SGF.silConv.useLoweredAddresses())
addrOnlyBuf = SGF.emitTemporaryAllocation(S, optTL.getLoweredType());
// Create a new basic block and jump into it.
@@ -763,7 +763,7 @@
//
// Advance the generator. Use a scope to ensure that any temporary stack
// allocations in the subexpression are immediately released.
- if (optTL.isAddressOnly()) {
+ if (optTL.isAddressOnly() && SGF.silConv.useLoweredAddresses()) {
Scope InnerForScope(SGF.Cleanups, CleanupLocation(S->getIteratorNext()));
auto nextInit = SGF.useBufferAsTemporary(addrOnlyBuf, optTL);
SGF.emitExprInto(S->getIteratorNext(), nextInit.get());
@@ -815,7 +815,7 @@
//
// *NOTE* If we do not have an address only value, then inputValue is
// *already properly unwrapped.
- if (optTL.isAddressOnly()) {
+ if (optTL.isAddressOnly() && SGF.silConv.useLoweredAddresses()) {
inputValue =
SGF.emitManagedBufferWithCleanup(nextBufOrValue.getValue());
inputValue = SGF.emitUncheckedGetOptionalValueFrom(
diff --git a/lib/SILGen/Scope.cpp b/lib/SILGen/Scope.cpp
index 8396816..420f13e 100644
--- a/lib/SILGen/Scope.cpp
+++ b/lib/SILGen/Scope.cpp
@@ -11,6 +11,7 @@
//===----------------------------------------------------------------------===//
#include "Scope.h"
+#include "swift/Basic/Range.h"
using namespace swift;
using namespace Lowering;
@@ -118,6 +119,31 @@
return RValue(SGF, std::move(managedValues), type, numEltsRemaining);
}
+void Scope::popPreservingValues(ArrayRef<ManagedValue> innerValues,
+ MutableArrayRef<ManagedValue> outerValues) {
+ auto &SGF = cleanups.SGF;
+ assert(innerValues.size() == outerValues.size());
+
+ // Record the cleanup information for each preserved value and deactivate its
+ // cleanup.
+ SmallVector<CleanupCloner, 4> cleanups;
+ cleanups.reserve(innerValues.size());
+ for (auto &mv : innerValues) {
+ cleanups.emplace_back(SGF, mv);
+ mv.forward(SGF);
+ }
+
+ // Pop any unpreserved cleanups.
+ pop();
+
+ // Create a managed value for each preserved value, cloning its cleanup.
+ // Since the CleanupCloner does not remember its SILValue, grab it from the
+ // original, now-deactivated managed value.
+ for (auto index : indices(innerValues)) {
+ outerValues[index] = cleanups[index].clone(innerValues[index].getValue());
+ }
+}
+
void Scope::popImpl() {
cleanups.stack.checkIterator(depth);
cleanups.stack.checkIterator(cleanups.innermostScope);
diff --git a/lib/SILGen/Scope.h b/lib/SILGen/Scope.h
index 89ce3c8..d836527 100644
--- a/lib/SILGen/Scope.h
+++ b/lib/SILGen/Scope.h
@@ -65,6 +65,12 @@
/// plus zero rvalue.
RValue popPreservingValue(RValue &&rv);
+ /// Pop the scope pushing the +1 ManagedValues in `innerValues` through the
+ /// scope. Asserts if any ManagedValue is plus zero. Each cleanup is recreated
+ /// in the outer scope and associated with a managed value in `outerValues`.
+ void popPreservingValues(ArrayRef<ManagedValue> innerValues,
+ MutableArrayRef<ManagedValue> outerValues);
+
private:
/// Internal private implementation of popImpl so we can use it in Scope::pop
/// and in Scope's destructor.
diff --git a/lib/SILOptimizer/Mandatory/AddressLowering.cpp b/lib/SILOptimizer/Mandatory/AddressLowering.cpp
index 2d25afd..1b19f09 100644
--- a/lib/SILOptimizer/Mandatory/AddressLowering.cpp
+++ b/lib/SILOptimizer/Mandatory/AddressLowering.cpp
@@ -411,6 +411,8 @@
void OpaqueStorageAllocation::convertIndirectFunctionArgs() {
// Insert temporary argument loads at the top of the function.
SILBuilder argBuilder(pass.F->getEntryBlock()->begin());
+ argBuilder.setSILConventions(
+ SILModuleConventions::getLoweredAddressConventions());
auto fnConv = pass.F->getConventions();
unsigned argIdx = fnConv.getSILArgIndexOfFirstParam();
@@ -572,6 +574,8 @@
}
SILBuilder allocBuilder(pass.F->begin()->begin());
+ allocBuilder.setSILConventions(
+ SILModuleConventions::getLoweredAddressConventions());
AllocStackInst *allocInstr =
allocBuilder.createAllocStack(getLocForValue(value), value->getType());
@@ -580,6 +584,8 @@
// Insert stack deallocations.
for (TermInst *termInst : pass.returnInsts) {
SILBuilder deallocBuilder(termInst);
+ deallocBuilder.setSILConventions(
+ SILModuleConventions::getLoweredAddressConventions());
deallocBuilder.createDeallocStack(allocInstr->getLoc(), allocInstr);
}
}
@@ -713,7 +719,10 @@
public:
ApplyRewriter(SILInstruction *origCall, AddressLoweringState &pass)
- : pass(pass), apply(origCall), argBuilder(origCall) {}
+ : pass(pass), apply(origCall), argBuilder(origCall) {
+ argBuilder.setSILConventions(
+ SILModuleConventions::getLoweredAddressConventions());
+ }
void rewriteParameters();
void rewriteIndirectParameter(Operand *operand);
@@ -755,6 +764,8 @@
switch (applyInst->getKind()) {
case ValueKind::ApplyInst: {
SILBuilder deallocBuilder(&*std::next(lastUse->getIterator()));
+ deallocBuilder.setSILConventions(
+ SILModuleConventions::getLoweredAddressConventions());
deallocBuilder.createDeallocStack(allocInst->getLoc(), allocInst);
break;
}
@@ -824,11 +835,14 @@
SILInstruction *result = directResultValues[resultIdx];
if (!result) {
SILBuilder resultBuilder(std::next(SILBasicBlock::iterator(applyInst)));
+ resultBuilder.setSILConventions(
+ SILModuleConventions::getLoweredAddressConventions());
result = resultBuilder.createTupleExtract(applyInst->getLoc(),
applyInst, resultIdx);
directResultValues[resultIdx] = result;
}
SILBuilder B(destroyInst);
+ B.setSILConventions(SILModuleConventions::getLoweredAddressConventions());
auto &TL = pass.F->getModule().getTypeLowering(result->getType());
TL.emitDestroyValue(B, destroyInst->getLoc(), result);
}
@@ -860,6 +874,8 @@
// TODO: Find the try_apply's result block.
// Build results outside-in to next stack allocations.
SILBuilder resultBuilder(std::next(SILBasicBlock::iterator(origCallInst)));
+ resultBuilder.setSILConventions(
+ SILModuleConventions::getLoweredAddressConventions());
// This is a formally indirect argument, but is loadable.
loadInst = resultBuilder.createLoad(loc, allocInst,
LoadOwnershipQualifier::Unqualified);
@@ -907,6 +923,8 @@
// Prepare to emit a new call instruction.
SILLocation loc = origCallInst->getLoc();
SILBuilder callBuilder(origCallInst);
+ callBuilder.setSILConventions(
+ SILModuleConventions::getLoweredAddressConventions());
// The new call instruction's SIL calling convention.
SILFunctionConventions loweredCalleeConv(
@@ -966,9 +984,7 @@
case ValueKind::ApplyInst:
newCallInst = callBuilder.createApply(
loc, apply.getCallee(), apply.getSubstitutions(), newCallArgs,
- cast<ApplyInst>(origCallInst)->isNonThrowing(),
- nullptr,
- SILModuleConventions::getLoweredAddressConventions());
+ cast<ApplyInst>(origCallInst)->isNonThrowing(), nullptr);
break;
case ValueKind::TryApplyInst:
// TODO: insert dealloc in the catch block.
@@ -984,6 +1000,9 @@
// TODO: handle bbargs from try_apply.
SILBuilder resultBuilder(
std::next(SILBasicBlock::iterator(origCallInst)));
+ resultBuilder.setSILConventions(
+ SILModuleConventions::getLoweredAddressConventions());
+
SmallVector<Operand*, 8> origUses(origCallInst->getUses());
for (Operand *operand : origUses) {
auto *extractInst = dyn_cast<TupleExtractInst>(operand->getUser());
@@ -1057,6 +1076,7 @@
break;
}
SILBuilder B(insertPt);
+ B.setSILConventions(SILModuleConventions::getLoweredAddressConventions());
// Gather direct function results.
unsigned numOrigDirectResults =
@@ -1152,7 +1172,9 @@
public:
explicit AddressOnlyUseRewriter(AddressLoweringState &pass)
- : pass(pass), B(*pass.F), addrMat(pass, B) {}
+ : pass(pass), B(*pass.F), addrMat(pass, B) {
+ B.setSILConventions(SILModuleConventions::getLoweredAddressConventions());
+ }
void visitOperand(Operand *operand) {
currOper = operand;
@@ -1288,7 +1310,9 @@
public:
explicit AddressOnlyDefRewriter(AddressLoweringState &pass)
- : pass(pass), B(*pass.F), addrMat(pass, B) {}
+ : pass(pass), B(*pass.F), addrMat(pass, B) {
+ B.setSILConventions(SILModuleConventions::getLoweredAddressConventions());
+ }
void visitInst(SILInstruction *inst) { visit(inst); }
diff --git a/lib/SILOptimizer/Mandatory/MandatoryInlining.cpp b/lib/SILOptimizer/Mandatory/MandatoryInlining.cpp
index f6c5a23..8eded4e 100644
--- a/lib/SILOptimizer/Mandatory/MandatoryInlining.cpp
+++ b/lib/SILOptimizer/Mandatory/MandatoryInlining.cpp
@@ -23,10 +23,11 @@
#include "llvm/ADT/ImmutableSet.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/Support/Debug.h"
+
using namespace swift;
-typedef llvm::DenseSet<SILFunction*> DenseFunctionSet;
-typedef llvm::ImmutableSet<SILFunction*> ImmutableFunctionSet;
+using DenseFunctionSet = llvm::DenseSet<SILFunction *>;
+using ImmutableFunctionSet = llvm::ImmutableSet<SILFunction *>;
STATISTIC(NumMandatoryInlines,
"Number of function application sites inlined by the mandatory "
@@ -103,6 +104,65 @@
B.emitCopyValueOperation(Loc, CaptureArg);
}
+static SILValue cleanupLoadedCalleeValue(SILValue CalleeValue, LoadInst *LI) {
+ auto *PBI = cast<ProjectBoxInst>(LI->getOperand());
+ auto *ABI = cast<AllocBoxInst>(PBI->getOperand());
+
+ // The load instruction must have no more uses left to erase it.
+ if (!LI->use_empty())
+ return SILValue();
+ LI->eraseFromParent();
+
+ // Look through uses of the alloc box the load is loading from to find up to
+ // one store and up to one strong release.
+ StrongReleaseInst *SRI = nullptr;
+ for (Operand *ABIUse : ABI->getUses()) {
+ if (SRI == nullptr && isa<StrongReleaseInst>(ABIUse->getUser())) {
+ SRI = cast<StrongReleaseInst>(ABIUse->getUser());
+ continue;
+ }
+
+ if (ABIUse->getUser() == PBI)
+ continue;
+
+ return SILValue();
+ }
+
+ StoreInst *SI = nullptr;
+ for (Operand *PBIUse : PBI->getUses()) {
+ if (SI == nullptr && isa<StoreInst>(PBIUse->getUser())) {
+ SI = cast<StoreInst>(PBIUse->getUser());
+ continue;
+ }
+
+ return SILValue();
+ }
+
+ // If we found a store, record its source and erase it.
+ if (SI) {
+ CalleeValue = SI->getSrc();
+ SI->eraseFromParent();
+ } else {
+ CalleeValue = SILValue();
+ }
+
+ // If we found a strong release, replace it with a strong release of the
+ // source of the store and erase it.
+ if (SRI) {
+ if (CalleeValue)
+ SILBuilderWithScope(SRI).emitStrongReleaseAndFold(SRI->getLoc(),
+ CalleeValue);
+ SRI->eraseFromParent();
+ }
+
+ assert(PBI->use_empty());
+ PBI->eraseFromParent();
+ assert(ABI->use_empty());
+ ABI->eraseFromParent();
+
+ return CalleeValue;
+}
+
/// \brief Removes instructions that create the callee value if they are no
/// longer necessary after inlining.
static void
@@ -117,64 +177,14 @@
}
recursivelyDeleteTriviallyDeadInstructions(InstsToDelete, true);
- // Handle the case where the callee of the apply is a load instruction.
+ // Handle the case where the callee of the apply is a load instruction. If we
+ // fail to optimize, return. Otherwise, see if we can look through other
+ // abstractions on our callee.
if (auto *LI = dyn_cast<LoadInst>(CalleeValue)) {
- auto *PBI = cast<ProjectBoxInst>(LI->getOperand());
- auto *ABI = cast<AllocBoxInst>(PBI->getOperand());
-
- // The load instruction must have no more uses left to erase it.
- if (!LI->use_empty())
- return;
- LI->eraseFromParent();
-
- // Look through uses of the alloc box the load is loading from to find up to
- // one store and up to one strong release.
- StrongReleaseInst *SRI = nullptr;
- for (Operand *ABIUse : ABI->getUses()) {
- if (SRI == nullptr && isa<StrongReleaseInst>(ABIUse->getUser())) {
- SRI = cast<StrongReleaseInst>(ABIUse->getUser());
- continue;
- }
-
- if (ABIUse->getUser() == PBI)
- continue;
-
+ CalleeValue = cleanupLoadedCalleeValue(CalleeValue, LI);
+ if (!CalleeValue) {
return;
}
-
- StoreInst *SI = nullptr;
- for (Operand *PBIUse : PBI->getUses()) {
- if (SI == nullptr && isa<StoreInst>(PBIUse->getUser())) {
- SI = cast<StoreInst>(PBIUse->getUser());
- continue;
- }
-
- return;
- }
-
- // If we found a store, record its source and erase it.
- if (SI) {
- CalleeValue = SI->getSrc();
- SI->eraseFromParent();
- } else {
- CalleeValue = SILValue();
- }
-
- // If we found a strong release, replace it with a strong release of the
- // source of the store and erase it.
- if (SRI) {
- if (CalleeValue)
- SILBuilderWithScope(SRI)
- .emitStrongReleaseAndFold(SRI->getLoc(), CalleeValue);
- SRI->eraseFromParent();
- }
-
- assert(PBI->use_empty());
- PBI->eraseFromParent();
- assert(ABI->use_empty());
- ABI->eraseFromParent();
- if (!CalleeValue)
- return;
}
if (auto *PAI = dyn_cast<PartialApplyInst>(CalleeValue)) {
@@ -206,12 +216,12 @@
///
/// In the case that a non-null value is returned, FullArgs contains effective
/// argument operands for the callee function.
-static SILFunction *
-getCalleeFunction(FullApplySite AI, bool &IsThick,
- SmallVectorImpl<SILValue>& CaptureArgs,
- SmallVectorImpl<SILValue>& FullArgs,
- PartialApplyInst *&PartialApply,
- SILModule::LinkingMode Mode) {
+static SILFunction *getCalleeFunction(SILFunction *F, FullApplySite AI,
+ bool &IsThick,
+ SmallVectorImpl<SILValue> &CaptureArgs,
+ SmallVectorImpl<SILValue> &FullArgs,
+ PartialApplyInst *&PartialApply,
+ SILModule::LinkingMode Mode) {
IsThick = false;
PartialApply = nullptr;
CaptureArgs.clear();
@@ -266,8 +276,7 @@
// We are allowed to see through exactly one "partial apply" instruction or
// one "thin to thick function" instructions, since those are the patterns
// generated when using auto closures.
- if (PartialApplyInst *PAI =
- dyn_cast<PartialApplyInst>(CalleeValue)) {
+ if (auto *PAI = dyn_cast<PartialApplyInst>(CalleeValue)) {
for (const auto &Arg : PAI->getArguments()) {
CaptureArgs.push_back(Arg);
FullArgs.push_back(Arg);
@@ -276,14 +285,12 @@
CalleeValue = PAI->getCallee();
IsThick = true;
PartialApply = PAI;
- } else if (ThinToThickFunctionInst *TTTFI =
- dyn_cast<ThinToThickFunctionInst>(CalleeValue)) {
+ } else if (auto *TTTFI = dyn_cast<ThinToThickFunctionInst>(CalleeValue)) {
CalleeValue = TTTFI->getOperand();
IsThick = true;
}
auto *FRI = dyn_cast<FunctionRefInst>(CalleeValue);
-
if (!FRI)
return nullptr;
@@ -308,9 +315,47 @@
if (CalleeFunction->empty()
&& !AI.getModule().linkFunction(CalleeFunction, Mode))
return nullptr;
+
+ // If the CalleeFunction is a not-transparent definition, we can not process
+ // it.
+ if (CalleeFunction->isTransparent() == IsNotTransparent)
+ return nullptr;
+
+ if (F->isSerialized() && !CalleeFunction->hasValidLinkageForFragileRef()) {
+ if (!CalleeFunction->hasValidLinkageForFragileInline()) {
+ llvm::errs() << "caller: " << F->getName() << "\n";
+ llvm::errs() << "callee: " << CalleeFunction->getName() << "\n";
+ llvm_unreachable("Should never be inlining a resilient function into "
+ "a fragile function");
+ }
+ return nullptr;
+ }
+
return CalleeFunction;
}
+static std::tuple<FullApplySite, SILBasicBlock::iterator>
+tryDevirtualizeApplyHelper(FullApplySite InnerAI, SILBasicBlock::iterator I,
+ ClassHierarchyAnalysis *CHA) {
+ auto NewInstPair = tryDevirtualizeApply(InnerAI, CHA);
+ auto *NewInst = NewInstPair.first;
+ if (!NewInst)
+ return std::make_tuple(InnerAI, I);
+
+ replaceDeadApply(InnerAI, NewInst);
+ if (auto *II = dyn_cast<SILInstruction>(NewInst))
+ I = II->getIterator();
+ else
+ I = NewInst->getParentBlock()->begin();
+ auto NewAI = FullApplySite::isa(NewInstPair.second.getInstruction());
+ // *NOTE*, it is important that we return I here since we may have
+ // devirtualized but not have a full apply site anymore.
+ if (!NewAI)
+ return std::make_tuple(FullApplySite(), I);
+
+ return std::make_tuple(NewAI, I);
+}
+
/// \brief Inlines all mandatory inlined functions into the body of a function,
/// first recursively inlining all mandatory apply instructions in those
/// functions into their bodies if necessary.
@@ -354,52 +399,32 @@
SmallVector<SILValue, 16> CaptureArgs;
SmallVector<SILValue, 32> FullArgs;
- for (auto FI = F->begin(), FE = F->end(); FI != FE; ++FI) {
- for (auto I = FI->begin(), E = FI->end(); I != E; ++I) {
- FullApplySite InnerAI = FullApplySite::isa(&*I);
+ for (auto BI = F->begin(), BE = F->end(); BI != BE; ++BI) {
+ for (auto II = BI->begin(), IE = BI->end(); II != IE; ++II) {
+ FullApplySite InnerAI = FullApplySite::isa(&*II);
if (!InnerAI)
continue;
auto *ApplyBlock = InnerAI.getParent();
- auto NewInstPair = tryDevirtualizeApply(InnerAI, CHA);
- if (auto *NewInst = NewInstPair.first) {
- replaceDeadApply(InnerAI, NewInst);
- if (auto *II = dyn_cast<SILInstruction>(NewInst))
- I = II->getIterator();
- else
- I = NewInst->getParentBlock()->begin();
- auto NewAI = FullApplySite::isa(NewInstPair.second.getInstruction());
- if (!NewAI)
- continue;
-
- InnerAI = NewAI;
- }
+ // *NOTE* If devirtualization succeeds, sometimes II will not be InnerAI,
+ // but a casted result of InnerAI or even a block argument due to
+ // abstraction changes when calling the witness or class method. We still
+ // know that InnerAI dominates II though.
+ std::tie(InnerAI, II) = tryDevirtualizeApplyHelper(InnerAI, II, CHA);
+ if (!InnerAI)
+ continue;
SILLocation Loc = InnerAI.getLoc();
SILValue CalleeValue = InnerAI.getCallee();
bool IsThick;
PartialApplyInst *PAI;
- SILFunction *CalleeFunction = getCalleeFunction(InnerAI, IsThick,
- CaptureArgs, FullArgs,
- PAI,
- Mode);
- if (!CalleeFunction ||
- CalleeFunction->isTransparent() == IsNotTransparent)
+ SILFunction *CalleeFunction = getCalleeFunction(
+ F, InnerAI, IsThick, CaptureArgs, FullArgs, PAI, Mode);
+ if (!CalleeFunction)
continue;
- if (F->isSerialized() &&
- !CalleeFunction->hasValidLinkageForFragileRef()) {
- if (!CalleeFunction->hasValidLinkageForFragileInline()) {
- llvm::errs() << "caller: " << F->getName() << "\n";
- llvm::errs() << "callee: " << CalleeFunction->getName() << "\n";
- llvm_unreachable("Should never be inlining a resilient function into "
- "a fragile function");
- }
- continue;
- }
-
// Then recursively process it first before trying to inline it.
if (!runOnFunctionRecursively(CalleeFunction, InnerAI, Mode,
FullyInlinedSet, SetFactory,
@@ -418,6 +443,38 @@
return false;
}
+ // Create our initial list of substitutions.
+ llvm::SmallVector<Substitution, 16> ApplySubs(InnerAI.subs_begin(),
+ InnerAI.subs_end());
+
+ // Then if we have a partial_apply, add any additional subsitutions that
+ // we may require to the end of the list.
+ if (PAI) {
+ copy(PAI->getSubstitutions(), std::back_inserter(ApplySubs));
+ }
+
+ SILOpenedArchetypesTracker OpenedArchetypesTracker(F);
+ F->getModule().registerDeleteNotificationHandler(
+ &OpenedArchetypesTracker);
+ // The callee only needs to know about opened archetypes used in
+ // the substitution list.
+ OpenedArchetypesTracker.registerUsedOpenedArchetypes(
+ InnerAI.getInstruction());
+ if (PAI) {
+ OpenedArchetypesTracker.registerUsedOpenedArchetypes(PAI);
+ }
+
+ SILInliner Inliner(*F, *CalleeFunction,
+ SILInliner::InlineKind::MandatoryInline, ApplySubs,
+ OpenedArchetypesTracker);
+ if (!Inliner.canInlineFunction(InnerAI)) {
+ // See comment above about casting when devirtualizing and how this
+ // sometimes causes II and InnerAI to be different and even in different
+ // blocks.
+ II = InnerAI.getInstruction()->getIterator();
+ continue;
+ }
+
// Inline function at I, which also changes I to refer to the first
// instruction inlined in the case that it succeeds. We purposely
// process the inlined body after inlining, because the inlining may
@@ -429,7 +486,7 @@
// If we intend to inline a thick function, then we need to balance the
// reference counts for correctness.
- if (IsThick && I != ApplyBlock->begin()) {
+ if (IsThick && II != ApplyBlock->begin()) {
// We need to find an appropriate location for our fix up code
// We used to do this after inlining Without any modifications
// This caused us to add a release in a wrong place:
@@ -443,67 +500,44 @@
// If that occurred we'd need to undo our fix up code.
// Instead, we split the current basic block -
// Making sure we have a basic block that starts with our apply.
- SILBuilderWithScope B(I);
- ApplyBlock = splitBasicBlockAndBranch(B, &*I, nullptr, nullptr);
- I = ApplyBlock->begin();
+ SILBuilderWithScope B(II);
+ ApplyBlock = splitBasicBlockAndBranch(B, &*II, nullptr, nullptr);
+ II = ApplyBlock->begin();
}
// Decrement our iterator (carefully, to avoid going off the front) so it
// is valid after inlining is done. Inlining deletes the apply, and can
// introduce multiple new basic blocks.
- if (I != ApplyBlock->begin())
- --I;
+ if (II != ApplyBlock->begin())
+ --II;
else
- I = ApplyBlock->end();
+ II = ApplyBlock->end();
- std::vector<Substitution> ApplySubs(InnerAI.getSubstitutions());
+ Inliner.inlineFunction(InnerAI, FullArgs);
- if (PAI) {
- auto PAISubs = PAI->getSubstitutions();
- ApplySubs.insert(ApplySubs.end(), PAISubs.begin(), PAISubs.end());
- }
-
- SILOpenedArchetypesTracker OpenedArchetypesTracker(F);
- F->getModule().registerDeleteNotificationHandler(
- &OpenedArchetypesTracker);
- // The callee only needs to know about opened archetypes used in
- // the substitution list.
- OpenedArchetypesTracker.registerUsedOpenedArchetypes(InnerAI.getInstruction());
- if (PAI) {
- OpenedArchetypesTracker.registerUsedOpenedArchetypes(PAI);
- }
-
- SILInliner Inliner(*F, *CalleeFunction,
- SILInliner::InlineKind::MandatoryInline,
- ApplySubs, OpenedArchetypesTracker);
- if (!Inliner.inlineFunction(InnerAI, FullArgs)) {
- I = InnerAI.getInstruction()->getIterator();
- continue;
- }
-
- // Inlining was successful. Remove the apply.
+ // We were able to inline successfully. Remove the apply.
InnerAI.getInstruction()->eraseFromParent();
// Reestablish our iterator if it wrapped.
- if (I == ApplyBlock->end())
- I = ApplyBlock->begin();
+ if (II == ApplyBlock->end())
+ II = ApplyBlock->begin();
// Update the iterator when instructions are removed.
- DeleteInstructionsHandler DeletionHandler(I);
+ DeleteInstructionsHandler DeletionHandler(II);
// If the inlined apply was a thick function, then we need to balance the
// reference counts for correctness.
if (IsThick)
- fixupReferenceCounts(I, Loc, CalleeValue, CaptureArgs);
+ fixupReferenceCounts(II, Loc, CalleeValue, CaptureArgs);
// Now that the IR is correct, see if we can remove dead callee
// computations (e.g. dead partial_apply closures).
cleanupCalleeValue(CalleeValue, CaptureArgs, FullArgs);
// Reposition iterators possibly invalidated by mutation.
- FI = SILFunction::iterator(ApplyBlock);
- E = ApplyBlock->end();
- assert(FI == SILFunction::iterator(I->getParent()) &&
+ BI = SILFunction::iterator(ApplyBlock);
+ IE = ApplyBlock->end();
+ assert(BI == SILFunction::iterator(II->getParent()) &&
"Mismatch between the instruction and basic block");
++NumMandatoryInlines;
}
diff --git a/lib/SILOptimizer/PassManager/PassManager.cpp b/lib/SILOptimizer/PassManager/PassManager.cpp
index a0140a4..5aa0f81 100644
--- a/lib/SILOptimizer/PassManager/PassManager.cpp
+++ b/lib/SILOptimizer/PassManager/PassManager.cpp
@@ -20,6 +20,7 @@
#include "swift/SILOptimizer/Analysis/FunctionOrder.h"
#include "swift/SILOptimizer/PassManager/PrettyStackTrace.h"
#include "swift/SILOptimizer/PassManager/Transforms.h"
+#include "swift/SILOptimizer/Utils/OptimizerStatsUtils.h"
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/ADT/StringSwitch.h"
@@ -316,6 +317,8 @@
return;
}
+ updateSILModuleStatsBeforeTransform(F->getModule(), SFT, *this, NumPassesRun);
+
CurrentPassHasInvalidated = false;
if (SILPrintPassName)
@@ -338,8 +341,8 @@
assert(analysesUnlocked() && "Expected all analyses to be unlocked!");
Mod->removeDeleteNotificationHandler(SFT);
+ auto Delta = (std::chrono::system_clock::now() - StartTime).count();
if (SILPrintPassTime) {
- auto Delta = (std::chrono::system_clock::now() - StartTime).count();
llvm::dbgs() << Delta << " (" << SFT->getName() << "," << F->getName()
<< ")\n";
}
@@ -352,6 +355,9 @@
F->dump(getOptions().EmitVerboseSIL);
}
+ updateSILModuleStatsAfterTransform(F->getModule(), SFT, *this, NumPassesRun,
+ Delta);
+
// Remember if this pass didn't change anything.
if (!CurrentPassHasInvalidated)
completedPasses.set((size_t)SFT->getPassKind());
@@ -440,6 +446,8 @@
SMT->injectPassManager(this);
SMT->injectModule(Mod);
+ updateSILModuleStatsBeforeTransform(*Mod, SMT, *this, NumPassesRun);
+
CurrentPassHasInvalidated = false;
if (SILPrintPassName)
@@ -460,8 +468,8 @@
Mod->removeDeleteNotificationHandler(SMT);
assert(analysesUnlocked() && "Expected all analyses to be unlocked!");
+ auto Delta = (std::chrono::system_clock::now() - StartTime).count();
if (SILPrintPassTime) {
- auto Delta = (std::chrono::system_clock::now() - StartTime).count();
llvm::dbgs() << Delta << " (" << SMT->getName() << ",Module)\n";
}
@@ -474,6 +482,8 @@
printModule(Mod, Options.EmitVerboseSIL);
}
+ updateSILModuleStatsAfterTransform(*Mod, SMT, *this, NumPassesRun, Delta);
+
if (Options.VerifyAll &&
(CurrentPassHasInvalidated || !SILVerifyWithoutInvalidation)) {
Mod->verify();
@@ -608,6 +618,10 @@
StageName = NextStage;
}
+StringRef SILPassManager::getStageName() const {
+ return StageName;
+}
+
const SILOptions &SILPassManager::getOptions() const {
return Mod->getOptions();
}
diff --git a/lib/SILOptimizer/Transforms/PerformanceInliner.cpp b/lib/SILOptimizer/Transforms/PerformanceInliner.cpp
index 86f1df2..2fd9c1e 100644
--- a/lib/SILOptimizer/Transforms/PerformanceInliner.cpp
+++ b/lib/SILOptimizer/Transforms/PerformanceInliner.cpp
@@ -658,12 +658,12 @@
AI.getSubstitutions(),
OpenedArchetypesTracker);
- auto Success = Inliner.inlineFunction(AI, Args);
- (void) Success;
// We've already determined we should be able to inline this, so
- // we expect it to have happened.
- assert(Success && "Expected inliner to inline this function!");
-
+ // unconditionally inline the function.
+ //
+ // If for whatever reason we can not inline this function, inlineFunction
+ // will assert, so we are safe making this assumption.
+ Inliner.inlineFunction(AI, Args);
recursivelyDeleteTriviallyDeadInstructions(AI.getInstruction(), true);
NumFunctionsInlined++;
diff --git a/lib/SILOptimizer/Utils/CMakeLists.txt b/lib/SILOptimizer/Utils/CMakeLists.txt
index c5cb4a0..50eb324 100644
--- a/lib/SILOptimizer/Utils/CMakeLists.txt
+++ b/lib/SILOptimizer/Utils/CMakeLists.txt
@@ -9,6 +9,7 @@
Utils/LoadStoreOptUtils.cpp
Utils/Local.cpp
Utils/LoopUtils.cpp
+ Utils/OptimizerStatsUtils.cpp
Utils/PerformanceInlinerUtils.cpp
Utils/SILInliner.cpp
Utils/SILSSAUpdater.cpp
diff --git a/lib/SILOptimizer/Utils/OptimizerStatsUtils.cpp b/lib/SILOptimizer/Utils/OptimizerStatsUtils.cpp
new file mode 100644
index 0000000..6030a07
--- /dev/null
+++ b/lib/SILOptimizer/Utils/OptimizerStatsUtils.cpp
@@ -0,0 +1,967 @@
+//===-- OptimizerStatsUtils.cpp - Utils for collecting stats -*- C++ ---*-===//
+//
+// This source file is part of the Swift.org open source project
+//
+// Copyright (c) 2014 - 2017 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
+//
+//===----------------------------------------------------------------------===//
+///
+/// \file
+///
+/// This file implements collection and dumping of statistics about SILModules,
+/// SILFunctions and memory consumption during the execution of SIL
+/// optimization pipelines.
+///
+/// The following statistics are collected:
+/// - For SILFunctions: the number of SIL basic blocks, the number of SIL
+/// instructions
+///
+/// - For SILModules: the number of SIL basic blocks, the number of SIL
+/// instructions, the number of SILFunctions, the amount of memory used by the
+/// compiler.
+///
+/// By default, any collection of statistics is disabled to avoid affecting
+/// compile times.
+///
+/// One can enable the collection of statistics and dumping of these statistics
+/// for the whole SILModule and/or for SILFunctions.
+///
+/// To reduce the amount of produced data, one can set thresholds in such a way
+/// that changes in the statistics are only reported if the delta between the
+/// old and the new values are at least X%. The deltas are computed using the
+/// following formula:
+/// Delta = (NewValue - OldValue) / OldValue
+///
+/// Thresholds provide a simple way to perform a simple filtering of the
+/// collected statistics during the compilation. But if there is a need for a
+/// more complex analysis of collected data (e.g. aggregation by a pipeline
+/// stage or by the type of a transformation), it is often better to dump
+/// as much data as possible into a file using e.g. `-sil-stats-dump-all
+/// -sil-stats-modules -sil-stats-functions` and then e.g. use the helper scripts
+/// to store the collected data into a database and then perform complex queries
+/// on it. Many kinds of analysis can be then formulated pretty easily as SQL
+/// queries.
+///
+/// The output format is a set of CSV (comma separated values) lines. Each lines
+/// represents one counter or one counter change.
+///
+/// For counter updates it looks like this:
+/// Kind, CounterName, StageName, TransformName, TransformPassNumber,
+/// DeltaValue, OldCounterValue, NewCounterValue, Duration, Symbol
+///
+/// For counter updates it looks like this:
+/// Kind, CounterName, StageName, TransformName, TransformPassNumber,
+/// CounterValue, Duration, Symbol
+///
+/// where Kind is one of "function", "module", "function_history",
+/// CounterName is one of "block", "inst", "function", "memory",
+/// Symbol is e.g. the name of a function.
+/// StageName and TransformName are the names of the current optimizer
+/// pipeline stage and current transform.
+/// Duration is the duration of the transformation.
+//===----------------------------------------------------------------------===//
+
+#include "llvm/Support/CommandLine.h"
+#include "llvm/Support/FileSystem.h"
+#include "llvm/Support/Process.h"
+#include "swift/SIL/SILValue.h"
+#include "swift/SIL/SILVisitor.h"
+#include "swift/SILOptimizer/Analysis/Analysis.h"
+#include "swift/SILOptimizer/PassManager/PassManager.h"
+#include "swift/SILOptimizer/PassManager/Transforms.h"
+#include "swift/SILOptimizer/Utils/OptimizerStatsUtils.h"
+using namespace swift;
+
+namespace {
+
+/// The total number of different kinds of SILInstructions.
+constexpr unsigned SILInstructionsNum = int(ValueKind::Last_SILInstruction) + 1;
+
+/// A set of counters, one per SILInstruction kind.
+using InstructionCounts = SmallVector<int, SILInstructionsNum>;
+
+/// A helper type to parse a comma separated list of SIL instruction names
+/// provided as argument of the -sil-stats-only-instructions options.
+class StatsOnlyInstructionsOpt {
+ /// If ComputeInstCounts[i] is non-zero, this kind of SILInstruction should be
+ /// tracked.
+ InstructionCounts ComputeInstCounts;
+ /// The number of different kinds of SILInstructions to be tracked.
+ int InstCountsNum = 0;
+
+public:
+ StatsOnlyInstructionsOpt() : ComputeInstCounts(SILInstructionsNum) {}
+
+ void operator=(const std::string &Val) {
+ if (Val.empty())
+ return;
+ if (Val == "all") {
+ for (auto &Inst : ComputeInstCounts) {
+ Inst = 1;
+ }
+ InstCountsNum = ComputeInstCounts.size();
+ return;
+ }
+ SmallVector<StringRef, 8> statsInstNames;
+ StringRef(Val).split(statsInstNames, ',', -1, false);
+ for (auto instName : statsInstNames) {
+ // Check if it is a known instruction.
+ auto Kind = getSILInstructionKind(instName);
+ if (!ComputeInstCounts[int(Kind)] ){
+ ComputeInstCounts[int(Kind)] = 1;
+ InstCountsNum++;
+ }
+ }
+ }
+
+ bool shouldComputeInstCount(SILInstructionKind Kind) const {
+ return ComputeInstCounts[int(Kind)] != 0;
+ }
+
+ int getInstCountsNum() const {
+ return InstCountsNum;
+ }
+};
+
+StatsOnlyInstructionsOpt StatsOnlyInstructionsOptLoc;
+
+/// Use this option like -Xllvm -sil-stats-only-instructions=strong_retain,alloc_stack
+/// If you need to track all kinds of SILInstructions, you can use
+/// -sil-stats-only-instructions=all
+llvm::cl::opt<StatsOnlyInstructionsOpt, true, llvm::cl::parser<std::string>>
+ StatsOnlyInstructions(
+ "sil-stats-only-instructions",
+ llvm::cl::desc(
+ "Comma separated list of SIL insruction names, whose stats "
+ "should be collected"),
+ llvm::cl::Hidden, llvm::cl::ZeroOrMore,
+ llvm::cl::value_desc("instruction name"),
+ llvm::cl::location(StatsOnlyInstructionsOptLoc),
+ llvm::cl::ValueRequired);
+
+/// Dump as much statistics as possible, ignore any thresholds.
+llvm::cl::opt<bool> SILStatsDumpAll(
+ "sil-stats-dump-all", llvm::cl::init(false),
+ llvm::cl::desc("Dump all SIL module and SIL function stats"));
+
+/// Dump statistics about the SILModule.
+llvm::cl::opt<bool> SILStatsModules(
+ "sil-stats-modules", llvm::cl::init(false),
+ llvm::cl::desc("Enable computation of statistics for SIL modules"));
+
+/// Dump statistics about SILFunctions.
+llvm::cl::opt<bool> SILStatsFunctions(
+ "sil-stats-functions", llvm::cl::init(false),
+ llvm::cl::desc("Enable computation of statistics for SIL functions"));
+
+/// The name of the output file for optimizer counters.
+llvm::cl::opt<std::string> SILStatsOutputFile(
+ "sil-stats-output-file", llvm::cl::init(""),
+ llvm::cl::desc("The name of the output file for optimizer counters"));
+
+/// A threshold in percents for the SIL basic block counters.
+llvm::cl::opt<double> BlockCountDeltaThreshold(
+ "sil-stats-block-count-delta-threshold", llvm::cl::init(1),
+ llvm::cl::desc(
+ "Threshold for reporting changed basic block count numbers"));
+
+/// A threshold in percents for the SIL instructions counters.
+llvm::cl::opt<double> InstCountDeltaThreshold(
+ "sil-stats-inst-count-delta-threshold", llvm::cl::init(1),
+ llvm::cl::desc(
+ "Threshold for reporting changed instruction count numbers"));
+
+/// A threshold in percents for the SIL functions counters.
+llvm::cl::opt<double> FunctionCountDeltaThreshold(
+ "sil-stats-function-count-delta-threshold", llvm::cl::init(1),
+ llvm::cl::desc("Threshold for reporting changed function count numbers"));
+
+/// A threshold in percents for the counters of memory used by the compiler.
+llvm::cl::opt<double> UsedMemoryDeltaThreshold(
+ "sil-stats-used-memory-delta-threshold", llvm::cl::init(5),
+ llvm::cl::desc("Threshold for reporting changed memory usage numbers"));
+
+llvm::cl::opt<double> UsedMemoryMinDeltaThreshold(
+ "sil-stats-used-memory-min-threshold", llvm::cl::init(1),
+ llvm::cl::desc("Min hreshold for reporting changed memory usage numbers"));
+
+/// A threshold in percents for the basic blocks counter inside a SILFunction.
+/// Has effect only if it is used together with -sil-stats-functions.
+llvm::cl::opt<double> FuncBlockCountDeltaThreshold(
+ "sil-stats-func-block-count-delta-threshold", llvm::cl::init(200),
+ llvm::cl::desc("Threshold for reporting changed basic block count numbers "
+ "for a function"));
+
+/// A minimal threshold (in number of basic blocks) for the basic blocks counter
+/// inside a SILFunction. Only functions with more basic blocks than this
+/// threshold are reported. Has effect only if it is used together with
+/// -sil-stats-functions.
+llvm::cl::opt<int> FuncBlockCountMinThreshold(
+ "sil-stats-func-block-count-min-threshold", llvm::cl::init(50),
+ llvm::cl::desc(
+ "Min threshold for reporting changed basic block count numbers "
+ "for a function"));
+
+/// A threshold in percents for the SIL instructions counter inside a
+/// SILFunction. Has effect only if it is used together with
+/// -sil-stats-functions.
+llvm::cl::opt<double> FuncInstCountDeltaThreshold(
+ "sil-stats-func-inst-count-delta-threshold", llvm::cl::init(200),
+ llvm::cl::desc("Threshold for reporting changed instruction count numbers "
+ "for a function"));
+
+/// A minimal threshold (in number of instructions) for the SIL instructions
+/// counter inside a SILFunction. Only functions with more instructions than
+/// this threshold are reported. Has effect only if it is used together with
+/// -sil-stats-functions.
+llvm::cl::opt<int> FuncInstCountMinThreshold(
+ "sil-stats-func-inst-count-min-threshold", llvm::cl::init(300),
+ llvm::cl::desc(
+ "Min threshold for reporting changed instruction count numbers "
+ "for a function"));
+
+/// Track only statistics for a function with a given name.
+/// Has effect only if it is used together with -sil-stats-functions.
+llvm::cl::opt<std::string> StatsOnlyFunctionName(
+ "sil-stats-only-function", llvm::cl::init(""),
+ llvm::cl::desc("Function name, whose stats should be tracked"));
+
+/// Track only statistics for a function whose name contains a given substring.
+/// Has effect only if it is used together with -sil-stats-functions.
+llvm::cl::opt<std::string> StatsOnlyFunctionsNamePattern(
+ "sil-stats-only-functions", llvm::cl::init(""),
+ llvm::cl::desc(
+ "Pattern of a function name, whose stats should be tracked"));
+
+/// Stats for a SIL function.
+struct FunctionStat {
+ int BlockCount = 0;
+ int InstCount = 0;
+ /// Instruction counts per SILInstruction kind.
+ InstructionCounts InstCounts;
+
+ FunctionStat(SILFunction *F);
+ FunctionStat() : InstCounts(SILInstructionsNum) {}
+
+ void print(llvm::raw_ostream &stream) const {
+ stream << "FunctionStat("
+ << "blocks = " << BlockCount << ", Inst = " << InstCount << ")\n";
+ }
+
+ bool operator==(const FunctionStat &rhs) const {
+ return BlockCount == rhs.BlockCount && InstCount == rhs.InstCount;
+ }
+
+ bool operator!=(const FunctionStat &rhs) const { return !(*this == rhs); }
+
+ void dump() { print(llvm::errs()); }
+};
+
+/// Stats a single SIL module.
+struct ModuleStat {
+ /// Total number of SILFunctions in the current SILModule.
+ int FunctionCount = 0;
+ /// Total number of SILBasicBlocks in the current SILModule.
+ int BlockCount = 0;
+ /// Total number of SILInstructions in the current SILModule.
+ int InstCount = 0;
+ /// Total amount of memory used by the compiler.
+ int UsedMemory = 0;
+ /// Total number of SILInstructions created since the beginning of the current
+ /// compilation.
+ int CreatedInstCount = 0;
+ /// Total number of SILInstructions deleted since the beginning of the current
+ /// compilation.
+ int DeletedInstCount = 0;
+ /// Instruction counts per SILInstruction kind.
+ InstructionCounts InstCounts;
+
+ ModuleStat() : InstCounts(SILInstructionsNum) {}
+
+ /// Add the stats for a given function to the total module stats.
+ void addFunctionStat(FunctionStat &Stat) {
+ BlockCount += Stat.BlockCount;
+ InstCount += Stat.InstCount;
+ ++FunctionCount;
+ if (!StatsOnlyInstructionsOptLoc.getInstCountsNum())
+ return;
+ for (unsigned i : indices(InstCounts)) {
+ InstCounts[i] += Stat.InstCounts[i];
+ }
+ }
+
+ /// Subtract the stats for a given function from total module stats.
+ void subFunctionStat(FunctionStat &Stat) {
+ BlockCount -= Stat.BlockCount;
+ InstCount -= Stat.InstCount;
+ --FunctionCount;
+ if (!StatsOnlyInstructionsOptLoc.getInstCountsNum())
+ return;
+ for (unsigned i : indices(InstCounts)) {
+ InstCounts[i] -= Stat.InstCounts[i];
+ }
+ }
+
+ /// Add the stats about current memory usage.
+ void addMemoryStat() {
+ UsedMemory = llvm::sys::Process::GetMallocUsage();
+ }
+
+ /// Add the stats about created and deleted instructions.
+ void addCreatedAndDeletedInstructionsStat() {
+ CreatedInstCount = SILInstruction::getNumCreatedInstructions();
+ DeletedInstCount = SILInstruction::getNumDeletedInstructions();
+ }
+
+ void print(llvm::raw_ostream &stream) const {
+ stream << "ModuleStat(functions = " << FunctionCount
+ << ", blocks = " << BlockCount << ", Inst = " << InstCount
+ << ", UsedMemory = " << UsedMemory / (1024 * 1024)
+ << ", CreatedInst = " << CreatedInstCount
+ << ", DeletedInst = " << DeletedInstCount
+ << ")\n";
+ }
+
+ void dump() { print(llvm::errs()); }
+
+ bool operator==(const ModuleStat &rhs) const {
+ return FunctionCount == rhs.FunctionCount && BlockCount == rhs.BlockCount &&
+ InstCount == rhs.InstCount && UsedMemory == rhs.UsedMemory;
+ }
+
+ bool operator!=(const ModuleStat &rhs) const { return !(*this == rhs); }
+};
+
+// A helper type to collect the stats about the number of instructions and basic
+// blocks.
+struct InstCountVisitor : SILVisitor<InstCountVisitor> {
+ int BlockCount = 0;
+ int InstCount = 0;
+ InstructionCounts &InstCounts;
+
+ InstCountVisitor(InstructionCounts &InstCounts) : InstCounts(InstCounts) {}
+
+ int getBlockCount() const {
+ return BlockCount;
+ }
+
+ int getInstCount() const {
+ return InstCount;
+ }
+
+ void visitSILBasicBlock(SILBasicBlock *BB) {
+ ++BlockCount;
+ SILVisitor<InstCountVisitor>::visitSILBasicBlock(BB);
+ }
+
+ void visitSILFunction(SILFunction *F) {
+ SILVisitor<InstCountVisitor>::visitSILFunction(F);
+ }
+
+ void visitValueBase(ValueBase *V) {}
+
+#define INST(Id, Parent, TextualName, MemBehavior, ReleasingBehavior) \
+ void visit##Id(Id *I) { \
+ ++InstCount; \
+ ++InstCounts[int(I->getKind())]; \
+ }
+#include "swift/SIL/SILNodes.def"
+};
+
+/// A helper type to store different parameters related to the current transform.
+class TransformationContext {
+ /// SILModule being processed.
+ SILModule &M;
+ /// The pass manager being used.
+ SILPassManager &PM;
+ /// The transformation that was/will be performed.
+ SILTransform *Transform;
+ /// The time it took to perform the transformation.
+ int Duration;
+ /// The pass number in the optimizer pipeline.
+ int PassNumber;
+
+public:
+ TransformationContext(SILModule &M, SILPassManager &PM,
+ SILTransform *Transform, int PassNumber, int Duration)
+ : M(M), PM(PM), Transform(Transform), Duration(Duration),
+ PassNumber(PassNumber) {}
+
+ int getPassNumber() const {
+ return PassNumber;
+ }
+
+ int getDuration() const {
+ return Duration;
+ }
+
+ StringRef getTransformId() const {
+ return Transform->getID();
+ }
+
+ StringRef getStageName() const {
+ return PM.getStageName();
+ }
+
+ SILModule &getModule() {
+ return M;
+ }
+
+ SILPassManager &getPassManager() {
+ return PM;
+ }
+};
+
+/// Aggregated statistics for the whole SILModule and all SILFunctions belonging
+/// to it.
+class AccumulatedOptimizerStats {
+ using FunctionStats = llvm::DenseMap<const SILFunction *, FunctionStat>;
+
+ /// Current stats for each function.
+ FunctionStats FuncStats;
+ /// Current stats for the module.
+ ModuleStat ModStat;
+
+public:
+ FunctionStat &getFunctionStat(const SILFunction *F) {
+ return FuncStats[F];
+ }
+
+ ModuleStat &getModuleStat() {
+ return ModStat;
+ }
+
+ void deleteFunctionStat(SILFunction *F) {
+ FuncStats.erase(F);
+ }
+};
+
+/// A helper class to repesent the module stats as an analysis,
+/// so that it is preserved across multiple passes.
+class OptimizerStatsAnalysis : public SILAnalysis {
+ SILModule &M;
+ /// The actual cache holding all the statistics.
+ std::unique_ptr<AccumulatedOptimizerStats> Cache;
+
+ /// Sets of functions changed, deleted or added since the last
+ /// computation of statistics. These sets are used to avoid complete
+ /// re-computation of the stats for the whole module. Instead only
+ /// re-compute the stats for the changed functions, which is much
+ /// faster.
+ SmallVector<SILFunction *, 16> InvalidatedFuncs;
+ SmallVector<SILFunction *, 16> DeletedFuncs;
+ SmallVector<SILFunction *, 16> AddedFuncs;
+
+public:
+ OptimizerStatsAnalysis(SILModule *M)
+ : SILAnalysis(AnalysisKind::OptimizerStats), M(*M), Cache(nullptr) {}
+
+ static bool classof(const SILAnalysis *S) {
+ return S->getKind() == AnalysisKind::OptimizerStats;
+ }
+
+ /// Invalidate all information in this analysis.
+ virtual void invalidate() override {
+ // This analysis is never invalidated, because it just used
+ // to store the statistics.
+ }
+
+ /// Invalidate all of the information for a specific function.
+ virtual void invalidate(SILFunction *F, InvalidationKind K) override {
+ InvalidatedFuncs.push_back(F);
+ }
+
+ /// Notify the analysis about a newly created function.
+ virtual void notifyAddFunction(SILFunction *F) override {
+ AddedFuncs.push_back(F);
+ }
+
+ /// Notify the analysis about a function which will be deleted from the
+ /// module.
+ virtual void notifyDeleteFunction(SILFunction *F) override {
+ DeletedFuncs.push_back(F);
+ };
+
+ /// Notify the analysis about changed witness or vtables.
+ virtual void invalidateFunctionTables() override {
+ }
+
+
+ SILModule &getModule() const {
+ return M;
+ }
+
+ /// Get the collected statistics for a function.
+ FunctionStat &getFunctionStat(const SILFunction *F) {
+ if (!Cache)
+ Cache = llvm::make_unique<AccumulatedOptimizerStats>();
+
+ return Cache->getFunctionStat(F);
+ }
+
+ /// Get the collected statistics for a module.
+ ModuleStat &getModuleStat() {
+ if (!Cache)
+ Cache = llvm::make_unique<AccumulatedOptimizerStats>();
+
+ return Cache->getModuleStat();
+ }
+
+ /// Update module stats after running the Transform.
+ void updateModuleStats(TransformationContext &Ctx);
+};
+
+class NewLineInserter {
+ bool isNewline = true;
+
+public:
+ NewLineInserter() {}
+ StringRef get() {
+ StringRef result = isNewline ? "\n" : "";
+ isNewline = false;
+ return result;
+ }
+};
+
+/// The output stream to be used for writing the collected statistics.
+/// Use the unique_ptr to ensure that the file is properly closed upon
+/// exit.
+std::unique_ptr<llvm::raw_ostream, std::function<void(llvm::raw_ostream *)>>
+ stats_output_stream;
+
+/// Return the output streamm to be used for logging the collected statistics.
+llvm::raw_ostream &stats_os() {
+ // Initialize the stream if it is not initialized yet.
+ if (!stats_output_stream) {
+ // If there is user-defined output file name, use it.
+ if (!SILStatsOutputFile.empty()) {
+ // Try to open the file.
+ std::error_code EC;
+ llvm::raw_fd_ostream *fd_stream = new llvm::raw_fd_ostream(
+ SILStatsOutputFile, EC, llvm::sys::fs::OpenFlags::F_Text);
+ if (!fd_stream->has_error() && !EC) {
+ stats_output_stream = {fd_stream,
+ [](llvm::raw_ostream *d) { delete d; }};
+ return *stats_output_stream.get();
+ }
+ fd_stream->clear_error();
+ llvm::errs() << SILStatsOutputFile << " : " << EC.message() << "\n";
+ delete fd_stream;
+ }
+ // Otherwise use llvm::errs() as output. No need to destroy it at the end.
+ stats_output_stream = {&llvm::errs(), [](llvm::raw_ostream *d) {}};
+ }
+ return *stats_output_stream.get();
+}
+
+/// A helper function to dump the counter value.
+void printCounterValue(StringRef Kind, StringRef CounterName, int CounterValue,
+ StringRef Symbol, TransformationContext &Ctx) {
+ stats_os() << Kind;
+ stats_os() << ", ";
+
+ stats_os() << CounterName;
+ stats_os() << ", ";
+
+ stats_os() << Ctx.getStageName();
+ stats_os() << ", ";
+
+ stats_os() << Ctx.getTransformId();
+ stats_os() << ", ";
+
+ stats_os() << Ctx.getPassNumber();
+ stats_os() << ", ";
+
+ stats_os() << CounterValue;
+ stats_os() << ", ";
+
+ stats_os() << Ctx.getDuration();
+ stats_os() << ", ";
+
+ stats_os() << Symbol;
+ stats_os() << "\n";
+}
+
+/// A helper function to dump the change of the counter value.
+void printCounterChange(StringRef Kind, StringRef CounterName, double Delta,
+ int OldValue, int NewValue, TransformationContext &Ctx,
+ StringRef Symbol = "") {
+ stats_os() << Kind;
+ stats_os() << ", ";
+
+ stats_os() << CounterName;
+ stats_os() << ", ";
+
+ stats_os() << Ctx.getStageName();
+ stats_os() << ", ";
+
+ stats_os() << Ctx.getTransformId();
+ stats_os() << ", ";
+
+ stats_os() << Ctx.getPassNumber();
+ stats_os() << ", ";
+
+ llvm::format_provider<double>::format(Delta, stats_os(), "f8");
+ stats_os() << ", ";
+
+ stats_os() << OldValue;
+ stats_os() << ", ";
+
+ stats_os() << NewValue;
+ stats_os() << ", ";
+
+ stats_os() << Ctx.getDuration();
+ stats_os() << ", ";
+
+ stats_os() << Symbol;
+ stats_os() << "\n";
+}
+
+/// Check if a function name matches the pattern provided by the user.
+bool isMatchingFunction(SILFunction *F, bool shouldHaveNamePattern = false) {
+ auto FuncName = F->getName();
+ // Is it an exact string match?
+ if (!StatsOnlyFunctionName.empty())
+ return F->getName() == StatsOnlyFunctionName;
+
+ // Does the name contain a user-defined substring?
+ if (!StatsOnlyFunctionsNamePattern.empty()) {
+ return FuncName.contains(StatsOnlyFunctionsNamePattern);
+ }
+
+ return shouldHaveNamePattern ? true : false;
+}
+
+/// Compute the delta between the old and new values.
+/// Return it as a percent value.
+double computeDelta(int Old, int New) {
+ return 100.0 * (Old ? ((New - Old) * 1.0 / Old) : 0.0);
+}
+
+/// Returns true if it is a first time we collect data for a given counter.
+/// This is the case if the old value is 0 and the new one is something
+/// different, i.e. we didn't have any statistics about it.
+bool isFirstTimeData(int Old, int New) {
+ return Old == 0 && New != Old;
+}
+
+/// Dump statistics for a SILFunction. It is only used if a user asked to
+/// produce detailed stats about transformations of SILFunctions. This
+/// information is dumped unconditionally, for each transformation that changed
+/// the function in any form. No thresholds are taken into account.
+///
+/// \param Stat statistics computed now, after the run of the transformation
+/// \param Ctx transformation context to be used
+void processFuncStatHistory(SILFunction *F, FunctionStat &Stat,
+ TransformationContext &Ctx) {
+ if (!SILStatsFunctions)
+ return;
+
+ if (!SILStatsDumpAll && !isMatchingFunction(F, /*shouldHaveNamePattern*/ true))
+ return;
+
+ printCounterValue("function_history", "block", Stat.BlockCount, F->getName(),
+ Ctx);
+ printCounterValue("function_history", "inst", Stat.InstCount, F->getName(),
+ Ctx);
+
+ /// Dump collected instruction counts.
+ if (!StatsOnlyInstructionsOptLoc.getInstCountsNum())
+ return;
+
+ for (int i = 0, e = SILInstructionsNum; i < e; ++i) {
+ if (!Stat.InstCounts[i])
+ continue;
+ SILInstructionKind Kind = SILInstructionKind(i);
+ if (!StatsOnlyInstructionsOptLoc.shouldComputeInstCount(Kind))
+ continue;
+ std::string CounterName = "inst_";
+ CounterName += getSILInstructionName(Kind);
+ printCounterValue("function_history", CounterName, Stat.InstCounts[i],
+ F->getName(), Ctx);
+ }
+}
+
+/// Process SILFunction's statistics changes.
+///
+/// \param OldStat statistics computed last time
+/// \param NewStat statistics computed now, after the run of the transformation
+/// \param Ctx transformation context to be used
+void processFuncStatsChanges(SILFunction *F, FunctionStat &OldStat,
+ FunctionStat &NewStat,
+ TransformationContext &Ctx) {
+ processFuncStatHistory(F, NewStat, Ctx);
+
+ if (!SILStatsFunctions && !SILStatsDumpAll)
+ return;
+
+ if (OldStat == NewStat)
+ return;
+
+ if ((!StatsOnlyFunctionsNamePattern.empty() ||
+ !StatsOnlyFunctionName.empty()) &&
+ !isMatchingFunction(F))
+ return;
+
+ // Compute deltas.
+ double DeltaBlockCount = computeDelta(OldStat.BlockCount, NewStat.BlockCount);
+ double DeltaInstCount = computeDelta(OldStat.InstCount, NewStat.InstCount);
+
+ NewLineInserter nl;
+
+ // TODO: handle cases where a function got smaller.
+ if ((SILStatsDumpAll &&
+ (DeltaBlockCount != 0.0 || OldStat.BlockCount == 0)) ||
+ (abs(DeltaBlockCount) > FuncBlockCountDeltaThreshold &&
+ OldStat.BlockCount > FuncBlockCountMinThreshold)) {
+ stats_os() << nl.get();
+ printCounterChange("function", "block", DeltaBlockCount, OldStat.BlockCount,
+ NewStat.BlockCount, Ctx, F->getName());
+ }
+
+ if ((SILStatsDumpAll && (DeltaInstCount != 0.0 || OldStat.InstCount == 0)) ||
+ (abs(DeltaInstCount) > FuncInstCountDeltaThreshold &&
+ OldStat.InstCount > FuncInstCountMinThreshold)) {
+ stats_os() << nl.get();
+ printCounterChange("function", "inst", DeltaInstCount, OldStat.InstCount,
+ NewStat.InstCount, Ctx, F->getName());
+ }
+}
+
+/// Process SILModule's statistics changes.
+///
+/// \param OldStat statistics computed last time
+/// \param NewStat statistics computed now, after the run of the transformation
+/// \param Ctx transformation context to be used
+void processModuleStatsChanges(ModuleStat &OldStat, ModuleStat &NewStat,
+ TransformationContext &Ctx) {
+ if (!SILStatsModules && !SILStatsDumpAll)
+ return;
+
+ // Bail if no changes.
+ if (OldStat == NewStat)
+ return;
+
+ // Compute deltas.
+ double DeltaBlockCount = computeDelta(OldStat.BlockCount, NewStat.BlockCount);
+ double DeltaInstCount = computeDelta(OldStat.InstCount, NewStat.InstCount);
+ double DeltaFunctionCount =
+ computeDelta(OldStat.FunctionCount, NewStat.FunctionCount);
+ double DeltaUsedMemory = computeDelta(OldStat.UsedMemory, NewStat.UsedMemory);
+
+ NewLineInserter nl;
+
+ // Print delta for blocks only if it is above a threshold or we are asked to
+ // dump all changes.
+ if ((SILStatsDumpAll &&
+ (DeltaBlockCount != 0.0 ||
+ isFirstTimeData(OldStat.BlockCount, NewStat.BlockCount))) ||
+ (abs(DeltaBlockCount) > BlockCountDeltaThreshold)) {
+ stats_os() << nl.get();
+ printCounterChange("module", "block", DeltaBlockCount, OldStat.BlockCount,
+ NewStat.BlockCount, Ctx);
+ }
+
+ // Print delta for instructions only if it is above a threshold or we are
+ // asked to dump all changes.
+ if ((SILStatsDumpAll &&
+ (DeltaInstCount != 0.0 ||
+ isFirstTimeData(OldStat.InstCount, NewStat.InstCount))) ||
+ (abs(DeltaInstCount) > InstCountDeltaThreshold)) {
+ stats_os() << nl.get();
+ printCounterChange("module", "inst", DeltaInstCount, OldStat.InstCount,
+ NewStat.InstCount, Ctx);
+ }
+
+ // Print delta for functions only if it is above a threshold or we are
+ // asked to dump all changes.
+ if ((SILStatsDumpAll &&
+ (DeltaFunctionCount != 0.0 ||
+ isFirstTimeData(OldStat.FunctionCount, NewStat.FunctionCount))) ||
+ (abs(DeltaFunctionCount) > FunctionCountDeltaThreshold)) {
+ stats_os() << nl.get();
+ printCounterChange("module", "functions", DeltaFunctionCount,
+ OldStat.FunctionCount, NewStat.FunctionCount, Ctx);
+ }
+
+ // Print delta for the used memory only if it is above a threshold or we are
+ // asked to dump all changes.
+ if ((SILStatsDumpAll &&
+ (abs(DeltaUsedMemory) > UsedMemoryMinDeltaThreshold ||
+ isFirstTimeData(OldStat.UsedMemory, NewStat.UsedMemory))) ||
+ (abs(DeltaUsedMemory) > UsedMemoryDeltaThreshold)) {
+ stats_os() << nl.get();
+ printCounterChange("module", "memory", DeltaUsedMemory, OldStat.UsedMemory,
+ NewStat.UsedMemory, Ctx);
+ }
+
+
+ if (SILStatsDumpAll) {
+ // Dump stats about the number of created and deleted instructions.
+ auto DeltaCreatedInstCount =
+ computeDelta(OldStat.CreatedInstCount, NewStat.CreatedInstCount);
+ auto DeltaDeletedInstCount =
+ computeDelta(OldStat.DeletedInstCount, NewStat.DeletedInstCount);
+ if (DeltaCreatedInstCount != 0.0 ||
+ isFirstTimeData(OldStat.CreatedInstCount, NewStat.CreatedInstCount))
+ printCounterChange("module", "created_inst", DeltaCreatedInstCount,
+ OldStat.CreatedInstCount, NewStat.CreatedInstCount,
+ Ctx);
+ if (DeltaDeletedInstCount != 0.0 ||
+ isFirstTimeData(OldStat.DeletedInstCount, NewStat.DeletedInstCount))
+ printCounterChange("module", "deleted_inst", DeltaDeletedInstCount,
+ OldStat.DeletedInstCount, NewStat.DeletedInstCount,
+ Ctx);
+ }
+
+ /// Dump collected instruction counts.
+ if (!StatsOnlyInstructionsOptLoc.getInstCountsNum())
+ return;
+
+ for (int i = 0, e = SILInstructionsNum; i < e; ++i) {
+ // Do not print anything, if there is no change.
+ if (OldStat.InstCounts[i] == NewStat.InstCounts[i])
+ continue;
+ SILInstructionKind Kind = SILInstructionKind(i);
+ if (!StatsOnlyInstructionsOptLoc.shouldComputeInstCount(Kind))
+ continue;
+ SmallString<64> CounterName("inst_");
+ CounterName += getSILInstructionName(Kind);
+ auto DeltaCounterKindCount =
+ computeDelta(OldStat.InstCounts[i], NewStat.InstCounts[i]);
+ printCounterChange("module", CounterName, DeltaCounterKindCount,
+ OldStat.InstCounts[i], NewStat.InstCounts[i], Ctx);
+ }
+}
+
+/// Update the stats for a module after a SIL transform has been performed.
+void OptimizerStatsAnalysis::updateModuleStats(TransformationContext &Ctx) {
+ assert(&getModule() == &Ctx.getModule());
+
+ auto &ModStat = getModuleStat();
+ auto OldModStat = ModStat;
+ ModuleStat NewModStat;
+
+ // First, collect statistics that require scanning SILFunctions.
+ if (OldModStat.FunctionCount == 0) {
+ // This is the first time the stats are computed for the module.
+ // Iterate over all functions in the module and compute the stats.
+ for (auto &F : M) {
+ auto &FuncStat = getFunctionStat(&F);
+ FunctionStat NewFuncStat(&F);
+ processFuncStatHistory(&F, NewFuncStat, Ctx);
+ // Update function stats.
+ FuncStat = NewFuncStat;
+ // Update module stats.
+ NewModStat.addFunctionStat(NewFuncStat);
+ }
+ } else {
+ // Go only over functions that were changed since the last computation.
+ // These are the functions that got invalidated, removed or added.
+ //
+ // If no functions were changed by the last executed transformation, then
+ // the sets of invalidated, deleted and added functions will be empty and
+ // no FunctionStats will be updated.
+ //
+ // FIXME: As a result, the current implementation does not record the fact
+ // about performing a given transformation on a given function, if the
+ // function was not changed during the transformation. This reduced the
+ // amount of recorded information, but makes the history of transformations
+ // on a given function incomplete. If this ever becomes an issue, we can
+ // record all transformations, even if they do not change anything.
+ NewModStat = OldModStat;
+
+ // Process modified functions.
+ while (!InvalidatedFuncs.empty()) {
+ auto *F = InvalidatedFuncs.back();
+ InvalidatedFuncs.pop_back();
+ auto &FuncStat = getFunctionStat(F);
+ auto OldFuncStat = FuncStat;
+ FunctionStat NewFuncStat(F);
+ processFuncStatsChanges(F, OldFuncStat, NewFuncStat, Ctx);
+ NewModStat.subFunctionStat(OldFuncStat);
+ NewModStat.addFunctionStat(NewFuncStat);
+ FuncStat = NewFuncStat;
+ }
+
+ // Process deleted functions.
+ while (!DeletedFuncs.empty()) {
+ auto *F = DeletedFuncs.back();
+ DeletedFuncs.pop_back();
+ auto &FuncStat = getFunctionStat(F);
+ auto OldFuncStat = FuncStat;
+ FunctionStat NewFuncStat;
+ processFuncStatsChanges(F, OldFuncStat, NewFuncStat, Ctx);
+ NewModStat.subFunctionStat(OldFuncStat);
+ Cache->deleteFunctionStat(F);
+ }
+
+ // Process added functions.
+ while (!AddedFuncs.empty()) {
+ auto *F = AddedFuncs.back();
+ AddedFuncs.pop_back();
+ auto &FuncStat = getFunctionStat(F);
+ FunctionStat OldFuncStat;
+ FunctionStat NewFuncStat(F);
+ processFuncStatsChanges(F, OldFuncStat, NewFuncStat, Ctx);
+ NewModStat.addFunctionStat(NewFuncStat);
+ FuncStat = NewFuncStat;
+ }
+ }
+
+ // Then collect some more general statistics, which do not require
+ // any scanning of SILFunctions or the like.
+ NewModStat.addMemoryStat();
+ NewModStat.addCreatedAndDeletedInstructionsStat();
+
+ // Process updates.
+ processModuleStatsChanges(OldModStat, NewModStat, Ctx);
+
+ // Remember the new state of the collected stats.
+ ModStat = NewModStat;
+}
+
+FunctionStat::FunctionStat(SILFunction *F) : InstCounts(SILInstructionsNum) {
+ InstCountVisitor V(InstCounts);
+ V.visitSILFunction(F);
+ BlockCount = V.getBlockCount();
+ InstCount = V.getInstCount();
+}
+
+} // end anonymous namespace
+
+/// Updates SILModule stats after finishing executing the
+/// transform \p Transform.
+///
+/// \param M SILModule to be processed
+/// \param Transform the SIL transformation that was just executed
+/// \param PM the PassManager being used
+void swift::updateSILModuleStatsAfterTransform(SILModule &M,
+ SILTransform *Transform,
+ SILPassManager &PM,
+ int PassNumber, int Duration) {
+ if (!SILStatsModules && !SILStatsFunctions && !SILStatsDumpAll)
+ return;
+ TransformationContext Ctx(M, PM, Transform, PassNumber, Duration);
+ OptimizerStatsAnalysis *Stats = PM.getAnalysis<OptimizerStatsAnalysis>();
+ Stats->updateModuleStats(Ctx);
+}
+
+// This is just a hook for possible extensions in the future.
+// It could be used e.g. to detect sequences of consecutive executions
+// of the same transform.
+void swift::updateSILModuleStatsBeforeTransform(SILModule &M,
+ SILTransform *Transform,
+ SILPassManager &PM,
+ int PassNumber) {
+ if (!SILStatsModules && !SILStatsFunctions)
+ return;
+}
+
+SILAnalysis *swift::createOptimizerStatsAnalysis(SILModule *M) {
+ return new OptimizerStatsAnalysis(M);
+}
diff --git a/lib/SILOptimizer/Utils/SILInliner.cpp b/lib/SILOptimizer/Utils/SILInliner.cpp
index 77045a2..ba5db27 100644
--- a/lib/SILOptimizer/Utils/SILInliner.cpp
+++ b/lib/SILOptimizer/Utils/SILInliner.cpp
@@ -17,6 +17,10 @@
#include "llvm/Support/Debug.h"
using namespace swift;
+bool SILInliner::canInlineFunction(FullApplySite AI) {
+ return AI.getFunction() != &Original;
+}
+
/// \brief Inlines the callee of a given ApplyInst (which must be the value of a
/// FunctionRefInst referencing a function with a known body), into the caller
/// containing the ApplyInst, which must be the same function as provided to the
@@ -28,13 +32,12 @@
///
/// \returns true on success or false if it is unable to inline the function
/// (for any reason).
-bool SILInliner::inlineFunction(FullApplySite AI, ArrayRef<SILValue> Args) {
- SILFunction *CalleeFunction = &Original;
- this->CalleeFunction = CalleeFunction;
+void SILInliner::inlineFunction(FullApplySite AI, ArrayRef<SILValue> Args) {
+ assert(canInlineFunction(AI) &&
+ "Asked to inline function that is unable to be inlined?!");
- // Do not attempt to inline an apply into its parent function.
- if (AI.getFunction() == CalleeFunction)
- return false;
+ // Setup the callee function.
+ CalleeFunction = &Original;
SILFunction &F = getBuilder().getFunction();
assert(AI.getFunction() && AI.getFunction() == &F &&
@@ -113,7 +116,7 @@
// Replace all uses of the apply instruction with the operands of the
// return instruction, appropriately mapped.
nonTryAI->replaceAllUsesWith(remapValue(RI->getOperand()));
- return true;
+ return;
}
}
@@ -177,8 +180,6 @@
// but remaps basic blocks and values.
visit(BI->first->getTerminator());
}
-
- return true;
}
void SILInliner::visitDebugValueInst(DebugValueInst *Inst) {
diff --git a/lib/Sema/CSApply.cpp b/lib/Sema/CSApply.cpp
index ff99355..d1e143d 100644
--- a/lib/Sema/CSApply.cpp
+++ b/lib/Sema/CSApply.cpp
@@ -3886,6 +3886,7 @@
assert(method && "Didn't find a method?");
// The declaration we found must be exposed to Objective-C.
+ tc.validateDecl(method);
if (!method->isObjC()) {
tc.diagnose(E->getLoc(), diag::expr_selector_not_objc,
foundDecl->getDescriptiveKind(), foundDecl->getFullName())
@@ -3984,8 +3985,7 @@
} else {
// Key paths don't work with mutating-get properties.
auto varDecl = cast<VarDecl>(property);
- if (varDecl->hasAccessorFunctions()
- && varDecl->getGetter()->isMutating()) {
+ if (varDecl->isGetterMutating()) {
cs.TC.diagnose(origComponent.getLoc(),
diag::expr_keypath_mutating_getter,
property->getFullName());
@@ -4038,7 +4038,7 @@
break;
}
auto subscript = cast<SubscriptDecl>(foundDecl->choice.getDecl());
- if (subscript->getGetter()->isMutating()) {
+ if (subscript->isGetterMutating()) {
cs.TC.diagnose(origComponent.getLoc(),
diag::expr_keypath_mutating_getter,
subscript->getFullName());
@@ -6350,7 +6350,7 @@
// If neither the property's getter nor its setter are mutating, the base
// can be an rvalue.
if (!SD->isGetterMutating()
- && (!isSettableFromHere || SD->isSetterNonMutating()))
+ && (!isSettableFromHere || !SD->isSetterMutating()))
return baseObjectTy;
// If we're calling an accessor, keep the base as an inout type, because the
diff --git a/lib/Sema/CSDiag.cpp b/lib/Sema/CSDiag.cpp
index 575b093..82e1bfe 100644
--- a/lib/Sema/CSDiag.cpp
+++ b/lib/Sema/CSDiag.cpp
@@ -4322,7 +4322,7 @@
else {
diagID = diag::assignment_lhs_is_immutable_variable;
}
-
+
diagnoseSubElementFailure(dest, equalLoc, *this, diagID,
diag::assignment_lhs_not_lvalue);
}
diff --git a/lib/Sema/CSSimplify.cpp b/lib/Sema/CSSimplify.cpp
index 2038f71..7a68e20 100644
--- a/lib/Sema/CSSimplify.cpp
+++ b/lib/Sema/CSSimplify.cpp
@@ -1473,6 +1473,65 @@
!type->is<DependentMemberType>();
}
+ConstraintSystem::SolutionKind ConstraintSystem::matchTypesBindTypeVar(
+ TypeVariableType *typeVar, Type type, ConstraintKind kind,
+ TypeMatchOptions flags, ConstraintLocatorBuilder locator,
+ std::function<SolutionKind()> formUnsolvedResult) {
+ assert(typeVar->is<TypeVariableType>() && "Expected a type variable!");
+ // FIXME: Due to some SE-0110 related code farther up we can end
+ // up with type variables wrapped in parens that will trip this
+ // assert. For now, maintain the existing behavior.
+ // assert(!type->is<TypeVariableType>() && "Expected a non-type variable!");
+
+ // Simplify the right-hand type and perform the "occurs" check.
+ typeVar = getRepresentative(typeVar);
+ type = simplifyType(type, flags);
+ if (!isBindable(typeVar, type))
+ return formUnsolvedResult();
+
+ // Equal constraints allow mixed LValue/RValue bindings, but
+ // if we bind a type to a type variable that can bind to
+ // LValues as part of simplifying the Equal constraint we may
+ // later block a binding of the opposite "LValue-ness" to the
+ // same type variable that happens as part of simplifying
+ // another constraint.
+ if (kind == ConstraintKind::Equal) {
+ if (typeVar->getImpl().canBindToLValue())
+ return formUnsolvedResult();
+
+ type = type->getRValueType();
+ }
+
+ // If the left-hand type variable cannot bind to an lvalue,
+ // but we still have an lvalue, fail.
+ if (!typeVar->getImpl().canBindToLValue() && type->hasLValueType())
+ return SolutionKind::Error;
+
+ // Okay. Bind below.
+
+ // Check whether the type variable must be bound to a materializable
+ // type.
+ if (typeVar->getImpl().mustBeMaterializable()) {
+ if (!type->isMaterializable())
+ return SolutionKind::Error;
+
+ setMustBeMaterializableRecursive(type);
+ }
+
+ // A constraint that binds any pointer to a void pointer is
+ // ineffective, since any pointer can be converted to a void pointer.
+ if (kind == ConstraintKind::BindToPointerType && type->isVoid()) {
+ // Bind type1 to Void only as a last resort.
+ addConstraint(ConstraintKind::Defaultable, typeVar, type,
+ getConstraintLocator(locator));
+ return SolutionKind::Solved;
+ }
+
+ assignFixedType(typeVar, type);
+
+ return SolutionKind::Solved;
+}
+
ConstraintSystem::SolutionKind
ConstraintSystem::matchTypes(Type type1, Type type2, ConstraintKind kind,
TypeMatchOptions flags,
@@ -1573,86 +1632,20 @@
return SolutionKind::Solved;
}
- // Provide a fixed type for the type variable.
- if (typeVar1) {
- // Simplify the right-hand type and perform the "occurs" check.
- typeVar1 = getRepresentative(typeVar1);
- type2 = simplifyType(type2, flags);
- if (!isBindable(typeVar1, type2))
- return formUnsolvedResult();
+ assert((type1->is<TypeVariableType>() || type2->is<TypeVariableType>()) &&
+ "Expected a type variable!");
+ // FIXME: Due to some SE-0110 related code farther up we can end
+ // up with type variables wrapped in parens that will trip this
+ // assert. For now, maintain the existing behavior.
+ // assert(
+ // (!type1->is<TypeVariableType>() || !type2->is<TypeVariableType>())
+ // && "Expected a non-type variable!");
- // Equal constraints allow mixed LValue/RValue bindings, but
- // if we bind a type to a type variable that can bind to
- // LValues as part of simplifying the Equal constraint we may
- // later block a binding of the opposite "LValue-ness" to the
- // same type variable that happens as part of simplifying
- // another constraint.
- if (kind == ConstraintKind::Equal) {
- if (typeVar1->getImpl().canBindToLValue())
- return formUnsolvedResult();
+ auto *typeVar = typeVar1 ? typeVar1 : typeVar2;
+ auto type = typeVar1 ? type2 : type1;
- type2 = type2->getRValueType();
- }
-
- // If the left-hand type variable cannot bind to an lvalue,
- // but we still have an lvalue, fail.
- if (!typeVar1->getImpl().canBindToLValue() &&
- type2->hasLValueType())
- return SolutionKind::Error;
-
- // Okay. Bind below.
-
- // Check whether the type variable must be bound to a materializable
- // type.
- if (typeVar1->getImpl().mustBeMaterializable()) {
- if (!type2->isMaterializable())
- return SolutionKind::Error;
-
- setMustBeMaterializableRecursive(type2);
- }
-
- // A constraint that binds any pointer to a void pointer is
- // ineffective, since any pointer can be converted to a void pointer.
- if (kind == ConstraintKind::BindToPointerType && type2->isVoid()) {
- // Bind type1 to Void only as a last resort.
- addConstraint(ConstraintKind::Defaultable, typeVar1, type2,
- getConstraintLocator(locator));
- return SolutionKind::Solved;
- }
-
- assignFixedType(typeVar1, type2);
-
- return SolutionKind::Solved;
- }
-
- // Simplify the left-hand type and perform the "occurs" check.
- typeVar2 = getRepresentative(typeVar2);
- type1 = simplifyType(type1, flags);
- if (!isBindable(typeVar2, type1))
- return formUnsolvedResult();
-
- // Equal constraints allow mixed LValue/RValue bindings, but
- // if we bind a type to a type variable that can bind to
- // LValues as part of simplifying the Equal constraint we may
- // later block a binding of the opposite "LValue-ness" to the
- // same type variable that happens as part of simplifying
- // another constraint.
- if (kind == ConstraintKind::Equal) {
- if (typeVar2->getImpl().canBindToLValue())
- return formUnsolvedResult();
-
- type1 = type1->getRValueType();
- }
-
- if (!typeVar2->getImpl().canBindToLValue() &&
- type1->hasLValueType()) {
- return SolutionKind::Error;
-
- // Okay. Bind below.
- }
-
- assignFixedType(typeVar2, type1);
- return SolutionKind::Solved;
+ return matchTypesBindTypeVar(typeVar, type, kind, flags, locator,
+ formUnsolvedResult);
}
case ConstraintKind::BindParam: {
@@ -3971,7 +3964,7 @@
continue;
}
// A nonmutating setter indicates a reference-writable base.
- if (storage->isSetterNonMutating()) {
+ if (!storage->isSetterMutating()) {
capability = ReferenceWritable;
continue;
}
diff --git a/lib/Sema/CodeSynthesis.cpp b/lib/Sema/CodeSynthesis.cpp
index 06623f0..27309bf 100644
--- a/lib/Sema/CodeSynthesis.cpp
+++ b/lib/Sema/CodeSynthesis.cpp
@@ -183,7 +183,7 @@
SmallVector<ParameterList*, 2> params;
bool isStatic = storage->isStatic();
- bool isMutating = !storage->isSetterNonMutating();
+ bool isMutating = storage->isSetterMutating();
// The implicit 'self' argument if in a type context.
if (storage->getDeclContext()->isTypeContext()) {
@@ -342,7 +342,7 @@
Type contextTy = DC->getDeclaredInterfaceType();
if (contextTy && !contextTy->hasReferenceSemantics() &&
!setter->getAttrs().hasAttribute<NonMutatingAttr>() &&
- !storage->isSetterNonMutating())
+ storage->isSetterMutating())
materializeForSet->setSelfAccessKind(SelfAccessKind::Mutating);
materializeForSet->setStatic(storage->isStatic());
@@ -378,6 +378,7 @@
// definition to be compiled.
if (needsToBeRegisteredAsExternalDecl(storage))
TC.Context.addExternalDecl(materializeForSet);
+ TC.DeclsToFinalize.insert(materializeForSet);
return materializeForSet;
}
@@ -715,6 +716,7 @@
// Register the accessor as an external decl if the storage was imported.
if (needsToBeRegisteredAsExternalDecl(storage))
TC.Context.addExternalDecl(getter);
+ TC.DeclsToFinalize.insert(getter);
}
/// Synthesize the body of a trivial setter.
@@ -743,6 +745,7 @@
// Register the accessor as an external decl if the storage was imported.
if (needsToBeRegisteredAsExternalDecl(storage))
TC.Context.addExternalDecl(setter);
+ TC.DeclsToFinalize.insert(setter);
}
/// Does a storage decl currently lacking accessor functions require a
@@ -884,19 +887,21 @@
/// The specified AbstractStorageDecl was just found to satisfy a
/// protocol property requirement. Ensure that it has the full
-/// complement of accessors, and validate them.
+/// complement of accessors.
void TypeChecker::synthesizeWitnessAccessorsForStorage(
AbstractStorageDecl *requirement,
AbstractStorageDecl *storage) {
// If the decl is stored, convert it to StoredWithTrivialAccessors
// by synthesizing the full set of accessors.
if (!storage->hasAccessorFunctions()) {
- addTrivialAccessorsToStorage(storage, *this);
+ // Don't do this if the declaration is lazy or NSManaged.
+ // This must be a re-entrant attempt to synthesize accessors
+ // before validateDecl has finished.
+ if (storage->getAttrs().hasAttribute<LazyAttr>() ||
+ storage->getAttrs().hasAttribute<NSManagedAttr>())
+ return;
- if (auto getter = storage->getGetter())
- validateDecl(getter);
- if (auto setter = storage->getSetter())
- validateDecl(setter);
+ addTrivialAccessorsToStorage(storage, *this);
}
// @objc protocols don't need a materializeForSet since ObjC doesn't
@@ -907,9 +912,6 @@
// If we want wantMaterializeForSet, create it now.
if (wantMaterializeForSet && !storage->getMaterializeForSetFunc())
addMaterializeForSet(storage, *this);
-
- if (auto materializeForSet = storage->getMaterializeForSetFunc())
- validateDecl(materializeForSet);
}
/// Given a VarDecl with a willSet: and/or didSet: specifier, synthesize the
@@ -1682,7 +1684,7 @@
bool mightBeMutating = dc->isTypeContext()
&& !var->isStatic()
- && !dc->getDeclaredInterfaceType()->getClassOrBoundGenericClass();
+ && !dc->getDeclaredInterfaceType()->hasReferenceSemantics();
auto makeBehaviorAccessors = [&]{
FuncDecl *getter;
@@ -1691,7 +1693,7 @@
getter = createGetterPrototype(var, TC);
// The getter is mutating if the behavior implementation is, unless
// we're in a class or non-instance context.
- if (mightBeMutating && valueProp->getGetter()->isMutating())
+ if (mightBeMutating && valueProp->isGetterMutating())
getter->setSelfAccessKind(SelfAccessKind::Mutating);
getter->setAccess(var->getFormalAccess());
@@ -1700,7 +1702,7 @@
if (auto valueSetter = valueProp->getSetter()) {
ParamDecl *newValueParam = nullptr;
setter = createSetterPrototype(var, newValueParam, TC);
- if (mightBeMutating && valueSetter->isMutating())
+ if (mightBeMutating && valueProp->isSetterMutating())
setter->setSelfAccessKind(SelfAccessKind::Mutating);
// TODO: max of property and implementation setter visibility?
setter->setAccess(var->getFormalAccess());
@@ -1784,6 +1786,10 @@
}
TC.validateDecl(valueProp);
+ var->setIsGetterMutating(mightBeMutating &&
+ valueProp->isGetterMutating());
+ var->setIsSetterMutating(mightBeMutating &&
+ valueProp->isSetterMutating());
// Set up a conformance to represent the behavior instantiation.
// The conformance will be on the containing 'self' type, or '()' if the
@@ -1810,8 +1816,10 @@
if (var->getAttrs().hasAttribute<LazyAttr>()) {
auto *getter = createGetterPrototype(var, TC);
// lazy getters are mutating on an enclosing value type.
- if (!dc->getAsClassOrClassExtensionContext())
+ if (!dc->getAsClassOrClassExtensionContext()) {
getter->setSelfAccessKind(SelfAccessKind::Mutating);
+ var->setIsGetterMutating(true);
+ }
getter->setAccess(var->getFormalAccess());
ParamDecl *newValueParam = nullptr;
diff --git a/lib/Sema/ConstraintGraph.cpp b/lib/Sema/ConstraintGraph.cpp
index 475b542..4b49e96 100644
--- a/lib/Sema/ConstraintGraph.cpp
+++ b/lib/Sema/ConstraintGraph.cpp
@@ -641,13 +641,6 @@
case ConstraintKind::BindParam:
case ConstraintKind::BindToPointerType:
case ConstraintKind::Equal:
-
- // We currently only allow subtype contractions for the purpose of
- // parameter binding constraints.
- // TODO: We do this because of how inout parameter bindings are handled
- // for implicit closure parameters. We should consider adjusting our
- // current approach to unlock more opportunities for subtype contractions.
- case ConstraintKind::Subtype:
return true;
default:
@@ -671,12 +664,7 @@
t1 = tt->getElementType(0).getPointer();
}
- auto iot = t1->getAs<InOutType>();
-
- if (!iot)
- return false;
-
- return !iot->getObjectType()->isTypeVariableOrMember();
+ return t1->is<InOutType>();
}
bool ConstraintGraph::contractEdges() {
@@ -698,14 +686,6 @@
auto t1 = constraint->getFirstType()->getDesugaredType();
auto t2 = constraint->getSecondType()->getDesugaredType();
- if (kind == ConstraintKind::Subtype) {
- if (auto iot1 = t1->getAs<InOutType>()) {
- t1 = iot1->getObjectType().getPointer();
- } else {
- continue;
- }
- }
-
auto tyvar1 = t1->getAs<TypeVariableType>();
auto tyvar2 = t2->getAs<TypeVariableType>();
diff --git a/lib/Sema/ConstraintSystem.cpp b/lib/Sema/ConstraintSystem.cpp
index 5664162..0968467 100644
--- a/lib/Sema/ConstraintSystem.cpp
+++ b/lib/Sema/ConstraintSystem.cpp
@@ -677,7 +677,7 @@
// getter and setter are nonmutating.
return !storage->hasStorage() &&
!storage->isGetterMutating() &&
- storage->isSetterNonMutating();
+ !storage->isSetterMutating();
}
Type TypeChecker::getUnopenedTypeOfReference(VarDecl *value, Type baseType,
diff --git a/lib/Sema/ConstraintSystem.h b/lib/Sema/ConstraintSystem.h
index a9ce0b3..e1a82c7 100644
--- a/lib/Sema/ConstraintSystem.h
+++ b/lib/Sema/ConstraintSystem.h
@@ -2270,6 +2270,14 @@
TypeMatchOptions flags,
ConstraintLocatorBuilder locator);
+ /// \brief Subroutine of \c matchTypes(), used to bind a type to a
+ /// type variable.
+ SolutionKind
+ matchTypesBindTypeVar(TypeVariableType *typeVar, Type type,
+ ConstraintKind kind, TypeMatchOptions flags,
+ ConstraintLocatorBuilder locator,
+ std::function<SolutionKind()> formUnsolvedResult);
+
public: // FIXME: public due to statics in CSSimplify.cpp
/// \brief Attempt to match up types \c type1 and \c type2, which in effect
/// is solving the given type constraint between these two types.
diff --git a/lib/Sema/DerivedConformanceCodable.cpp b/lib/Sema/DerivedConformanceCodable.cpp
index 85b5076..b3a53f1 100644
--- a/lib/Sema/DerivedConformanceCodable.cpp
+++ b/lib/Sema/DerivedConformanceCodable.cpp
@@ -244,7 +244,22 @@
if (!properties.empty() &&
proto->isSpecificProtocol(KnownProtocolKind::Decodable)) {
for (auto it = properties.begin(); it != properties.end(); ++it) {
- if (it->second->getParentInitializer() != nullptr) {
+ auto *varDecl = it->second;
+
+ // Optional vars (not lets!) have an implicit default value of nil.
+ if (!varDecl->isLet()) {
+ if (!varDecl->hasType())
+ tc.validateDecl(varDecl);
+
+ if (varDecl->hasType()) {
+ auto varTypeDecl = varDecl->getType()->getAnyNominal();
+ if (varTypeDecl == tc.Context.getOptionalDecl() ||
+ varTypeDecl == tc.Context.getImplicitlyUnwrappedOptionalDecl())
+ continue;
+ }
+ }
+
+ if (varDecl->getParentInitializer() != nullptr) {
// Var has a default value.
continue;
}
diff --git a/lib/Sema/MiscDiagnostics.cpp b/lib/Sema/MiscDiagnostics.cpp
index 85a3c80..07ce81e 100644
--- a/lib/Sema/MiscDiagnostics.cpp
+++ b/lib/Sema/MiscDiagnostics.cpp
@@ -2502,7 +2502,7 @@
// If the store is to a non-mutating member, then this is just a load, even
// if the base is an inout expr.
auto *ASD = cast<AbstractStorageDecl>(decl.getDecl());
- if (ASD->isSettable(nullptr) && ASD->isSetterNonMutating()) {
+ if (ASD->isSettable(nullptr) && !ASD->isSetterMutating()) {
// Sema conservatively converts the base to inout expr when it is an lvalue.
// Look through it because we know it isn't actually doing a load/store.
if (auto *ioe = dyn_cast<InOutExpr>(base))
diff --git a/lib/Sema/TypeCheckDecl.cpp b/lib/Sema/TypeCheckDecl.cpp
index 48a1ddb..a4050b4 100644
--- a/lib/Sema/TypeCheckDecl.cpp
+++ b/lib/Sema/TypeCheckDecl.cpp
@@ -3870,27 +3870,118 @@
}
}
-static void validateAbstractStorageDecl(AbstractStorageDecl *ASD,
- TypeChecker &TC) {
- if (ASD->hasAccessorFunctions())
- maybeAddMaterializeForSet(ASD, TC);
+static bool doesContextHaveValueSemantics(DeclContext *dc) {
+ if (Type contextTy = dc->getDeclaredInterfaceType())
+ return !contextTy->hasReferenceSemantics();
+ return false;
+}
- if (ASD->isFinal())
- makeFinal(TC.Context, ASD->getMaterializeForSetFunc());
+static void validateSelfAccessKind(TypeChecker &TC, FuncDecl *FD) {
+ // Validate the mutating attribute if present, and install it into the bit
+ // on funcdecl (instead of just being a DeclAttribute).
+ if (FD->getAttrs().hasAttribute<MutatingAttr>())
+ FD->setSelfAccessKind(SelfAccessKind::Mutating);
+ else if (FD->getAttrs().hasAttribute<NonMutatingAttr>())
+ FD->setSelfAccessKind(SelfAccessKind::NonMutating);
+ else if (FD->getAttrs().hasAttribute<ConsumingAttr>())
+ FD->setSelfAccessKind(SelfAccessKind::__Consuming);
- if (auto getter = ASD->getGetter())
- TC.validateDecl(getter);
- if (auto setter = ASD->getSetter())
- TC.validateDecl(setter);
- if (auto materializeForSet = ASD->getMaterializeForSetFunc())
- TC.validateDecl(materializeForSet);
- if (ASD->hasAddressors()) {
- if (auto addressor = ASD->getAddressor())
- TC.validateDecl(addressor);
- if (auto addressor = ASD->getMutableAddressor())
- TC.validateDecl(addressor);
+ if (FD->isMutating()) {
+ if (!FD->isInstanceMember() ||
+ !doesContextHaveValueSemantics(FD->getDeclContext()))
+ FD->setSelfAccessKind(SelfAccessKind::NonMutating);
+ }
+}
+
+static bool validateAccessorIsMutating(TypeChecker &TC, FuncDecl *accessor) {
+ assert(accessor && "accessor not present!");
+ validateSelfAccessKind(TC, accessor);
+ return accessor->isMutating();
+}
+
+static bool computeIsGetterMutating(TypeChecker &TC,
+ AbstractStorageDecl *storage) {
+ switch (storage->getStorageKind()) {
+ case AbstractStorageDecl::Stored:
+ return false;
+
+ case AbstractStorageDecl::StoredWithObservers:
+ case AbstractStorageDecl::StoredWithTrivialAccessors:
+ case AbstractStorageDecl::InheritedWithObservers:
+ case AbstractStorageDecl::ComputedWithMutableAddress:
+ case AbstractStorageDecl::Computed:
+ case AbstractStorageDecl::AddressedWithTrivialAccessors:
+ case AbstractStorageDecl::AddressedWithObservers:
+ return validateAccessorIsMutating(TC, storage->getGetter());
+
+ case AbstractStorageDecl::Addressed:
+ return validateAccessorIsMutating(TC, storage->getAddressor());
}
+ llvm_unreachable("bad storage kind");
+}
+
+static bool computeIsSetterMutating(TypeChecker &TC,
+ AbstractStorageDecl *storage) {
+ switch (storage->getStorageKind()) {
+ case AbstractStorageDecl::Stored:
+ case AbstractStorageDecl::StoredWithTrivialAccessors:
+ // Instance member setters are mutating; static property setters and
+ // top-level setters are not.
+ return storage->isInstanceMember() &&
+ doesContextHaveValueSemantics(storage->getDeclContext());
+
+ case AbstractStorageDecl::StoredWithObservers:
+ case AbstractStorageDecl::InheritedWithObservers:
+ case AbstractStorageDecl::Computed:
+ if (auto setter = storage->getSetter())
+ return validateAccessorIsMutating(TC, setter);
+ return false;
+
+ case AbstractStorageDecl::Addressed:
+ case AbstractStorageDecl::AddressedWithTrivialAccessors:
+ case AbstractStorageDecl::AddressedWithObservers:
+ case AbstractStorageDecl::ComputedWithMutableAddress:
+ if (auto addressor = storage->getMutableAddressor())
+ return validateAccessorIsMutating(TC, addressor);
+ return false;
+ }
+ llvm_unreachable("bad storage kind");
+}
+
+static void validateAbstractStorageDecl(TypeChecker &TC,
+ AbstractStorageDecl *storage) {
+ // isGetterMutating and isSetterMutating are part of the signature
+ // of a storage declaration and need to be validated immediately.
+ storage->setIsGetterMutating(computeIsGetterMutating(TC, storage));
+ storage->setIsSetterMutating(computeIsSetterMutating(TC, storage));
+
+ // Create a materializeForSet function if necessary. This needs to
+ // happen immediately so that subclass materializeForSet functions
+ // will be properly marked as overriding it.
+ if (storage->hasAccessorFunctions())
+ maybeAddMaterializeForSet(storage, TC);
+ if (storage->isFinal())
+ makeFinal(TC.Context, storage->getMaterializeForSetFunc());
+
+ // Everything else about the accessors can wait until finalization.
+ TC.DeclsToFinalize.insert(storage);
+}
+
+static void finalizeAbstractStorageDecl(TypeChecker &TC,
+ AbstractStorageDecl *storage) {
+ if (auto getter = storage->getGetter())
+ TC.validateDecl(getter);
+ if (auto setter = storage->getSetter())
+ TC.validateDecl(setter);
+ if (auto materializeForSet = storage->getMaterializeForSetFunc())
+ TC.validateDecl(materializeForSet);
+ if (storage->hasAddressors()) {
+ if (auto addressor = storage->getAddressor())
+ TC.validateDecl(addressor);
+ if (auto addressor = storage->getMutableAddressor())
+ TC.validateDecl(addressor);
+ }
}
namespace {
@@ -4288,7 +4379,8 @@
inferDynamic(TC.Context, SD);
}
- validateAbstractStorageDecl(SD, TC);
+ // Perform accessor-related validation.
+ validateAbstractStorageDecl(TC, SD);
// If this is a get+mutableAddress property, synthesize the setter body.
if (SD->getStorageKind() == SubscriptDecl::ComputedWithMutableAddress &&
@@ -4379,7 +4471,7 @@
TC.validateDecl(ED);
- TC.TypesToFinalize.remove(ED);
+ TC.DeclsToFinalize.remove(ED);
{
// Check for circular inheritance of the raw type.
@@ -4435,7 +4527,7 @@
checkUnsupportedNestedType(SD);
TC.validateDecl(SD);
- TC.TypesToFinalize.remove(SD);
+ TC.DeclsToFinalize.remove(SD);
TC.addImplicitConstructors(SD);
}
@@ -4567,7 +4659,7 @@
if (!CD->hasValidSignature())
return;
- TC.TypesToFinalize.remove(CD);
+ TC.DeclsToFinalize.remove(CD);
{
// Check for circular inheritance.
@@ -5066,6 +5158,10 @@
FD->setIsBeingValidated();
+ SWIFT_DEFER {
+ assert(FD->hasInterfaceType() && "didn't assign interface type");
+ };
+
// Bind operator functions to the corresponding operator declaration.
if (FD->isOperator())
bindFuncDeclToOperator(FD);
@@ -5086,43 +5182,72 @@
}
}
- // Validate the mutating attribute if present, and install it into the bit
- // on funcdecl (instead of just being a DeclAttribute).
- if (FD->getAttrs().hasAttribute<MutatingAttr>())
- FD->setSelfAccessKind(SelfAccessKind::Mutating);
- else if (FD->getAttrs().hasAttribute<NonMutatingAttr>())
- FD->setSelfAccessKind(SelfAccessKind::NonMutating);
- else if (FD->getAttrs().hasAttribute<ConsumingAttr>())
- FD->setSelfAccessKind(SelfAccessKind::__Consuming);
-
- if (FD->isMutating()) {
- Type contextTy = FD->getDeclContext()->getDeclaredInterfaceType();
- if (contextTy->hasReferenceSemantics())
- FD->setSelfAccessKind(SelfAccessKind::NonMutating);
- }
+ validateSelfAccessKind(TC, FD);
// Check whether the return type is dynamic 'Self'.
if (checkDynamicSelfReturn(FD))
FD->setInvalid();
- // Observing accessors (and their generated regular accessors) may have
- // the type of the var inferred.
- if (auto *VD = dyn_cast_or_null<VarDecl>(FD->getAccessorStorageDecl())) {
- if (VD->hasObservers()) {
- TC.validateDecl(VD);
- Type valueTy = VD->getType()->getReferenceStorageReferent();
- Type valueIfaceTy = VD->getInterfaceType()->getReferenceStorageReferent();
- if (FD->isObservingAccessor() || (FD->isSetter() && FD->isImplicit())) {
- unsigned firstParamIdx = FD->getParent()->isTypeContext();
- auto *firstParamPattern = FD->getParameterList(firstParamIdx);
- auto *newValueParam = firstParamPattern->get(0);
- newValueParam->setType(valueTy);
- newValueParam->setInterfaceType(valueIfaceTy);
- newValueParam->getTypeLoc().setType(valueTy);
- } else if (FD->isGetter() && FD->isImplicit()) {
- FD->getBodyResultTypeLoc().setType(valueIfaceTy, true);
+ // Accessors should pick up various parts of their type signatures
+ // directly from the storage declaration instead of re-deriving them.
+ // FIXME: should this include the generic signature?
+ if (auto storage = FD->getAccessorStorageDecl()) {
+ TC.validateDecl(storage);
+
+ auto valueParams = FD->getParameterList(FD->getParent()->isTypeContext());
+
+ // Determine the value type.
+ Type valueIfaceTy, valueTy;
+ if (auto VD = dyn_cast<VarDecl>(storage)) {
+ valueIfaceTy = VD->getInterfaceType()->getReferenceStorageReferent();
+ valueTy = VD->getType()->getReferenceStorageReferent();
+ } else {
+ auto SD = cast<SubscriptDecl>(storage);
+ valueIfaceTy = SD->getElementInterfaceType();
+ valueTy = SD->mapTypeIntoContext(valueIfaceTy);
+
+ // Copy the index types instead of re-validating them.
+ auto indices = SD->getIndices();
+ for (size_t i = 0, e = indices->size(); i != e; ++i) {
+ auto subscriptParam = indices->get(i);
+ if (!subscriptParam->hasInterfaceType())
+ continue;
+
+ Type paramIfaceTy = subscriptParam->getInterfaceType();
+ Type paramTy = SD->mapTypeIntoContext(paramIfaceTy);
+
+ auto accessorParam = valueParams->get(valueParams->size() - e + i);
+ accessorParam->setType(paramTy);
+ accessorParam->setInterfaceType(paramIfaceTy);
+ accessorParam->getTypeLoc().setType(paramTy);
}
}
+
+ // Propagate the value type into the correct position.
+ switch (FD->getAccessorKind()) {
+ case AccessorKind::NotAccessor:
+ llvm_unreachable("not an accessor");
+
+ case AccessorKind::IsGetter:
+ FD->getBodyResultTypeLoc().setType(valueIfaceTy, true);
+ break;
+
+ case AccessorKind::IsDidSet:
+ case AccessorKind::IsWillSet:
+ case AccessorKind::IsSetter: {
+ auto newValueParam = valueParams->get(0);
+ newValueParam->setType(valueTy);
+ newValueParam->setInterfaceType(valueIfaceTy);
+ newValueParam->getTypeLoc().setType(valueTy);
+ break;
+ }
+
+ // These don't mention the value types directly.
+ case AccessorKind::IsMaterializeForSet:
+ case AccessorKind::IsAddressor:
+ case AccessorKind::IsMutableAddressor:
+ break;
+ }
}
// Before anything else, set up the 'self' argument correctly if present.
@@ -5134,7 +5259,14 @@
gp->setOuterParameters(FD->getDeclContext()->getGenericParamsOfContext());
auto *sig = TC.validateGenericFuncSignature(FD);
- auto *env = sig->createGenericEnvironment(*FD->getModuleContext());
+
+ GenericEnvironment *env;
+ if (auto storage = FD->getAccessorStorageDecl()) {
+ env = cast<SubscriptDecl>(storage)->getGenericEnvironment();
+ assert(env && "accessor has generics but subscript is not generic");
+ } else {
+ env = sig->createGenericEnvironment(*FD->getModuleContext());
+ }
FD->setGenericEnvironment(env);
// Revert the types within the signature so it can be type-checked with
@@ -7300,7 +7432,7 @@
checkEnumRawValues(*this, ED);
}
- TypesToFinalize.insert(nominal);
+ DeclsToFinalize.insert(nominal);
break;
}
@@ -7369,13 +7501,16 @@
markAsObjC(*this, proto, isObjC);
}
- TypesToFinalize.insert(proto);
+ DeclsToFinalize.insert(proto);
break;
}
case DeclKind::Var:
case DeclKind::Param: {
auto VD = cast<VarDecl>(D);
+
+ D->setIsBeingValidated();
+
if (!VD->hasInterfaceType()) {
if (VD->isSelfParameter()) {
if (!VD->hasInterfaceType()) {
@@ -7403,8 +7538,6 @@
diagnose(parentPattern->getLoc(), diag::identifier_init_failure,
parentPattern->getBoundName());
}
-
- return;
}
} else {
// FIXME: This case is hit when code completion occurs in a function
@@ -7418,94 +7551,92 @@
}
}
- if (!VD->didEarlyAttrValidation()) {
- checkDeclAttributesEarly(VD);
- validateAttributes(*this, VD);
+ // We're not really done with processing the signature yet, but
+ // @objc checking requires the declaration to call itself validated
+ // so that it can be considered as a witness.
+ D->setIsBeingValidated(false);
- // Synthesize accessors as necessary.
- maybeAddAccessorsToVariable(VD, *this);
+ checkDeclAttributesEarly(VD);
+ validateAttributes(*this, VD);
- // FIXME: Guarding the rest of these things together with early attribute
- // validation is a hack. It's necessary because properties can get types
- // before validateDecl is called.
-
- if (!DeclChecker::checkOverrides(*this, VD)) {
- // If a property has an override attribute but does not override
- // anything, complain.
- auto overridden = VD->getOverriddenDecl();
- if (auto *OA = VD->getAttrs().getAttribute<OverrideAttr>()) {
- if (!overridden) {
- diagnose(VD, diag::property_does_not_override)
- .highlight(OA->getLocation());
- OA->setInvalid();
- }
+ if (!DeclChecker::checkOverrides(*this, VD)) {
+ // If a property has an override attribute but does not override
+ // anything, complain.
+ auto overridden = VD->getOverriddenDecl();
+ if (auto *OA = VD->getAttrs().getAttribute<OverrideAttr>()) {
+ if (!overridden) {
+ diagnose(VD, diag::property_does_not_override)
+ .highlight(OA->getLocation());
+ OA->setInvalid();
}
}
-
- // Properties need some special validation logic.
- if (auto *nominalDecl = VD->getDeclContext()
- ->getAsNominalTypeOrNominalTypeExtensionContext()) {
- // If this is a property, check if it needs to be exposed to
- // Objective-C.
- Optional<ObjCReason> isObjC = shouldMarkAsObjC(*this, VD);
-
- if (isObjC && !isRepresentableInObjC(VD, *isObjC))
- isObjC = None;
-
- markAsObjC(*this, VD, isObjC);
-
- // Under the Swift 3 inference rules, if we have @IBInspectable or
- // @GKInspectable but did not infer @objc, warn that the attribute is
- if (!isObjC && Context.LangOpts.EnableSwift3ObjCInference) {
- if (auto attr = VD->getAttrs().getAttribute<IBInspectableAttr>()) {
- diagnose(attr->getLocation(),
- diag::attribute_meaningless_when_nonobjc,
- attr->getAttrName())
- .fixItRemove(attr->getRange());
- }
-
- if (auto attr = VD->getAttrs().getAttribute<GKInspectableAttr>()) {
- diagnose(attr->getLocation(),
- diag::attribute_meaningless_when_nonobjc,
- attr->getAttrName())
- .fixItRemove(attr->getRange());
- }
- }
-
- // Infer 'dynamic' before touching accessors.
- inferDynamic(Context, VD);
-
- // If this variable is a class member, mark it final if the
- // class is final, or if it was declared with 'let'.
- if (auto cls = dyn_cast<ClassDecl>(nominalDecl)) {
- if (cls->isFinal() || VD->isLet()) {
- if (!VD->isFinal() && !VD->isDynamic()) {
- makeFinal(Context, VD);
- }
- }
- if (VD->isStatic()) {
- auto staticSpelling =
- VD->getParentPatternBinding()->getStaticSpelling();
- if (staticSpelling == StaticSpellingKind::KeywordStatic) {
- auto finalAttr = VD->getAttrs().getAttribute<FinalAttr>();
- if (finalAttr) {
- auto finalRange = finalAttr->getRange();
- if (finalRange.isValid())
- diagnose(finalRange.Start, diag::decl_already_final)
- .highlight(finalRange)
- .fixItRemove(finalRange);
- }
- makeFinal(Context, VD);
- }
- }
- }
- }
-
- // Make sure the getter and setter have valid types, since they will be
- // used by SILGen for any accesses to this variable.
- validateAbstractStorageDecl(VD, *this);
}
+ // Properties need some special validation logic.
+ if (auto *nominalDecl = VD->getDeclContext()
+ ->getAsNominalTypeOrNominalTypeExtensionContext()) {
+ // If this is a property, check if it needs to be exposed to
+ // Objective-C.
+ Optional<ObjCReason> isObjC = shouldMarkAsObjC(*this, VD);
+
+ if (isObjC && !isRepresentableInObjC(VD, *isObjC))
+ isObjC = None;
+
+ markAsObjC(*this, VD, isObjC);
+
+ // Under the Swift 3 inference rules, if we have @IBInspectable or
+ // @GKInspectable but did not infer @objc, warn that the attribute is
+ if (!isObjC && Context.LangOpts.EnableSwift3ObjCInference) {
+ if (auto attr = VD->getAttrs().getAttribute<IBInspectableAttr>()) {
+ diagnose(attr->getLocation(),
+ diag::attribute_meaningless_when_nonobjc,
+ attr->getAttrName())
+ .fixItRemove(attr->getRange());
+ }
+
+ if (auto attr = VD->getAttrs().getAttribute<GKInspectableAttr>()) {
+ diagnose(attr->getLocation(),
+ diag::attribute_meaningless_when_nonobjc,
+ attr->getAttrName())
+ .fixItRemove(attr->getRange());
+ }
+ }
+
+ // Infer 'dynamic' before touching accessors.
+ inferDynamic(Context, VD);
+
+ // If this variable is a class member, mark it final if the
+ // class is final, or if it was declared with 'let'.
+ if (auto cls = dyn_cast<ClassDecl>(nominalDecl)) {
+ if (cls->isFinal() || VD->isLet()) {
+ if (!VD->isFinal() && !VD->isDynamic()) {
+ makeFinal(Context, VD);
+ }
+ }
+ if (VD->isStatic()) {
+ auto staticSpelling =
+ VD->getParentPatternBinding()->getStaticSpelling();
+ if (staticSpelling == StaticSpellingKind::KeywordStatic) {
+ auto finalAttr = VD->getAttrs().getAttribute<FinalAttr>();
+ if (finalAttr) {
+ auto finalRange = finalAttr->getRange();
+ if (finalRange.isValid())
+ diagnose(finalRange.Start, diag::decl_already_final)
+ .highlight(finalRange)
+ .fixItRemove(finalRange);
+ }
+ makeFinal(Context, VD);
+ }
+ }
+ }
+ }
+
+ // Perform accessor-related validation.
+ validateAbstractStorageDecl(*this, VD);
+
+ // Synthesize accessors as necessary.
+ maybeAddAccessorsToVariable(VD, *this);
+
break;
}
@@ -7571,7 +7702,7 @@
}
// Make sure the protocol is fully validated by the end of Sema.
- TypesToFinalize.insert(proto);
+ DeclsToFinalize.insert(proto);
break;
}
case DeclKind::AssociatedType: {
@@ -7630,6 +7761,112 @@
}
}
+static bool shouldValidateMemberDuringFinalization(NominalTypeDecl *nominal,
+ ValueDecl *VD) {
+ // For enums, we only need to validate enum elements to know
+ // the layout.
+ if (isa<EnumDecl>(nominal) &&
+ isa<EnumElementDecl>(VD))
+ return true;
+
+ // For structs, we only need to validate stored properties to
+ // know the layout.
+ if (isa<StructDecl>(nominal) &&
+ (isa<VarDecl>(VD) &&
+ !cast<VarDecl>(VD)->isStatic() &&
+ (cast<VarDecl>(VD)->hasStorage() ||
+ VD->getAttrs().hasAttribute<LazyAttr>())))
+ return true;
+
+ // For classes, we need to validate properties and functions,
+ // but skipping nested types is OK.
+ if (isa<ClassDecl>(nominal) &&
+ !isa<TypeDecl>(VD))
+ return true;
+
+ // For protocols, skip nested typealiases and nominal types.
+ if (isa<ProtocolDecl>(nominal) &&
+ !isa<GenericTypeDecl>(VD))
+ return true;
+
+ return false;
+}
+
+static void finalizeType(TypeChecker &TC, NominalTypeDecl *nominal) {
+ Optional<bool> lazyVarsAlreadyHaveImplementation;
+
+ for (auto *D : nominal->getMembers()) {
+ auto VD = dyn_cast<ValueDecl>(D);
+ if (!VD)
+ continue;
+
+ if (!shouldValidateMemberDuringFinalization(nominal, VD))
+ continue;
+
+ TC.validateDecl(VD);
+
+ // The only thing left to do is synthesize storage for lazy variables.
+ // We only have to do that if it's a type from another file, though.
+ // In NDEBUG builds, bail out as soon as we can.
+#ifdef NDEBUG
+ if (lazyVarsAlreadyHaveImplementation.hasValue() &&
+ lazyVarsAlreadyHaveImplementation.getValue())
+ continue;
+#endif
+ auto *prop = dyn_cast<VarDecl>(D);
+ if (!prop)
+ continue;
+
+ if (prop->getAttrs().hasAttribute<LazyAttr>() && !prop->isStatic()
+ && prop->getGetter()) {
+ bool hasImplementation = prop->getGetter()->hasBody();
+
+ if (lazyVarsAlreadyHaveImplementation.hasValue()) {
+ assert(lazyVarsAlreadyHaveImplementation.getValue() ==
+ hasImplementation &&
+ "only some lazy vars already have implementations");
+ } else {
+ lazyVarsAlreadyHaveImplementation = hasImplementation;
+ }
+
+ if (!hasImplementation)
+ TC.completeLazyVarImplementation(prop);
+ }
+ }
+
+ // FIXME: We need to add implicit initializers and dtors when a decl is
+ // touched, because it affects vtable layout. If you're not defining the
+ // class, you shouldn't have to know what the vtable layout is.
+ if (auto *CD = dyn_cast<ClassDecl>(nominal)) {
+ TC.addImplicitConstructors(CD);
+ TC.addImplicitDestructor(CD);
+ }
+
+ // validateDeclForNameLookup will not trigger an immediate full
+ // validation of protocols, but clients will assume that things
+ // like the requirement signature have been set.
+ if (auto PD = dyn_cast<ProtocolDecl>(nominal)) {
+ if (!PD->isRequirementSignatureComputed()) {
+ TC.validateDecl(PD);
+ }
+ }
+}
+
+void TypeChecker::finalizeDecl(ValueDecl *decl) {
+ if (auto nominal = dyn_cast<NominalTypeDecl>(decl)) {
+ finalizeType(*this, nominal);
+ } else if (auto func = dyn_cast<AbstractFunctionDecl>(decl)) {
+ // We synthesize certain functions --- mostly accessors --- at
+ // times that can be inconvenient for immediate validation. We add
+ // them to the list of declarations to finalize so that we can
+ // fully validate them at a more opportune time.
+ validateDecl(func);
+ } else {
+ auto storage = cast<AbstractStorageDecl>(decl);
+ finalizeAbstractStorageDecl(*this, storage);
+ }
+}
+
void TypeChecker::validateAccessControl(ValueDecl *D) {
if (D->hasAccess())
return;
diff --git a/lib/Sema/TypeCheckError.cpp b/lib/Sema/TypeCheckError.cpp
index a6be8c8..610b7fb 100644
--- a/lib/Sema/TypeCheckError.cpp
+++ b/lib/Sema/TypeCheckError.cpp
@@ -1591,6 +1591,10 @@
}
void TypeChecker::checkFunctionErrorHandling(AbstractFunctionDecl *fn) {
+ // In some cases, we won't have validated the signature
+ // by the time we got here.
+ if (!fn->hasInterfaceType()) return;
+
CheckErrorCoverage checker(*this, Context::forFunction(fn));
// If this is a debugger function, suppress 'try' marking at the top level.
diff --git a/lib/Sema/TypeCheckProtocol.cpp b/lib/Sema/TypeCheckProtocol.cpp
index ad00e6a..f3a713f 100644
--- a/lib/Sema/TypeCheckProtocol.cpp
+++ b/lib/Sema/TypeCheckProtocol.cpp
@@ -6892,6 +6892,7 @@
ValueDecl *req, ValueDecl *witness) {
// Match the witness. This should never fail, but it does allow renaming
// (because property behaviors rely on renaming).
+ validateDecl(witness);
auto dc = conformance->getDeclContext();
RequirementEnvironment reqEnvironment(*this, dc, req, conformance);
auto match = matchWitness(*this, conformance->getProtocol(), conformance,
diff --git a/lib/Sema/TypeCheckType.cpp b/lib/Sema/TypeCheckType.cpp
index d3edb23..48d6099 100644
--- a/lib/Sema/TypeCheckType.cpp
+++ b/lib/Sema/TypeCheckType.cpp
@@ -1547,10 +1547,6 @@
// Raise error if we parse an IUO type in an illegal position.
checkForIllegalIUOs(*this, Loc.getTypeRepr(), options);
- // Special case: in computed property setter, newValue closure is escaping
- if (isa<FuncDecl>(DC) && cast<FuncDecl>(DC)->isSetter())
- options |= TR_ImmediateSetterNewValue;
-
auto type = resolveType(Loc.getTypeRepr(), DC, options, resolver,
unsatisfiedDependency);
if (!type) {
@@ -1697,9 +1693,6 @@
options -= TR_TypeAliasUnderlyingType;
}
- bool isImmediateSetterNewValue = options.contains(TR_ImmediateSetterNewValue);
- options -= TR_ImmediateSetterNewValue;
-
if (Context.LangOpts.DisableAvailabilityChecking)
options |= TR_AllowUnavailable;
@@ -1725,7 +1718,7 @@
// Default non-escaping for closure parameters
auto result =
resolveASTFunctionType(cast<FunctionTypeRepr>(repr), options);
- if (result && result->is<FunctionType>() && !isImmediateSetterNewValue)
+ if (result && result->is<FunctionType>())
return applyNonEscapingFromContext(DC, result, options);
return result;
}
diff --git a/lib/Sema/TypeChecker.cpp b/lib/Sema/TypeChecker.cpp
index 3a62d06..e09a392 100644
--- a/lib/Sema/TypeChecker.cpp
+++ b/lib/Sema/TypeChecker.cpp
@@ -410,97 +410,6 @@
::bindExtensionDecl(ext, *this);
}
-static bool shouldValidateMemberDuringFinalization(NominalTypeDecl *nominal,
- ValueDecl *VD) {
- // For enums, we only need to validate enum elements to know
- // the layout.
- if (isa<EnumDecl>(nominal) &&
- isa<EnumElementDecl>(VD))
- return true;
-
- // For structs, we only need to validate stored properties to
- // know the layout.
- if (isa<StructDecl>(nominal) &&
- (isa<VarDecl>(VD) &&
- !cast<VarDecl>(VD)->isStatic() &&
- (cast<VarDecl>(VD)->hasStorage() ||
- VD->getAttrs().hasAttribute<LazyAttr>())))
- return true;
-
- // For classes, we need to validate properties and functions,
- // but skipping nested types is OK.
- if (isa<ClassDecl>(nominal) &&
- !isa<TypeDecl>(VD))
- return true;
-
- // For protocols, skip nested typealiases and nominal types.
- if (isa<ProtocolDecl>(nominal) &&
- !isa<GenericTypeDecl>(VD))
- return true;
-
- return false;
-}
-
-static void finalizeType(TypeChecker &TC, NominalTypeDecl *nominal) {
- Optional<bool> lazyVarsAlreadyHaveImplementation;
-
- for (auto *D : nominal->getMembers()) {
- auto VD = dyn_cast<ValueDecl>(D);
- if (!VD)
- continue;
-
- if (!shouldValidateMemberDuringFinalization(nominal, VD))
- continue;
-
- TC.validateDecl(VD);
-
- // The only thing left to do is synthesize storage for lazy variables.
- // We only have to do that if it's a type from another file, though.
- // In NDEBUG builds, bail out as soon as we can.
-#ifdef NDEBUG
- if (lazyVarsAlreadyHaveImplementation.hasValue() &&
- lazyVarsAlreadyHaveImplementation.getValue())
- continue;
-#endif
- auto *prop = dyn_cast<VarDecl>(D);
- if (!prop)
- continue;
-
- if (prop->getAttrs().hasAttribute<LazyAttr>() && !prop->isStatic()
- && prop->getGetter()) {
- bool hasImplementation = prop->getGetter()->hasBody();
-
- if (lazyVarsAlreadyHaveImplementation.hasValue()) {
- assert(lazyVarsAlreadyHaveImplementation.getValue() ==
- hasImplementation &&
- "only some lazy vars already have implementations");
- } else {
- lazyVarsAlreadyHaveImplementation = hasImplementation;
- }
-
- if (!hasImplementation)
- TC.completeLazyVarImplementation(prop);
- }
- }
-
- // FIXME: We need to add implicit initializers and dtors when a decl is
- // touched, because it affects vtable layout. If you're not defining the
- // class, you shouldn't have to know what the vtable layout is.
- if (auto *CD = dyn_cast<ClassDecl>(nominal)) {
- TC.addImplicitConstructors(CD);
- TC.addImplicitDestructor(CD);
- }
-
- // validateDeclForNameLookup will not trigger an immediate full
- // validation of protocols, but clients will assume that things
- // like the requirement signature have been set.
- if (auto PD = dyn_cast<ProtocolDecl>(nominal)) {
- if (!PD->isRequirementSignatureComputed()) {
- TC.validateDecl(PD);
- }
- }
-}
-
static void typeCheckFunctionsAndExternalDecls(TypeChecker &TC) {
unsigned currentFunctionIdx = 0;
unsigned currentExternalDef = TC.Context.LastCheckedExternalDefinition;
@@ -547,16 +456,16 @@
llvm_unreachable("Unhandled external definition kind");
}
- // Validate the contents of any referenced nominal types for SIL's purposes.
+ // Validate any referenced declarations for SIL's purposes.
// Note: if we ever start putting extension members in vtables, we'll need
// to validate those members too.
// FIXME: If we're not planning to run SILGen, this is wasted effort.
- while (!TC.TypesToFinalize.empty()) {
- auto nominal = TC.TypesToFinalize.pop_back_val();
- if (nominal->isInvalid() || TC.Context.hadError())
+ while (!TC.DeclsToFinalize.empty()) {
+ auto decl = TC.DeclsToFinalize.pop_back_val();
+ if (decl->isInvalid() || TC.Context.hadError())
continue;
- finalizeType(TC, nominal);
+ TC.finalizeDecl(decl);
}
// Complete any conformances that we used.
@@ -569,7 +478,7 @@
} while (currentFunctionIdx < TC.definedFunctions.size() ||
currentExternalDef < TC.Context.ExternalDefinitions.size() ||
- !TC.TypesToFinalize.empty() ||
+ !TC.DeclsToFinalize.empty() ||
!TC.UsedConformances.empty());
// FIXME: Horrible hack. Store this somewhere more appropriate.
diff --git a/lib/Sema/TypeChecker.h b/lib/Sema/TypeChecker.h
index 794ab60..3f15cd0 100644
--- a/lib/Sema/TypeChecker.h
+++ b/lib/Sema/TypeChecker.h
@@ -508,14 +508,11 @@
/// Whether we are in a type argument for an optional
TR_ImmediateOptionalTypeArgument = 0x800000,
- /// Whether we are checking the outermost type of a computed property setter's newValue
- TR_ImmediateSetterNewValue = 0x1000000,
-
/// Whether we are checking the underlying type of a typealias.
- TR_TypeAliasUnderlyingType = 0x2000000,
+ TR_TypeAliasUnderlyingType = 0x1000000,
/// Whether we are checking the parameter list of a subscript.
- TR_SubscriptParameters = 0x4000000,
+ TR_SubscriptParameters = 0x2000000,
};
/// Option set describing how type resolution should work.
@@ -686,10 +683,10 @@
/// completed before type checking is considered complete.
llvm::SetVector<NormalProtocolConformance *> UsedConformances;
- /// The list of nominal type declarations that we've done at least
- /// partial validation of during type-checking and which will need
- /// to be finalized before we can hand off to SILGen etc.
- llvm::SetVector<NominalTypeDecl *> TypesToFinalize;
+ /// The list of declarations that we've done at least partial validation
+ /// of during type-checking, but which will need to be finalized before
+ /// we can hand them off to SILGen etc.
+ llvm::SetVector<ValueDecl *> DeclsToFinalize;
/// The list of types whose circularity checks were delayed.
SmallVector<NominalTypeDecl*, 8> DelayedCircularityChecks;
@@ -1046,6 +1043,10 @@
/// properly extends the nominal type it names.
void validateExtension(ExtensionDecl *ext);
+ /// Perform final validation of a declaration after everything in the
+ /// translation unit has been processed.
+ void finalizeDecl(ValueDecl *D);
+
/// \brief Force all members of an external decl, and also add its
/// conformances.
void forceExternalDeclMembers(NominalTypeDecl *NTD);
diff --git a/lib/Serialization/Deserialization.cpp b/lib/Serialization/Deserialization.cpp
index a547f10..ac2f666 100644
--- a/lib/Serialization/Deserialization.cpp
+++ b/lib/Serialization/Deserialization.cpp
@@ -2694,6 +2694,7 @@
IdentifierID nameID;
DeclContextID contextID;
bool isImplicit, isObjC, isStatic, hasNonPatternBindingInit;
+ bool isGetterMutating, isSetterMutating;
unsigned specifier;
uint8_t storageKind, rawAccessLevel, rawSetterAccessLevel;
TypeID interfaceTypeID;
@@ -2703,8 +2704,9 @@
decls_block::VarLayout::readRecord(scratch, nameID, contextID,
isImplicit, isObjC, isStatic, specifier,
- hasNonPatternBindingInit, storageKind,
- interfaceTypeID,
+ hasNonPatternBindingInit,
+ isGetterMutating, isSetterMutating,
+ storageKind, interfaceTypeID,
getterID, setterID, materializeForSetID,
addressorID, mutableAddressorID,
willSetID, didSetID, overriddenID,
@@ -2736,6 +2738,8 @@
/*IsCaptureList*/false, SourceLoc(), name,
Type(), DC);
var->setHasNonPatternBindingInit(hasNonPatternBindingInit);
+ var->setIsGetterMutating(isGetterMutating);
+ var->setIsSetterMutating(isSetterMutating);
declOrOffset = var;
Type interfaceType = getType(interfaceTypeID);
@@ -3388,7 +3392,7 @@
case decls_block::SUBSCRIPT_DECL: {
DeclContextID contextID;
- bool isImplicit, isObjC;
+ bool isImplicit, isObjC, isGetterMutating, isSetterMutating;
GenericEnvironmentID genericEnvID;
TypeID interfaceTypeID;
DeclID getterID, setterID, materializeForSetID;
@@ -3400,7 +3404,9 @@
ArrayRef<uint64_t> argNameAndDependencyIDs;
decls_block::SubscriptLayout::readRecord(scratch, contextID,
- isImplicit, isObjC, rawStorageKind,
+ isImplicit, isObjC,
+ isGetterMutating, isSetterMutating,
+ rawStorageKind,
genericEnvID,
interfaceTypeID,
getterID, setterID,
@@ -3441,6 +3447,8 @@
auto subscript = createDecl<SubscriptDecl>(name, SourceLoc(), nullptr,
SourceLoc(), TypeLoc(),
parent, genericParams);
+ subscript->setIsGetterMutating(isGetterMutating);
+ subscript->setIsSetterMutating(isSetterMutating);
declOrOffset = subscript;
configureGenericEnvironment(subscript, genericEnvID);
diff --git a/lib/Serialization/Serialization.cpp b/lib/Serialization/Serialization.cpp
index b27e00a..9385ccd 100644
--- a/lib/Serialization/Serialization.cpp
+++ b/lib/Serialization/Serialization.cpp
@@ -2894,6 +2894,8 @@
var->isStatic(),
getRawStableVarDeclSpecifier(var->getSpecifier()),
var->hasNonPatternBindingInit(),
+ var->isGetterMutating(),
+ var->isSetterMutating(),
(unsigned) accessors.Kind,
addTypeRef(ty),
addDeclRef(accessors.Get),
@@ -3047,6 +3049,8 @@
contextID,
subscript->isImplicit(),
subscript->isObjC(),
+ subscript->isGetterMutating(),
+ subscript->isSetterMutating(),
(unsigned) accessors.Kind,
addGenericEnvironmentRef(
subscript->getGenericEnvironment()),
diff --git a/stdlib/public/core/UnicodeScalar.swift b/stdlib/public/core/UnicodeScalar.swift
index fd7ff3d..99802ce 100644
--- a/stdlib/public/core/UnicodeScalar.swift
+++ b/stdlib/public/core/UnicodeScalar.swift
@@ -187,9 +187,7 @@
if nibble < 10 {
return String(Unicode.Scalar(nibble+48)!) // 48 = '0'
} else {
- // FIXME: was Unicode.Scalar(nibble-10+65), which is now
- // ambiguous. <rdar://problem/18506025>
- return String(Unicode.Scalar(nibble+65-10)!) // 65 = 'A'
+ return String(Unicode.Scalar(nibble-10+65)!) // 65 = 'A'
}
}
diff --git a/stdlib/public/runtime/Array.cpp b/stdlib/public/runtime/Array.cpp
new file mode 100644
index 0000000..cff7e2d
--- /dev/null
+++ b/stdlib/public/runtime/Array.cpp
@@ -0,0 +1,214 @@
+//===------------- Array.cpp - Swift Array Operations Support -------------===//
+//
+// This source file is part of the Swift.org open source project
+//
+// Copyright (c) 2014 - 2017 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
+//
+//===----------------------------------------------------------------------===//
+//
+// Implementations of the array runtime functions.
+//
+// arrayInitWithCopy(T *dest, T *src, size_t count, M* self)
+// arrayInitWithTake(NoAlias|FrontToBack|BackToFront)(T *dest, T *src,
+// size_t count, M* self)
+// arrayAssignWithCopy(NoAlias|FrontToBack|BackToFront)(T *dest, T *src,
+// size_t count, M* self)
+// arrayAssignWithTake(T *dest, T *src, size_t count, M* self)
+// arrayDestroy(T *dst, size_t count, M* self)
+//
+//===----------------------------------------------------------------------===//
+
+#include "swift/Runtime/Config.h"
+#include "swift/Runtime/HeapObject.h"
+#include "swift/Runtime/Metadata.h"
+
+using namespace swift;
+
+namespace {
+enum class ArrayCopy : unsigned {
+ NoAlias = 0,
+ FrontToBack = 1,
+ BackToFront = 2
+};
+
+enum class ArraySource {
+ Copy,
+ Take
+};
+
+enum class ArrayDest {
+ Init,
+ Assign
+};
+} // end anonymous namespace.
+
+static void array_pod_copy(ArrayCopy copyKind, OpaqueValue *dest,
+ OpaqueValue *src, size_t stride, size_t count) {
+ if (copyKind == ArrayCopy::NoAlias) {
+ memcpy(dest, src, stride * count);
+ return;
+ }
+
+ assert(copyKind == ArrayCopy::FrontToBack ||
+ copyKind == ArrayCopy::BackToFront);
+ memmove(dest, src, stride * count);
+}
+
+template <ArrayDest destOp, ArraySource srcOp>
+static void witness_copy(const ValueWitnessTable *wtable, OpaqueValue *dest,
+ OpaqueValue *src, const Metadata *self) {
+ if (destOp == ArrayDest::Init) {
+ if (srcOp == ArraySource::Copy)
+ wtable->initializeWithCopy(dest, src, self);
+ else {
+ assert(srcOp == ArraySource::Take);
+ wtable->initializeWithTake(dest, src, self);
+ }
+ } else {
+ assert(destOp == ArrayDest::Assign);
+ if (srcOp == ArraySource::Copy) {
+ wtable->assignWithCopy(dest, src, self);
+ } else {
+ assert(srcOp == ArraySource::Take);
+ wtable->assignWithTake(dest, src, self);
+ }
+ }
+}
+
+template <ArrayDest destOp, ArraySource srcOp, ArrayCopy copyKind>
+static void array_copy_operation(OpaqueValue *dest, OpaqueValue *src,
+ size_t count, const Metadata *self) {
+ if (count == 0)
+ return;
+
+ auto wtable = self->getValueWitnesses();
+ auto stride = wtable->getStride();
+
+ // If we are doing a copy we need PODness for a memcpy.
+ if (srcOp == ArraySource::Copy) {
+ auto isPOD = wtable->isPOD();
+ if (isPOD) {
+ array_pod_copy(copyKind, dest, src, stride, count);
+ return;
+ }
+ } else {
+ // Otherwise, we are doing a take and need bitwise takability for a copy.
+ assert(srcOp == ArraySource::Take);
+ auto isBitwiseTakable = wtable->isBitwiseTakable();
+ if (isBitwiseTakable && (destOp == ArrayDest::Init || wtable->isPOD())) {
+ array_pod_copy(copyKind, dest, src, stride, count);
+ return;
+ }
+ }
+
+ // Call the witness to do the copy.
+ if (copyKind == ArrayCopy::NoAlias || copyKind == ArrayCopy::FrontToBack) {
+ for (size_t i = 0; i < count; ++i) {
+ auto offset = i * stride;
+ auto *from = reinterpret_cast<OpaqueValue *>((char *)src + offset);
+ auto *to = reinterpret_cast<OpaqueValue *>((char *)dest + offset);
+ witness_copy<destOp, srcOp>(wtable, to, from, self);
+ }
+ return;
+ }
+
+ // Back-to-front copy.
+ assert(copyKind == ArrayCopy::BackToFront);
+ assert(count != 0);
+
+ size_t i = count;
+ do {
+ auto offset = --i * stride;
+ auto *from = reinterpret_cast<OpaqueValue *>((char *)src + offset);
+ auto *to = reinterpret_cast<OpaqueValue *>((char *)dest + offset);
+ witness_copy<destOp, srcOp>(wtable, to, from, self);
+ } while (i != 0);
+}
+
+SWIFT_CC(c)
+SWIFT_RUNTIME_EXPORT
+void swift_arrayInitWithCopy(OpaqueValue *dest, OpaqueValue *src, size_t count,
+ const Metadata *self) {
+ array_copy_operation<ArrayDest::Init, ArraySource::Copy, ArrayCopy::NoAlias>(
+ dest, src, count, self);
+}
+
+SWIFT_CC(c)
+SWIFT_RUNTIME_EXPORT
+void swift_arrayInitWithTakeNoAlias(OpaqueValue *dest, OpaqueValue *src,
+ size_t count, const Metadata *self) {
+ array_copy_operation<ArrayDest::Init, ArraySource::Take, ArrayCopy::NoAlias>(
+ dest, src, count, self);
+}
+
+SWIFT_CC(c)
+SWIFT_RUNTIME_EXPORT
+void swift_arrayInitWithTakeFrontToBack(OpaqueValue *dest, OpaqueValue *src,
+ size_t count, const Metadata *self) {
+ array_copy_operation<ArrayDest::Init, ArraySource::Take,
+ ArrayCopy::FrontToBack>(dest, src, count, self);
+}
+
+SWIFT_CC(c)
+SWIFT_RUNTIME_EXPORT
+void swift_arrayInitWithTakeBackToFront(OpaqueValue *dest, OpaqueValue *src,
+ size_t count, const Metadata *self) {
+ array_copy_operation<ArrayDest::Init, ArraySource::Take,
+ ArrayCopy::BackToFront>(dest, src, count, self);
+}
+
+SWIFT_CC(c)
+SWIFT_RUNTIME_EXPORT
+void swift_arrayAssignWithCopyNoAlias(OpaqueValue *dest, OpaqueValue *src,
+ size_t count, const Metadata *self) {
+ array_copy_operation<ArrayDest::Assign, ArraySource::Copy,
+ ArrayCopy::NoAlias>(dest, src, count, self);
+}
+
+SWIFT_CC(c)
+SWIFT_RUNTIME_EXPORT
+void swift_arrayAssignWithCopyFrontToBack(OpaqueValue *dest, OpaqueValue *src,
+ size_t count, const Metadata *self) {
+ array_copy_operation<ArrayDest::Assign, ArraySource::Copy,
+ ArrayCopy::FrontToBack>(dest, src, count, self);
+}
+
+SWIFT_CC(c)
+SWIFT_RUNTIME_EXPORT
+void swift_arrayAssignWithCopyBackToFront(OpaqueValue *dest, OpaqueValue *src,
+ size_t count, const Metadata *self) {
+ array_copy_operation<ArrayDest::Assign, ArraySource::Copy,
+ ArrayCopy::BackToFront>(dest, src, count, self);
+}
+
+SWIFT_CC(c)
+SWIFT_RUNTIME_EXPORT
+void swift_arrayAssignWithTake(OpaqueValue *dest, OpaqueValue *src,
+ size_t count, const Metadata *self) {
+ array_copy_operation<ArrayDest::Assign, ArraySource::Take,
+ ArrayCopy::NoAlias>(dest, src, count, self);
+}
+
+SWIFT_CC(c)
+SWIFT_RUNTIME_EXPORT
+void swift_arrayDestroy(OpaqueValue *begin, size_t count, const Metadata *self) {
+ if (count == 0)
+ return;
+
+ auto wtable = self->getValueWitnesses();
+
+ // Nothing to do if the type is POD.
+ if (wtable->isPOD())
+ return;
+
+ auto stride = wtable->getStride();
+ for (size_t i = 0; i < count; ++i) {
+ auto offset = i * stride;
+ auto *obj = reinterpret_cast<OpaqueValue *>((char *)begin + offset);
+ wtable->destroy(obj, self);
+ }
+}
diff --git a/stdlib/public/runtime/CMakeLists.txt b/stdlib/public/runtime/CMakeLists.txt
index 99ac87b..4c2709b 100644
--- a/stdlib/public/runtime/CMakeLists.txt
+++ b/stdlib/public/runtime/CMakeLists.txt
@@ -33,6 +33,7 @@
set(swift_runtime_sources
AnyHashableSupport.cpp
+ Array.cpp
Casting.cpp
CygwinPort.cpp
Demangle.cpp
diff --git a/stdlib/public/runtime/Reflection.mm b/stdlib/public/runtime/Reflection.mm
index fb3e0c0..f407811 100644
--- a/stdlib/public/runtime/Reflection.mm
+++ b/stdlib/public/runtime/Reflection.mm
@@ -755,52 +755,6 @@
extern "C" const Metadata STRUCT_METADATA_SYM(s6UInt32);
extern "C" const Metadata STRUCT_METADATA_SYM(s6UInt64);
-// Set to 1 to enable reflection of objc ivars.
-#define REFLECT_OBJC_IVARS 0
-
-/// Map an ObjC type encoding string to a Swift type metadata object.
-///
-#if REFLECT_OBJC_IVARS
-static const Metadata *getMetadataForEncoding(const char *encoding) {
- switch (*encoding) {
- case 'c': // char
- return &STRUCT_METADATA_SYM(s4Int8);
- case 's': // short
- return &STRUCT_METADATA_SYM(s5Int16);
- case 'i': // int
- return &STRUCT_METADATA_SYM(s5Int32);
- case 'l': // long
- return &METADATA_SYM(Si);
- case 'q': // long long
- return &STRUCT_METADATA_SYM(s5Int64);
-
- case 'C': // unsigned char
- return &STRUCT_METADATA_SYM(s5UInt8);
- case 'S': // unsigned short
- return &STRUCT_METADATA_SYM(s6UInt16);
- case 'I': // unsigned int
- return &STRUCT_METADATA_SYM(s6UInt32);
- case 'L': // unsigned long
- return &METADATA_SYM(Su);
- case 'Q': // unsigned long long
- return &STRUCT_METADATA_SYM(s6UInt64);
-
- case 'B': // _Bool
- return &METADATA_SYM(Sb);
-
- case '@': { // Class
- // TODO: Better metadata?
- const OpaqueMetadata *M = &METADATA_SYM(BO);
- return &M->base;
- }
-
- default: // TODO
- // Return 'void' as the type of fields we don't understand.
- return &METADATA_SYM(EMPTY_TUPLE_MANGLING);
- }
-}
-#endif
-
/// \param owner passed at +1, consumed.
/// \param value passed unowned.
SWIFT_CC(swift) SWIFT_RUNTIME_STDLIB_INTERFACE
@@ -810,17 +764,6 @@
auto isa = (Class)type;
unsigned count = 0;
-#if REFLECT_OBJC_IVARS
- // Don't reflect ivars of classes that lie about their layout.
- if (objcClassLiesAboutLayout(isa)) {
- count = 0;
- } else {
- // Copying the ivar list just to free it is lame, but we have
- // nowhere to save it.
- Ivar *ivars = class_copyIvarList(isa, &count);
- free(ivars);
- }
-#else
// ObjC makes no guarantees about the state of ivars, so we can't safely
// introspect them in the general case.
@@ -830,7 +773,6 @@
swift_release(owner);
return count;
-#endif
}
static Mirror ObjC_getMirrorForSuperclass(Class sup,
@@ -845,9 +787,6 @@
HeapObject *owner,
const OpaqueValue *value,
const Metadata *type) {
-#if REFLECT_OBJC_IVARS
- id object = *reinterpret_cast<const id *>(value);
-#endif
auto isa = (Class)type;
// If there's a superclass, it becomes the first child.
@@ -861,44 +800,9 @@
}
--i;
}
-
-#if REFLECT_OBJC_IVARS
- // Copying the ivar list just to free it is lame, but we have
- // no room to save it.
- unsigned count;
- Ivar *ivars;
- // Don't reflect ivars of classes that lie about their layout.
- if (objcClassLiesAboutLayout(isa)) {
- count = 0;
- ivars = nullptr;
- } else {
- // Copying the ivar list just to free it is lame, but we have
- // nowhere to save it.
- ivars = class_copyIvarList(isa, &count);
- }
-
- if (i < 0 || (uintptr_t)i >= (uintptr_t)count)
- swift::crash("Swift mirror subscript bounds check failure");
-
- const char *name = ivar_getName(ivars[i]);
- ptrdiff_t offset = ivar_getOffset(ivars[i]);
- const char *typeEncoding = ivar_getTypeEncoding(ivars[i]);
- free(ivars);
-
- const OpaqueValue *ivar =
- reinterpret_cast<const OpaqueValue *>(
- reinterpret_cast<const char*>(object) + offset);
-
- const Metadata *ivarType = getMetadataForEncoding(typeEncoding);
-
- new (outString) String(name, strlen(name));
- // 'owner' is consumed by this call.
- new (outMirror) Mirror(reflect(owner, ivar, ivarType));
-#else
// ObjC makes no guarantees about the state of ivars, so we can't safely
// introspect them in the general case.
abort();
-#endif
}
SWIFT_CC(swift) SWIFT_RUNTIME_STDLIB_INTERFACE
diff --git a/test/Compatibility/accessibility_private.swift b/test/Compatibility/accessibility_private.swift
index ee5b6d8..457a333 100644
--- a/test/Compatibility/accessibility_private.swift
+++ b/test/Compatibility/accessibility_private.swift
@@ -69,9 +69,8 @@
_ = Container.PrivateInner() // expected-error {{'PrivateInner' is inaccessible due to 'private' protection level}}
}
- // FIXME: Why do these errors happen twice?
- var extensionInner: PrivateInner? { return nil } // expected-error 2 {{'PrivateInner' is inaccessible due to 'private' protection level}}
- var extensionInnerQualified: Container.PrivateInner? { return nil } // expected-error 2 {{'PrivateInner' is inaccessible due to 'private' protection level}}
+ var extensionInner: PrivateInner? { return nil } // expected-error {{'PrivateInner' is inaccessible due to 'private' protection level}}
+ var extensionInnerQualified: Container.PrivateInner? { return nil } // expected-error {{'PrivateInner' is inaccessible due to 'private' protection level}}
}
extension Container.Inner {
@@ -86,10 +85,9 @@
_ = Container.PrivateInner() // expected-error {{'PrivateInner' is inaccessible due to 'private' protection level}}
}
- // FIXME: Why do these errors happen twice?
// FIXME: Unqualified lookup won't look into Container from here.
- var inner: PrivateInner? { return nil } // expected-error 2 {{use of undeclared type 'PrivateInner'}}
- var innerQualified: Container.PrivateInner? { return nil } // expected-error 2 {{'PrivateInner' is inaccessible due to 'private' protection level}}
+ var inner: PrivateInner? { return nil } // expected-error {{use of undeclared type 'PrivateInner'}}
+ var innerQualified: Container.PrivateInner? { return nil } // expected-error {{'PrivateInner' is inaccessible due to 'private' protection level}}
}
class Sub : Container {
diff --git a/test/DebugInfo/mangling.swift b/test/DebugInfo/mangling.swift
index ae370f7..7849f45 100644
--- a/test/DebugInfo/mangling.swift
+++ b/test/DebugInfo/mangling.swift
@@ -8,7 +8,7 @@
// Variable:
// mangling.myDict : Swift.Dictionary<Swift.Int64, Swift.String>
// CHECK: !DIGlobalVariable(name: "myDict",
-// CHECK-SAME: linkageName: "_T08mangling6myDicts10DictionaryVys5Int64VSSGv",
+// CHECK-SAME: linkageName: "_T08mangling6myDicts10DictionaryVys5Int64VSSGvp",
// CHECK-SAME: line: [[@LINE+3]]
// CHECK-SAME: type: ![[DT:[0-9]+]]
// CHECK: ![[DT]] = !DICompositeType(tag: DW_TAG_structure_type, name: "Dictionary"
@@ -17,21 +17,21 @@
// mangling.myTuple1 : (Name : Swift.String, Id : Swift.Int64)
// CHECK: !DIGlobalVariable(name: "myTuple1",
-// CHECK-SAME: linkageName: "_T08mangling8myTuple1SS4Name_s5Int64V2Idtv",
+// CHECK-SAME: linkageName: "_T08mangling8myTuple1SS4Name_s5Int64V2Idtvp",
// CHECK-SAME: line: [[@LINE+3]]
// CHECK-SAME: type: ![[TT1:[0-9]+]]
// CHECK: ![[TT1]] = !DICompositeType(tag: DW_TAG_structure_type, name: "_T0SS4Name_s5Int64V2IdtD"
var myTuple1 : (Name: String, Id: Int64) = ("A", 1)
// mangling.myTuple2 : (Swift.String, Id : Swift.Int64)
// CHECK: !DIGlobalVariable(name: "myTuple2",
-// CHECK-SAME: linkageName: "_T08mangling8myTuple2SS_s5Int64V2Idtv",
+// CHECK-SAME: linkageName: "_T08mangling8myTuple2SS_s5Int64V2Idtvp",
// CHECK-SAME: line: [[@LINE+3]]
// CHECK-SAME: type: ![[TT2:[0-9]+]]
// CHECK: ![[TT2]] = !DICompositeType(tag: DW_TAG_structure_type, name: "_T0SS_s5Int64V2IdtD"
var myTuple2 : ( String, Id: Int64) = ("B", 2)
// mangling.myTuple3 : (Swift.String, Swift.Int64)
// CHECK: !DIGlobalVariable(name: "myTuple3",
-// CHECK-SAME: linkageName: "_T08mangling8myTuple3SS_s5Int64Vtv",
+// CHECK-SAME: linkageName: "_T08mangling8myTuple3SS_s5Int64Vtvp",
// CHECK-SAME: line: [[@LINE+3]]
// CHECK-SAME: type: ![[TT3:[0-9]+]]
// CHECK: ![[TT3]] = !DICompositeType(tag: DW_TAG_structure_type, name: "_T0SS_s5Int64VtD"
diff --git a/test/DebugInfo/test-foundation.swift b/test/DebugInfo/test-foundation.swift
index 1b1e592..42afe4c 100644
--- a/test/DebugInfo/test-foundation.swift
+++ b/test/DebugInfo/test-foundation.swift
@@ -12,7 +12,7 @@
class MyObject : NSObject {
// Ensure we don't emit linetable entries for ObjC thunks.
- // LOC-CHECK: define {{.*}} @_T04main8MyObjectC0B3ArrSo7NSArrayCfgTo
+ // LOC-CHECK: define {{.*}} @_T04main8MyObjectC0B3ArrSo7NSArrayCvgTo
// LOC-CHECK: ret {{.*}}, !dbg ![[DBG:.*]]
// LOC-CHECK: ret
var MyArr = NSArray()
@@ -67,7 +67,7 @@
return [opt, opt]
}
-// LOC-CHECK: ![[THUNK:.*]] = distinct !DISubprogram({{.*}}linkageName: "_T04main8MyObjectC0B3ArrSo7NSArrayCfgTo"
+// LOC-CHECK: ![[THUNK:.*]] = distinct !DISubprogram({{.*}}linkageName: "_T04main8MyObjectC0B3ArrSo7NSArrayCvgTo"
// LOC-CHECK-NOT: line:
// LOC-CHECK-SAME: isDefinition: true
// LOC-CHECK: ![[DBG]] = !DILocation(line: 0, scope: ![[THUNK]])
diff --git a/test/DebugInfo/variables.swift b/test/DebugInfo/variables.swift
index a2f6840..73c2a25 100644
--- a/test/DebugInfo/variables.swift
+++ b/test/DebugInfo/variables.swift
@@ -59,7 +59,7 @@
// Tuple types.
var tuple: (Int, Bool) = (1, true)
-// CHECK-DAG: !DIGlobalVariable(name: "tuple", linkageName: "_T0{{9variables|4main}}5tupleSi_Sbtv",{{.*}} type: ![[TUPTY:[^,)]+]]
+// CHECK-DAG: !DIGlobalVariable(name: "tuple", linkageName: "_T0{{9variables|4main}}5tupleSi_Sbtvp",{{.*}} type: ![[TUPTY:[^,)]+]]
// CHECK-DAG: ![[TUPTY]] = !DICompositeType({{.*}}identifier: "_T0Si_SbtD"
func myprint(_ p: (i: Int, b: Bool)) {
print("\(p.i) -> \(p.b)")
diff --git a/test/Demangle/Inputs/manglings.txt b/test/Demangle/Inputs/manglings.txt
index f6c4072..d690a95 100644
--- a/test/Demangle/Inputs/manglings.txt
+++ b/test/Demangle/Inputs/manglings.txt
@@ -267,7 +267,7 @@
_T0SqWy.17 ---> outlined copy of Swift.Optional with unmangled suffix ".17"
_T03nix6testitSaySiGyFTv_ ---> outlined variable #0 of nix.testit() -> [Swift.Int]
_T03nix6testitSaySiGyFTv0_ ---> outlined variable #1 of nix.testit() -> [Swift.Int]
-_T0So11UITextFieldC4textSSSgfgToTepb_ ---> outlined bridged method (pb) of @objc __ObjC.UITextField.text.getter : Swift.String?
-_T0So11UITextFieldC4textSSSgfgToTeab_ ---> outlined bridged method (ab) of @objc __ObjC.UITextField.text.getter : Swift.String?
+_T0So11UITextFieldC4textSSSgvgToTepb_ ---> outlined bridged method (pb) of @objc __ObjC.UITextField.text.getter : Swift.String?
+_T0So11UITextFieldC4textSSSgvgToTeab_ ---> outlined bridged method (ab) of @objc __ObjC.UITextField.text.getter : Swift.String?
_T0So5GizmoC11doSomethingSQyypGSQySaySSGGFToTembnn_ ---> outlined bridged method (mbnn) of @objc __ObjC.Gizmo.doSomething([Swift.String]!) -> Any!
_T0So5GizmoC12modifyStringSQySSGAD_Si10withNumberSQyypG0D6FoobartFToTembnnnb_ ---> outlined bridged method (mbnnnb) of @objc __ObjC.Gizmo.modifyString(Swift.String!, withNumber: Swift.Int, withFoobar: Any!) -> Swift.String!
diff --git a/test/Frontend/sil-merge-partial-modules.swift b/test/Frontend/sil-merge-partial-modules.swift
index 5c04756..2fb01dc 100644
--- a/test/Frontend/sil-merge-partial-modules.swift
+++ b/test/Frontend/sil-merge-partial-modules.swift
@@ -59,15 +59,15 @@
// CHECK-LABEL: sil @_T04test14publicFunctionyyF : $@convention(thin) () -> ()
-// CHECK-LABEL: sil shared [transparent] [serialized] [thunk] @_T04test9RectangleVAA5ShapeA2aDP4areaSffgTW : $@convention(witness_method) (@in_guaranteed Rectangle) -> Float {
-// CHECK: function_ref @_T04test9RectangleV4areaSffg
+// CHECK-LABEL: sil shared [transparent] [serialized] [thunk] @_T04test9RectangleVAA5ShapeA2aDP4areaSfvgTW : $@convention(witness_method) (@in_guaranteed Rectangle) -> Float {
+// CHECK: function_ref @_T04test9RectangleV4areaSfvg
// CHECK: }
-// CHECK-LABEL: sil @_T04test9RectangleV4areaSffg : $@convention(method) (Rectangle) -> Float
+// CHECK-LABEL: sil @_T04test9RectangleV4areaSfvg : $@convention(method) (Rectangle) -> Float
// CHECK-LABEL: sil_witness_table [serialized] Rectangle: Shape module test {
// CHECK-LABEL: method #Shape.draw!1: <Self where Self : Shape> (Self) -> () -> () : @_T04test9RectangleVAA5ShapeA2aDP4drawyyFTW
-// CHECK-LABEL: method #Shape.area!getter.1: <Self where Self : Shape> (Self) -> () -> Float : @_T04test9RectangleVAA5ShapeA2aDP4areaSffgTW
+// CHECK-LABEL: method #Shape.area!getter.1: <Self where Self : Shape> (Self) -> () -> Float : @_T04test9RectangleVAA5ShapeA2aDP4areaSfvgTW
// CHECK-LABEL: }
// NEGATIVE-NOT: sil {{.*}}internalFunction
diff --git a/test/IDE/comment_inherited_class.swift b/test/IDE/comment_inherited_class.swift
index 9a76f5b..3e8a8ba 100644
--- a/test/IDE/comment_inherited_class.swift
+++ b/test/IDE/comment_inherited_class.swift
@@ -17,13 +17,13 @@
var varNoDerivedComment: Bool {
return false
}
- // CHECK: Var/Base.varNoDerivedComment {{.*}} DocCommentAsXML=[<Other file="{{.*}}" line="{{.*}}" column="{{.*}}"><Name>varNoDerivedComment</Name><USR>s:14swift_ide_test4BaseC19varNoDerivedCommentSbv</USR><Declaration>var varNoDerivedComment: Bool { get }</Declaration><CommentParts><Abstract><Para>Base</Para></Abstract></CommentParts></Other>]
+ // CHECK: Var/Base.varNoDerivedComment {{.*}} DocCommentAsXML=[<Other file="{{.*}}" line="{{.*}}" column="{{.*}}"><Name>varNoDerivedComment</Name><USR>s:14swift_ide_test4BaseC19varNoDerivedCommentSbvp</USR><Declaration>var varNoDerivedComment: Bool { get }</Declaration><CommentParts><Abstract><Para>Base</Para></Abstract></CommentParts></Other>]
/// Base
var varWithDerivedComment: Bool {
return false
}
- // CHECK: Var/Base.varWithDerivedComment {{.*}} DocCommentAsXML=[<Other file="{{.*}}" line="{{.*}}" column="{{.*}}"><Name>varWithDerivedComment</Name><USR>s:14swift_ide_test4BaseC21varWithDerivedCommentSbv</USR><Declaration>var varWithDerivedComment: Bool { get }</Declaration><CommentParts><Abstract><Para>Base</Para></Abstract></CommentParts></Other>]
+ // CHECK: Var/Base.varWithDerivedComment {{.*}} DocCommentAsXML=[<Other file="{{.*}}" line="{{.*}}" column="{{.*}}"><Name>varWithDerivedComment</Name><USR>s:14swift_ide_test4BaseC21varWithDerivedCommentSbvp</USR><Declaration>var varWithDerivedComment: Bool { get }</Declaration><CommentParts><Abstract><Para>Base</Para></Abstract></CommentParts></Other>]
}
class Derived : Base {
@@ -40,12 +40,12 @@
override var varNoDerivedComment: Bool {
return false
}
- // CHECK: Var/Derived.varNoDerivedComment {{.*}} DocCommentAsXML=[<Other file="{{.*}}" line="{{.*}}" column="{{.*}}"><Name>varNoDerivedComment</Name><USR>s:14swift_ide_test7DerivedC05varNoD7CommentSbv</USR><Declaration>override var varNoDerivedComment: Bool { get }</Declaration><CommentParts><Abstract><Para>Base</Para></Abstract><Discussion><Note><Para>This documentation comment was inherited from <codeVoice>Base</codeVoice>.</Para></Note></Discussion></CommentParts></Other>]
+ // CHECK: Var/Derived.varNoDerivedComment {{.*}} DocCommentAsXML=[<Other file="{{.*}}" line="{{.*}}" column="{{.*}}"><Name>varNoDerivedComment</Name><USR>s:14swift_ide_test7DerivedC05varNoD7CommentSbvp</USR><Declaration>override var varNoDerivedComment: Bool { get }</Declaration><CommentParts><Abstract><Para>Base</Para></Abstract><Discussion><Note><Para>This documentation comment was inherited from <codeVoice>Base</codeVoice>.</Para></Note></Discussion></CommentParts></Other>]
// Derived
override var varWithDerivedComment : Bool {
return true
}
- // CHECK: Var/Derived.varWithDerivedComment {{.*}} DocCommentAsXML=[<Other file="{{.*}}" line="{{.*}}" column="{{.*}}"><Name>varWithDerivedComment</Name><USR>s:14swift_ide_test7DerivedC07varWithD7CommentSbv</USR><Declaration>override var varWithDerivedComment: Bool { get }</Declaration><CommentParts><Abstract><Para>Base</Para></Abstract><Discussion><Note><Para>This documentation comment was inherited from <codeVoice>Base</codeVoice>.</Para></Note></Discussion></CommentParts></Other>]
+ // CHECK: Var/Derived.varWithDerivedComment {{.*}} DocCommentAsXML=[<Other file="{{.*}}" line="{{.*}}" column="{{.*}}"><Name>varWithDerivedComment</Name><USR>s:14swift_ide_test7DerivedC07varWithD7CommentSbvp</USR><Declaration>override var varWithDerivedComment: Bool { get }</Declaration><CommentParts><Abstract><Para>Base</Para></Abstract><Discussion><Note><Para>This documentation comment was inherited from <codeVoice>Base</codeVoice>.</Para></Note></Discussion></CommentParts></Other>]
}
diff --git a/test/IDE/comment_inherited_protocol.swift b/test/IDE/comment_inherited_protocol.swift
index e9267f3..112d6b6 100644
--- a/test/IDE/comment_inherited_protocol.swift
+++ b/test/IDE/comment_inherited_protocol.swift
@@ -7,7 +7,7 @@
/// ParentProtocol.onlyParent1Var
var onlyParent1Var: Int { get }
- // CHECK: Var/ParentProtocol1.onlyParent1Var {{.*}} DocCommentAsXML=[<Other file="{{.*}}" line="{{.*}}" column="{{.*}}"><Name>onlyParent1Var</Name><USR>s:14swift_ide_test15ParentProtocol1P14onlyParent1VarSiv</USR><Declaration>var onlyParent1Var: Int { get }</Declaration><CommentParts><Abstract><Para>ParentProtocol.onlyParent1Var</Para></Abstract></CommentParts></Other>]
+ // CHECK: Var/ParentProtocol1.onlyParent1Var {{.*}} DocCommentAsXML=[<Other file="{{.*}}" line="{{.*}}" column="{{.*}}"><Name>onlyParent1Var</Name><USR>s:14swift_ide_test15ParentProtocol1P14onlyParent1VarSivp</USR><Declaration>var onlyParent1Var: Int { get }</Declaration><CommentParts><Abstract><Para>ParentProtocol.onlyParent1Var</Para></Abstract></CommentParts></Other>]
/// ParentProtocol.subscript(index:)
subscript(index: Int) -> Int { get }
@@ -67,7 +67,7 @@
// Should come from ParentProtocol1.
var onlyParent1Var: Int { return 0 }
- // CHECK: Var/onlyParent1Var {{.*}} DocCommentAsXML=[<Other file="{{.*}}" line="{{.*}}" column="{{.*}}"><Name>onlyParent1Var</Name><USR>s:14swift_ide_test15ParentProtocol1P14onlyParent1VarSiv</USR><Declaration>var onlyParent1Var: Int { get }</Declaration><CommentParts><Abstract><Para>ParentProtocol.onlyParent1Var</Para></Abstract></CommentParts></Other>]
+ // CHECK: Var/onlyParent1Var {{.*}} DocCommentAsXML=[<Other file="{{.*}}" line="{{.*}}" column="{{.*}}"><Name>onlyParent1Var</Name><USR>s:14swift_ide_test15ParentProtocol1P14onlyParent1VarSivp</USR><Declaration>var onlyParent1Var: Int { get }</Declaration><CommentParts><Abstract><Para>ParentProtocol.onlyParent1Var</Para></Abstract></CommentParts></Other>]
// Should come from ParentProtocol1.
subscript(index: Int) -> Int { return 0 }
diff --git a/test/IDE/local_types.swift b/test/IDE/local_types.swift
index 3953d64..f41c1d0 100644
--- a/test/IDE/local_types.swift
+++ b/test/IDE/local_types.swift
@@ -100,18 +100,18 @@
}
public var singlePattern: Int {
- // CHECK-DAG: 10LocalTypes13singlePatternSifg06SingleD6StructL_V
+ // CHECK-DAG: 10LocalTypes13singlePatternSivg06SingleD6StructL_V
struct SinglePatternStruct {
let spsi: Int
}
- // CHECK-DAG: 10LocalTypes13singlePatternSifg06SingleD5ClassL_C
+ // CHECK-DAG: 10LocalTypes13singlePatternSivg06SingleD5ClassL_C
class SinglePatternClass {
let spcs: String
init(s: String) {
self.spcs = s
}
}
- // CHECK-DAG: 10LocalTypes13singlePatternSifg06SingleD4EnumL_O
+ // CHECK-DAG: 10LocalTypes13singlePatternSivg06SingleD4EnumL_O
enum SinglePatternEnum {
case SPEI(Int)
}
diff --git a/test/IDE/merge_local_types.swift b/test/IDE/merge_local_types.swift
index dd94be8..18aa774 100644
--- a/test/IDE/merge_local_types.swift
+++ b/test/IDE/merge_local_types.swift
@@ -30,21 +30,21 @@
//CHECK-DAG: 16LocalTypesMerged7toMergeyyF14SingleFuncEnumL_O
//CHECK-DAG: 16LocalTypesMerged10singleFuncyyF06SingleE4EnumL_O
//CHECK-DAG: 16LocalTypesMerged21singleDefaultArgumentySi1i_tFfA_SiycfU_06SingleeF5ClassL_C
-//CHECK-DAG: 16LocalTypesMerged13singlePatternSifg06SingleE4EnumL_O
-//CHECK-DAG: 16LocalTypesMerged13singleClosureyycvfiyycfU_06SingleE5ClassL_C
+//CHECK-DAG: 16LocalTypesMerged13singlePatternSivg06SingleE4EnumL_O
+//CHECK-DAG: 16LocalTypesMerged13singleClosureyycvpfiyycfU_06SingleE5ClassL_C
//CHECK-DAG: 16LocalTypesMerged10doubleFuncyyF05innerE0L_yyF06DoubleE5ClassL_C
-//CHECK-DAG: 16LocalTypesMerged13singleClosureyycvfiyycfU_06SingleE6StructL_V
+//CHECK-DAG: 16LocalTypesMerged13singleClosureyycvpfiyycfU_06SingleE6StructL_V
//CHECK-DAG: 16LocalTypesMerged21singleDefaultArgumentySi1i_tFfA_SiycfU_06SingleeF4EnumL_O
-//CHECK-DAG: 16LocalTypesMerged13singleClosureyycvfiyycfU_06SingleE4EnumL_O
+//CHECK-DAG: 16LocalTypesMerged13singleClosureyycvpfiyycfU_06SingleE4EnumL_O
//CHECK-DAG: 16LocalTypesMerged10singleFuncyyF06SingleE5ClassL_C
-//CHECK-DAG: 16LocalTypesMerged13singlePatternSifg06SingleE5ClassL_C
-//CHECK-DAG: 16LocalTypesMerged13doubleClosureyycvfiyycfU_yycfU_06DoubleE5ClassL_C
-//CHECK-DAG: 16LocalTypesMerged13doubleClosureyycvfiyycfU_yycfU_06DoubleE6StructL_V
+//CHECK-DAG: 16LocalTypesMerged13singlePatternSivg06SingleE5ClassL_C
+//CHECK-DAG: 16LocalTypesMerged13doubleClosureyycvpfiyycfU_yycfU_06DoubleE5ClassL_C
+//CHECK-DAG: 16LocalTypesMerged13doubleClosureyycvpfiyycfU_yycfU_06DoubleE6StructL_V
//CHECK-DAG: 16LocalTypesMerged21singleDefaultArgumentySi1i_tFfA_SiycfU_06SingleeF6StructL_V
-//CHECK-DAG: 16LocalTypesMerged13doubleClosureyycvfiyycfU_yycfU_06DoubleE4EnumL_O
+//CHECK-DAG: 16LocalTypesMerged13doubleClosureyycvpfiyycfU_yycfU_06DoubleE4EnumL_O
//CHECK-DAG: 16LocalTypesMerged10doubleFuncyyF05innerE0L_yyF06DoubleE6StructL_V
//CHECK-DAG: 16LocalTypesMerged10doubleFuncyyF05innerE0L_yyF06DoubleE4EnumL_O
//CHECK-DAG: 16LocalTypesMerged7toMergeyyF15SingleFuncClassL_C
//CHECK-DAG: 16LocalTypesMerged7toMergeyyF16SingleFuncStructL_V
//CHECK-DAG: 16LocalTypesMerged10singleFuncyyF06SingleE6StructL_V
-//CHECK-DAG: 16LocalTypesMerged13singlePatternSifg06SingleE6StructL_V
+//CHECK-DAG: 16LocalTypesMerged13singlePatternSivg06SingleE6StructL_V
diff --git a/test/IDE/print_usrs.swift b/test/IDE/print_usrs.swift
index 58b2ad5..c6221a8 100644
--- a/test/IDE/print_usrs.swift
+++ b/test/IDE/print_usrs.swift
@@ -5,7 +5,7 @@
// CHECK: [[@LINE+1]]:8 s:14swift_ide_test1SV{{$}}
struct S {
- // CHECK: [[@LINE+1]]:7 s:14swift_ide_test1SV1xSiv{{$}}
+ // CHECK: [[@LINE+1]]:7 s:14swift_ide_test1SV1xSivp{{$}}
var x : Int
}
@@ -16,22 +16,30 @@
class MyCls {
// CHECK: [[@LINE+1]]:13 s:14swift_ide_test5MyClsC2TAa{{$}}
typealias TA = Int
- // CHECK: [[@LINE+1]]:7 s:14swift_ide_test5MyClsC3wwwSiv{{$}}
+ // CHECK: [[@LINE+1]]:7 s:14swift_ide_test5MyClsC3wwwSivp{{$}}
var www : Int = 0
// CHECK: [[@LINE+1]]:8 s:14swift_ide_test5MyClsC3fooySiF{{$}}
func foo(_ x : Int) {}
- // CHECK: [[@LINE+1]]:3 s:14swift_ide_test5MyClsC9subscriptSfSici{{$}}
+ // CHECK: [[@LINE+1]]:3 s:14swift_ide_test5MyClsCSfSicip{{$}}
subscript(i: Int) -> Float {
- // CHECK: [[@LINE+1]]:5 s:14swift_ide_test5MyClsC9subscriptSfSicfg{{$}}
+ // CHECK: [[@LINE+1]]:5 s:14swift_ide_test5MyClsCSfSicig{{$}}
get { return 0.0 }
- // CHECK: [[@LINE+1]]:5 s:14swift_ide_test5MyClsC9subscriptSfSicfs{{$}}
+ // CHECK: [[@LINE+1]]:5 s:14swift_ide_test5MyClsCSfSicis{{$}}
set {}
}
- // CHECK: [[@LINE+1]]:3 s:14swift_ide_test5MyClsC9subscriptSfSi_Sitci{{$}}
+ // CHECK: [[@LINE+1]]:3 s:14swift_ide_test5MyClsCSfSi_Sitcip{{$}}
subscript(_: Int, _: Int) -> Float {
- // CHECK: [[@LINE+1]]:5 s:14swift_ide_test5MyClsC9subscriptSfSi_Sitcfg{{$}}
+ // CHECK: [[@LINE+1]]:5 s:14swift_ide_test5MyClsCSfSi_Sitcig{{$}}
get { return 0.0 }
- // CHECK: [[@LINE+1]]:5 s:14swift_ide_test5MyClsC9subscriptSfSi_Sitcfs{{$}}
+ // CHECK: [[@LINE+1]]:5 s:14swift_ide_test5MyClsCSfSi_Sitcis{{$}}
+ set {}
+ }
+
+ // CHECK: [[@LINE+1]]:11 s:14swift_ide_test5MyClsCSfSi_S2itc33_32FE8F7EF2DE2FC69E75F86A8A3935D3Llip{{$}}
+ private subscript(_: Int, _: Int, _: Int) -> Float {
+ // CHECK: [[@LINE+1]]:5 s:14swift_ide_test5MyClsCSfSi_S2itc33_32FE8F7EF2DE2FC69E75F86A8A3935D3Llig{{$}}
+ get { return 0.0 }
+ // CHECK: [[@LINE+1]]:5 s:14swift_ide_test5MyClsCSfSi_S2itc33_32FE8F7EF2DE2FC69E75F86A8A3935D3Llis{{$}}
set {}
}
}
@@ -42,34 +50,34 @@
// CHECK: [[@LINE+1]]:13 s:14swift_ide_test12GenericClassC2TAa{{$}}
typealias TA = Int
- // CHECK: [[@LINE+1]]:7 s:14swift_ide_test12GenericClassC11instanceVarSiv{{$}}
+ // CHECK: [[@LINE+1]]:7 s:14swift_ide_test12GenericClassC11instanceVarSivp{{$}}
var instanceVar: Int = 0
// CHECK: [[@LINE+1]]:8 s:14swift_ide_test12GenericClassC12instanceFuncyyF{{$}}
func instanceFunc() {
// CHECK: [[@LINE+2]]:18 s:14swift_ide_test12GenericClassC9classFuncyACFZ{{$}}
- // CHECK: [[@LINE+1]]:28 s:14swift_ide_test12GenericClassC12instanceFuncyyF4selfL_ACv{{$}}
+ // CHECK: [[@LINE+1]]:28 s:14swift_ide_test12GenericClassC12instanceFuncyyF4selfL_ACvp{{$}}
GenericClass.classFunc(self)
}
- // CHECK: [[@LINE+2]]:3 s:14swift_ide_test12GenericClassC9subscriptSfSici{{$}}
- // CHECK: [[@LINE+1]]:13 s:14swift_ide_test12GenericClassC1iL_Siv{{$}}
+ // CHECK: [[@LINE+2]]:3 s:14swift_ide_test12GenericClassCSfSicip{{$}}
+ // CHECK: [[@LINE+1]]:13 s:14swift_ide_test12GenericClassC1iL_Sivp{{$}}
subscript(i: Int) -> Float {
- // CHECK: [[@LINE+1]]:5 s:14swift_ide_test12GenericClassC9subscriptSfSicfg{{$}}
+ // CHECK: [[@LINE+1]]:5 s:14swift_ide_test12GenericClassCSfSicig{{$}}
get { return 0.0 }
- // CHECK: [[@LINE+1]]:5 s:14swift_ide_test12GenericClassC9subscriptSfSicfs{{$}}
+ // CHECK: [[@LINE+1]]:5 s:14swift_ide_test12GenericClassCSfSicis{{$}}
set {}
}
// CHECK: [[@LINE+1]]:3 s:14swift_ide_test12GenericClassCfd{{$}}
deinit {
// CHECK: [[@LINE+2]]:18 s:14swift_ide_test12GenericClassC9classFuncyACFZ{{$}}
- // CHECK: [[@LINE+1]]:28 s:14swift_ide_test12GenericClassCfd4selfL_ACv{{$}}
+ // CHECK: [[@LINE+1]]:28 s:14swift_ide_test12GenericClassCfd4selfL_ACvp{{$}}
GenericClass.classFunc(self)
}
// CHECK: [[@LINE+2]]:14 s:14swift_ide_test12GenericClassC9classFuncyACFZ{{$}}
- // CHECK: [[@LINE+1]]:26 s:14swift_ide_test12GenericClassC9classFuncyACFZ1aL_ACv{{$}}
+ // CHECK: [[@LINE+1]]:26 s:14swift_ide_test12GenericClassC9classFuncyACFZ1aL_ACvp{{$}}
class func classFunc(_ a: GenericClass) {}
}
@@ -79,8 +87,8 @@
associatedtype Blarg
// CHECK: [[@LINE+1]]:8 s:14swift_ide_test4ProtP8protMeth5BlargQzAFF{{$}}
func protMeth(_ x: Blarg) -> Blarg
- // CHECK: [[@LINE+2]]:7 s:14swift_ide_test4ProtP17protocolProperty1Siv{{$}}
- // CHECK: [[@LINE+1]]:32 s:14swift_ide_test4ProtP17protocolProperty1Sifg{{$}}
+ // CHECK: [[@LINE+2]]:7 s:14swift_ide_test4ProtP17protocolProperty1Sivp{{$}}
+ // CHECK: [[@LINE+1]]:32 s:14swift_ide_test4ProtP17protocolProperty1Sivg{{$}}
var protocolProperty1: Int { get }
}
protocol Prot2 {}
@@ -90,7 +98,7 @@
typealias Blarg = Prot2
// CHECK: [[@LINE+1]]:8 s:14swift_ide_test6SubClsC8protMethAA5Prot2_pAaE_pF{{$}}
func protMeth(_ x: Blarg) -> Blarg {}
- // CHECK: [[@LINE+1]]:7 s:14swift_ide_test6SubClsC17protocolProperty1Siv{{$}}
+ // CHECK: [[@LINE+1]]:7 s:14swift_ide_test6SubClsC17protocolProperty1Sivp{{$}}
var protocolProperty1 = 0
}
@@ -109,13 +117,13 @@
// CHECK: [[@LINE+1]]:14 s:14swift_ide_test6GenClsC4cfooyyFZ{{$}}
class func cfoo() {}
- // CHECK: [[@LINE+1]]:3 s:14swift_ide_test6GenClsC9subscriptS2i_Sitci{{$}}
+ // CHECK: [[@LINE+1]]:3 s:14swift_ide_test6GenClsCS2i_Sitcip{{$}}
subscript (i : Int, j : Int) -> Int {
- // CHECK: [[@LINE+1]]:5 s:14swift_ide_test6GenClsC9subscriptS2i_Sitcfg{{$}}
+ // CHECK: [[@LINE+1]]:5 s:14swift_ide_test6GenClsCS2i_Sitcig{{$}}
get {
return i + j
}
- // CHECK: [[@LINE+1]]:5 s:14swift_ide_test6GenClsC9subscriptS2i_Sitcfs{{$}}
+ // CHECK: [[@LINE+1]]:5 s:14swift_ide_test6GenClsCS2i_Sitcis{{$}}
set(v) {
_ = v + i - j
}
@@ -139,19 +147,19 @@
class Observers {
func doit() {}
- // CHECK: [[@LINE+1]]:7 s:14swift_ide_test9ObserversC2p1Siv{{$}}
+ // CHECK: [[@LINE+1]]:7 s:14swift_ide_test9ObserversC2p1Sivp{{$}}
var p1 : Int = 0 {
- // CHECK: [[@LINE+1]]:5 s:14swift_ide_test9ObserversC2p1Sifw{{$}}
+ // CHECK: [[@LINE+1]]:5 s:14swift_ide_test9ObserversC2p1Sivw{{$}}
willSet(newValue) { doit() }
- // CHECK: [[@LINE+1]]:5 s:14swift_ide_test9ObserversC2p1SifW{{$}}
+ // CHECK: [[@LINE+1]]:5 s:14swift_ide_test9ObserversC2p1SivW{{$}}
didSet { doit() }
}
- // CHECK: [[@LINE+1]]:7 s:14swift_ide_test9ObserversC2p2Siv{{$}}
+ // CHECK: [[@LINE+1]]:7 s:14swift_ide_test9ObserversC2p2Sivp{{$}}
var p2 = 42 {
- // CHECK: [[@LINE+1]]:5 s:14swift_ide_test9ObserversC2p2Sifw{{$}}
+ // CHECK: [[@LINE+1]]:5 s:14swift_ide_test9ObserversC2p2Sivw{{$}}
willSet(newValue) { doit() }
- // CHECK: [[@LINE+1]]:5 s:14swift_ide_test9ObserversC2p2SifW{{$}}
+ // CHECK: [[@LINE+1]]:5 s:14swift_ide_test9ObserversC2p2SivW{{$}}
didSet { doit() }
}
}
@@ -197,8 +205,8 @@
// CHECK: [[@LINE+1]]:14 c:@M@swift_ide_test@objc(cs)ObjCClass1(cm)staticFunc1:{{$}}
class func staticFunc1(_ a: Int) {}
- // CHECK: [[@LINE+2]]:10 s:14swift_ide_test10ObjCClass1C9subscriptS2ici{{$}}
- // CHECK: [[@LINE+1]]:20 s:14swift_ide_test10ObjCClass1C1xL_Siv{{$}}
+ // CHECK: [[@LINE+2]]:10 s:14swift_ide_test10ObjCClass1CS2icip{{$}}
+ // CHECK: [[@LINE+1]]:20 s:14swift_ide_test10ObjCClass1C1xL_Sivp{{$}}
public subscript(x: Int) -> Int {
// CHECK: [[@LINE+1]]:5 c:@M@swift_ide_test@objc(cs)ObjCClass1(im)objectAtIndexedSubscript:{{$}}
@@ -208,8 +216,8 @@
set {}
}
- // CHECK: [[@LINE+2]]:10 s:14swift_ide_test10ObjCClass1C9subscriptSiACci{{$}}
- // CHECK: [[@LINE+1]]:20 s:14swift_ide_test10ObjCClass1C1xL_ACv{{$}}
+ // CHECK: [[@LINE+2]]:10 s:14swift_ide_test10ObjCClass1CSiACcip{{$}}
+ // CHECK: [[@LINE+1]]:20 s:14swift_ide_test10ObjCClass1C1xL_ACvp{{$}}
public subscript(x: ObjCClass1) -> Int {
// CHECK: [[@LINE+1]]:5 c:@M@swift_ide_test@objc(cs)ObjCClass1(im)objectForKeyedSubscript:{{$}}
diff --git a/test/IRGen/big_types_corner_cases.swift b/test/IRGen/big_types_corner_cases.swift
index c10d2d7..17fa5eb 100644
--- a/test/IRGen/big_types_corner_cases.swift
+++ b/test/IRGen/big_types_corner_cases.swift
@@ -171,7 +171,7 @@
}
}
-// CHECK-LABEL: define{{( protected)?}} swiftcc void @_T022big_types_corner_cases10MUseStructV16superclassMirrorAA03BigF0VSgfg(%T22big_types_corner_cases9BigStructVSg* noalias nocapture sret, %T22big_types_corner_cases10MUseStructV* noalias nocapture swiftself dereferenceable({{.*}})) #0 {
+// CHECK-LABEL: define{{( protected)?}} swiftcc void @_T022big_types_corner_cases10MUseStructV16superclassMirrorAA03BigF0VSgvg(%T22big_types_corner_cases9BigStructVSg* noalias nocapture sret, %T22big_types_corner_cases10MUseStructV* noalias nocapture swiftself dereferenceable({{.*}})) #0 {
// CHECK: [[ALLOC:%.*]] = alloca %T22big_types_corner_cases9BigStructVSg
// CHECK: [[LOAD:%.*]] = load %swift.refcounted*, %swift.refcounted** %.callInternalLet.data
// CHECK: call swiftcc void %6(%T22big_types_corner_cases9BigStructVSg* noalias nocapture sret [[ALLOC]], %swift.refcounted* swiftself [[LOAD]])
diff --git a/test/IRGen/class_resilience.swift b/test/IRGen/class_resilience.swift
index 5c5c08c..e7c2b20 100644
--- a/test/IRGen/class_resilience.swift
+++ b/test/IRGen/class_resilience.swift
@@ -7,20 +7,20 @@
// CHECK: %swift.type = type { [[INT:i32|i64]] }
-// CHECK: @_T016class_resilience26ClassWithResilientPropertyC1s16resilient_struct4SizeVvWvd = {{(protected )?}}global [[INT]] 0
-// CHECK: @_T016class_resilience26ClassWithResilientPropertyC5colors5Int32VvWvd = {{(protected )?}}global [[INT]] 0
+// CHECK: @_T016class_resilience26ClassWithResilientPropertyC1s16resilient_struct4SizeVvpWvd = {{(protected )?}}global [[INT]] 0
+// CHECK: @_T016class_resilience26ClassWithResilientPropertyC5colors5Int32VvpWvd = {{(protected )?}}global [[INT]] 0
-// CHECK: @_T016class_resilience33ClassWithResilientlySizedPropertyC1r16resilient_struct9RectangleVvWvd = {{(protected )?}}global [[INT]] 0
-// CHECK: @_T016class_resilience33ClassWithResilientlySizedPropertyC5colors5Int32VvWvd = {{(protected )?}}global [[INT]] 0
+// CHECK: @_T016class_resilience33ClassWithResilientlySizedPropertyC1r16resilient_struct9RectangleVvpWvd = {{(protected )?}}global [[INT]] 0
+// CHECK: @_T016class_resilience33ClassWithResilientlySizedPropertyC5colors5Int32VvpWvd = {{(protected )?}}global [[INT]] 0
-// CHECK: @_T016class_resilience14ResilientChildC5fields5Int32VvWvd = {{(protected )?}}global [[INT]] {{12|16}}
-// CHECK: @_T016class_resilience21ResilientGenericChildC5fields5Int32VvWvi = {{(protected )?}}global [[INT]] {{56|88}}
+// CHECK: @_T016class_resilience14ResilientChildC5fields5Int32VvpWvd = {{(protected )?}}global [[INT]] {{12|16}}
+// CHECK: @_T016class_resilience21ResilientGenericChildC5fields5Int32VvpWvi = {{(protected )?}}global [[INT]] {{56|88}}
-// CHECK: @_T016class_resilience28ClassWithMyResilientPropertyC1rAA0eF6StructVvWvd = {{(protected )?}}constant [[INT]] {{12|16}}
-// CHECK: @_T016class_resilience28ClassWithMyResilientPropertyC5colors5Int32VvWvd = {{(protected )?}}constant [[INT]] {{16|20}}
+// CHECK: @_T016class_resilience28ClassWithMyResilientPropertyC1rAA0eF6StructVvpWvd = {{(protected )?}}constant [[INT]] {{12|16}}
+// CHECK: @_T016class_resilience28ClassWithMyResilientPropertyC5colors5Int32VvpWvd = {{(protected )?}}constant [[INT]] {{16|20}}
-// CHECK: @_T016class_resilience30ClassWithIndirectResilientEnumC1s14resilient_enum10FunnyShapeOvWvd = {{(protected )?}}constant [[INT]] {{12|16}}
-// CHECK: @_T016class_resilience30ClassWithIndirectResilientEnumC5colors5Int32VvWvd = {{(protected )?}}constant [[INT]] {{16|24}}
+// CHECK: @_T016class_resilience30ClassWithIndirectResilientEnumC1s14resilient_enum10FunnyShapeOvpWvd = {{(protected )?}}constant [[INT]] {{12|16}}
+// CHECK: @_T016class_resilience30ClassWithIndirectResilientEnumC5colors5Int32VvpWvd = {{(protected )?}}constant [[INT]] {{16|24}}
import resilient_class
import resilient_struct
@@ -117,8 +117,8 @@
// ClassWithResilientProperty.color getter
-// CHECK-LABEL: define{{( protected)?}} swiftcc i32 @_T016class_resilience26ClassWithResilientPropertyC5colors5Int32Vfg(%T16class_resilience26ClassWithResilientPropertyC* swiftself)
-// CHECK: [[OFFSET:%.*]] = load [[INT]], [[INT]]* @_T016class_resilience26ClassWithResilientPropertyC5colors5Int32VvWvd
+// CHECK-LABEL: define{{( protected)?}} swiftcc i32 @_T016class_resilience26ClassWithResilientPropertyC5colors5Int32Vvg(%T16class_resilience26ClassWithResilientPropertyC* swiftself)
+// CHECK: [[OFFSET:%.*]] = load [[INT]], [[INT]]* @_T016class_resilience26ClassWithResilientPropertyC5colors5Int32VvpWvd
// CHECK-NEXT: [[PTR:%.*]] = bitcast %T16class_resilience26ClassWithResilientPropertyC* %0 to i8*
// CHECK-NEXT: [[FIELD_ADDR:%.*]] = getelementptr inbounds i8, i8* [[PTR]], [[INT]] [[OFFSET]]
// CHECK-NEXT: [[FIELD_PTR:%.*]] = bitcast i8* [[FIELD_ADDR]] to %Ts5Int32V*
@@ -146,8 +146,8 @@
// ClassWithResilientlySizedProperty.color getter
-// CHECK-LABEL: define{{( protected)?}} swiftcc i32 @_T016class_resilience33ClassWithResilientlySizedPropertyC5colors5Int32Vfg(%T16class_resilience33ClassWithResilientlySizedPropertyC* swiftself)
-// CHECK: [[OFFSET:%.*]] = load [[INT]], [[INT]]* @_T016class_resilience33ClassWithResilientlySizedPropertyC5colors5Int32VvWvd
+// CHECK-LABEL: define{{( protected)?}} swiftcc i32 @_T016class_resilience33ClassWithResilientlySizedPropertyC5colors5Int32Vvg(%T16class_resilience33ClassWithResilientlySizedPropertyC* swiftself)
+// CHECK: [[OFFSET:%.*]] = load [[INT]], [[INT]]* @_T016class_resilience33ClassWithResilientlySizedPropertyC5colors5Int32VvpWvd
// CHECK-NEXT: [[PTR:%.*]] = bitcast %T16class_resilience33ClassWithResilientlySizedPropertyC* %0 to i8*
// CHECK-NEXT: [[FIELD_ADDR:%.*]] = getelementptr inbounds i8, i8* [[PTR]], [[INT]] [[OFFSET]]
// CHECK-NEXT: [[FIELD_PTR:%.*]] = bitcast i8* [[FIELD_ADDR]] to %Ts5Int32V*
@@ -176,7 +176,7 @@
// ClassWithIndirectResilientEnum.color getter
-// CHECK-LABEL: define{{( protected)?}} swiftcc i32 @_T016class_resilience30ClassWithIndirectResilientEnumC5colors5Int32Vfg(%T16class_resilience30ClassWithIndirectResilientEnumC* swiftself)
+// CHECK-LABEL: define{{( protected)?}} swiftcc i32 @_T016class_resilience30ClassWithIndirectResilientEnumC5colors5Int32Vvg(%T16class_resilience30ClassWithIndirectResilientEnumC* swiftself)
// CHECK: [[FIELD_PTR:%.*]] = getelementptr inbounds %T16class_resilience30ClassWithIndirectResilientEnumC, %T16class_resilience30ClassWithIndirectResilientEnumC* %0, i32 0, i32 2
// CHECK: call void @swift_beginAccess
// CHECK-NEXT: [[FIELD_PAYLOAD:%.*]] = getelementptr inbounds %Ts5Int32V, %Ts5Int32V* [[FIELD_PTR]], i32 0, i32 0
@@ -187,8 +187,8 @@
// ResilientChild.field getter
-// CHECK-LABEL: define{{( protected)?}} swiftcc i32 @_T016class_resilience14ResilientChildC5fields5Int32Vfg(%T16class_resilience14ResilientChildC* swiftself)
-// CHECK: [[OFFSET:%.*]] = load [[INT]], [[INT]]* @_T016class_resilience14ResilientChildC5fields5Int32VvWvd
+// CHECK-LABEL: define{{( protected)?}} swiftcc i32 @_T016class_resilience14ResilientChildC5fields5Int32Vvg(%T16class_resilience14ResilientChildC* swiftself)
+// CHECK: [[OFFSET:%.*]] = load [[INT]], [[INT]]* @_T016class_resilience14ResilientChildC5fields5Int32VvpWvd
// CHECK-NEXT: [[PTR:%.*]] = bitcast %T16class_resilience14ResilientChildC* %0 to i8*
// CHECK-NEXT: [[FIELD_ADDR:%.*]] = getelementptr inbounds i8, i8* [[PTR]], [[INT]] [[OFFSET]]
// CHECK-NEXT: [[FIELD_PTR:%.*]] = bitcast i8* [[FIELD_ADDR]] to %Ts5Int32V*
@@ -202,7 +202,7 @@
// ResilientGenericChild.field getter
-// CHECK-LABEL: define{{( protected)?}} swiftcc i32 @_T016class_resilience21ResilientGenericChildC5fields5Int32Vfg(%T16class_resilience21ResilientGenericChildC* swiftself)
+// CHECK-LABEL: define{{( protected)?}} swiftcc i32 @_T016class_resilience21ResilientGenericChildC5fields5Int32Vvg(%T16class_resilience21ResilientGenericChildC* swiftself)
// FIXME: we could eliminate the unnecessary isa load by lazily emitting
// metadata sources in EmitPolymorphicParameters
@@ -211,7 +211,7 @@
// CHECK-NEXT: [[ADDR:%.*]] = getelementptr inbounds %T16class_resilience21ResilientGenericChildC, %T16class_resilience21ResilientGenericChildC* %0, i32 0, i32 0, i32 0
// CHECK-NEXT: [[ISA:%.*]] = load %swift.type*, %swift.type** [[ADDR]]
-// CHECK-NEXT: [[INDIRECT_OFFSET:%.*]] = load [[INT]], [[INT]]* @_T016class_resilience21ResilientGenericChildC5fields5Int32VvWvi
+// CHECK-NEXT: [[INDIRECT_OFFSET:%.*]] = load [[INT]], [[INT]]* @_T016class_resilience21ResilientGenericChildC5fields5Int32VvpWvi
// CHECK-NEXT: [[ISA_ADDR:%.*]] = bitcast %swift.type* [[ISA]] to i8*
// CHECK-NEXT: [[FIELD_OFFSET_TMP:%.*]] = getelementptr inbounds i8, i8* [[ISA_ADDR]], [[INT]] [[INDIRECT_OFFSET]]
// CHECK-NEXT: [[FIELD_OFFSET_ADDR:%.*]] = bitcast i8* [[FIELD_OFFSET_TMP]] to [[INT]]*
@@ -228,7 +228,7 @@
// MyResilientChild.field getter
-// CHECK-LABEL: define{{( protected)?}} swiftcc i32 @_T016class_resilience16MyResilientChildC5fields5Int32Vfg(%T16class_resilience16MyResilientChildC* swiftself)
+// CHECK-LABEL: define{{( protected)?}} swiftcc i32 @_T016class_resilience16MyResilientChildC5fields5Int32Vvg(%T16class_resilience16MyResilientChildC* swiftself)
// CHECK: [[FIELD_ADDR:%.*]] = getelementptr inbounds %T16class_resilience16MyResilientChildC, %T16class_resilience16MyResilientChildC* %0, i32 0, i32 2
// CHECK: call void @swift_beginAccess
// CHECK-NEXT: [[PAYLOAD_ADDR:%.*]] = getelementptr inbounds %Ts5Int32V, %Ts5Int32V* [[FIELD_ADDR]], i32 0, i32 0
diff --git a/test/IRGen/class_resilience_objc.swift b/test/IRGen/class_resilience_objc.swift
index 3f16a86..83f1619 100644
--- a/test/IRGen/class_resilience_objc.swift
+++ b/test/IRGen/class_resilience_objc.swift
@@ -14,7 +14,7 @@
};
// CHECK-LABEL: define hidden swiftcc void @_T021class_resilience_objc29testConstantDirectFieldAccessyAA23FixedLayoutObjCSubclassCF(%T21class_resilience_objc23FixedLayoutObjCSubclassC*)
-// CHECK: [[OFFSET:%.*]] = load [[INT]], [[INT]]* @_T021class_resilience_objc23FixedLayoutObjCSubclassC5fields5Int32VvWvd
+// CHECK: [[OFFSET:%.*]] = load [[INT]], [[INT]]* @_T021class_resilience_objc23FixedLayoutObjCSubclassC5fields5Int32VvpWvd
// CHECK-NEXT: [[OBJECT:%.*]] = bitcast %T21class_resilience_objc23FixedLayoutObjCSubclassC* %0 to i8*
// CHECK-NEXT: [[ADDR:%.*]] = getelementptr inbounds i8, i8* [[OBJECT]], [[INT]] [[OFFSET]]
// CHECK-NEXT: [[FIELD_ADDR:%.*]] = bitcast i8* [[ADDR]] to %Ts5Int32V*
@@ -33,7 +33,7 @@
}
// CHECK-LABEL: define hidden swiftcc void @_T021class_resilience_objc32testNonConstantDirectFieldAccessyAA0E23FixedLayoutObjCSubclassCF(%T21class_resilience_objc26NonFixedLayoutObjCSubclassC*)
-// CHECK: [[OFFSET:%.*]] = load [[INT]], [[INT]]* @_T021class_resilience_objc26NonFixedLayoutObjCSubclassC5fields5Int32VvWvd
+// CHECK: [[OFFSET:%.*]] = load [[INT]], [[INT]]* @_T021class_resilience_objc26NonFixedLayoutObjCSubclassC5fields5Int32VvpWvd
// CHECK-NEXT: [[OBJECT:%.*]] = bitcast %T21class_resilience_objc26NonFixedLayoutObjCSubclassC* %0 to i8*
// CHECK-NEXT: [[ADDR:%.*]] = getelementptr inbounds i8, i8* [[OBJECT]], [[INT]] [[OFFSET]]
// CHECK-NEXT: [[FIELD_ADDR:%.*]] = bitcast i8* [[ADDR]] to %Ts5Int32V*
diff --git a/test/IRGen/dllexport.swift b/test/IRGen/dllexport.swift
index 416ef22..1b496e7 100644
--- a/test/IRGen/dllexport.swift
+++ b/test/IRGen/dllexport.swift
@@ -24,7 +24,7 @@
}
}
-// CHECK-DAG: @_T09dllexport2ciAA1cCv = dllexport global %T9dllexport1cC* null, align 4
+// CHECK-DAG: @_T09dllexport2ciAA1cCvp = dllexport global %T9dllexport1cC* null, align 4
// CHECK-DAG: @_T09dllexport1pMp = dllexport constant %swift.protocol
// CHECK-DAG: @_T09dllexport1cCMn = dllexport constant
// CHECK-DAG: @_T09dllexport1cCN = dllexport alias %swift.type
@@ -36,7 +36,7 @@
// CHECK-DAG: define dllexport swiftcc %swift.refcounted* @_T09dllexport1cCfd(%T9dllexport1cC*{{.*}})
// CHECK-DAG-NO-OPT: define dllexport swiftcc %T9dllexport1cC* @_T09dllexport1cCACycfc(%T9dllexport1cC*)
// CHECK-DAG-NO-OPT: define dllexport swiftcc %T9dllexport1cC* @_T09dllexport1cCACycfC(%swift.type*)
-// CHECK-DAG: define dllexport swiftcc i8* @_T09dllexport2ciAA1cCfau()
+// CHECK-DAG: define dllexport swiftcc i8* @_T09dllexport2ciAA1cCvau()
// CHECK-DAG-NO-OPT: define dllexport swiftcc void @_T09dllexport1dC1m33_C57BA610BA35E21738CC992438E660E9LLyyF(%T9dllexport1dC*)
// CHECK-DAG-NO-OPT: define dllexport swiftcc void @_T09dllexport1dCfD(%T9dllexport1dC*)
// CHECK-DAG: define dllexport swiftcc %swift.refcounted* @_T09dllexport1dCfd(%T9dllexport1dC*{{.*}})
diff --git a/test/IRGen/dllimport.swift b/test/IRGen/dllimport.swift
index 1f41371..a7e0300 100644
--- a/test/IRGen/dllimport.swift
+++ b/test/IRGen/dllimport.swift
@@ -46,7 +46,7 @@
// CHECK-NO-OPT-DAG: @_T09dllexport1pMp = external dllimport global %swift.protocol
// CHECK-NO-OPT-DAG: @_T0ytN = external dllimport global %swift.full_type
// CHECK-NO-OPT-DAG: @_T0BoWV = external dllimport global i8*
-// CHECK-NO-OPT-DAG: declare dllimport swiftcc i8* @_T09dllexport2ciAA1cCfau()
+// CHECK-NO-OPT-DAG: declare dllimport swiftcc i8* @_T09dllexport2ciAA1cCvau()
// CHECK-NO-OPT-DAG: declare dllimport swiftcc %swift.refcounted* @_T09dllexport1cCfd(%T9dllexport1cC* swiftself)
// CHECK-NO-OPT-DAG: declare dllimport %swift.type* @_T09dllexport1cCMa()
// CHECK-NO-OPT-DAG: declare dllimport void @swift_deallocClassInstance(%swift.refcounted*, i32, i32)
@@ -61,7 +61,7 @@
// CHECK-OPT-DAG: @_T09dllexport1pMp = external dllimport global %swift.protocol
// CHECK-OPT-DAG: @_swift_slowAlloc = external dllimport local_unnamed_addr global i8* (i32, i32)*
// CHECK-OPT-DAG: @_swift_slowDealloc = external dllimport local_unnamed_addr global void (i8*, i32, i32)*
-// CHECK-OPT-DAG: declare dllimport swiftcc i8* @_T09dllexport2ciAA1cCfau()
+// CHECK-OPT-DAG: declare dllimport swiftcc i8* @_T09dllexport2ciAA1cCvau()
// CHECK-OPT-DAG: declare dllimport %swift.type* @_T09dllexport1cCMa()
// CHECK-OPT-DAG: declare dllimport void @swift_deallocClassInstance(%swift.refcounted*, i32, i32)
// CHECK-OPT-DAG: declare dllimport swiftcc %swift.refcounted* @_T09dllexport1cCfd(%T9dllexport1cC* swiftself)
diff --git a/test/IRGen/dynamic_lookup.sil b/test/IRGen/dynamic_lookup.sil
index bcfa4d8..a955f73 100644
--- a/test/IRGen/dynamic_lookup.sil
+++ b/test/IRGen/dynamic_lookup.sil
@@ -30,7 +30,7 @@
return %14 : $()
}
-sil @_T014dynamic_lookup1XC9subscriptS2icfgTo : $@convention(objc_method) (Int, X) -> Int {
+sil @_T014dynamic_lookup1XCS2icigTo : $@convention(objc_method) (Int, X) -> Int {
bb0(%0 : $Int, %1 : $X):
%4 = function_ref @_T0Si33_convertFromBuiltinIntegerLiteralSiBi64_3val_tcSimF : $@convention(thin) (Builtin.Int64, @thin Int.Type) -> Int // user: %7
%5 = metatype $@thin Int.Type
@@ -42,7 +42,7 @@
sil @_T0Si33_convertFromBuiltinIntegerLiteralSiBi64_3val_tcSimF : $@convention(thin) (Builtin.Int64, @thin Int.Type) -> Int
// [objc] dynamic_lookup.X.value.getter : Swift.Int
-sil @_T014dynamic_lookup1XC5valueSifgTo : $@convention(objc_method) (X) -> Int {
+sil @_T014dynamic_lookup1XC5valueSivgTo : $@convention(objc_method) (X) -> Int {
bb0(%0 : $X):
%4 = function_ref @_T0Si33_convertFromBuiltinIntegerLiteralSiBi64_3val_tcSimF : $@convention(thin) (Builtin.Int64, @thin Int.Type) -> Int // user: %7
%5 = metatype $@thin Int.Type
diff --git a/test/IRGen/enum_derived.swift b/test/IRGen/enum_derived.swift
index c9d3d69..a607e65 100644
--- a/test/IRGen/enum_derived.swift
+++ b/test/IRGen/enum_derived.swift
@@ -24,8 +24,8 @@
// Check if the hashValue getter can be compiled to a simple zext instruction.
-// CHECK-NORMAL-LABEL:define hidden swiftcc i{{.*}} @_T012enum_derived1EO9hashValueSifg(i8)
-// CHECK-TESTABLE-LABEL:define{{( protected)?}} swiftcc i{{.*}} @_T012enum_derived1EO9hashValueSifg(i8)
+// CHECK-NORMAL-LABEL:define hidden swiftcc i{{.*}} @_T012enum_derived1EO9hashValueSivg(i8)
+// CHECK-TESTABLE-LABEL:define{{( protected)?}} swiftcc i{{.*}} @_T012enum_derived1EO9hashValueSivg(i8)
// CHECK: [[R:%.*]] = zext i8 %0 to i{{.*}}
// CHECK: ret i{{.*}} [[R]]
@@ -36,8 +36,8 @@
extension def_enum.Term : Error {}
-// CHECK-NORMAL-LABEL: define hidden {{.*}}i64 @_T012enum_derived7PhantomO8rawValues5Int64Vfg(i8, %swift.type* nocapture readnone %T) local_unnamed_addr
-// CHECK-TESTABLE-LABEL: define{{( protected)?}} {{.*}}i64 @_T012enum_derived7PhantomO8rawValues5Int64Vfg(i8, %swift.type* nocapture readnone %T)
+// CHECK-NORMAL-LABEL: define hidden {{.*}}i64 @_T012enum_derived7PhantomO8rawValues5Int64Vvg(i8, %swift.type* nocapture readnone %T) local_unnamed_addr
+// CHECK-TESTABLE-LABEL: define{{( protected)?}} {{.*}}i64 @_T012enum_derived7PhantomO8rawValues5Int64Vvg(i8, %swift.type* nocapture readnone %T)
enum Phantom<T> : Int64 {
case Up
diff --git a/test/IRGen/generic_classes.sil b/test/IRGen/generic_classes.sil
index 0a23db0..8d06249 100644
--- a/test/IRGen/generic_classes.sil
+++ b/test/IRGen/generic_classes.sil
@@ -49,9 +49,9 @@
// -- Check that offset vars are emitted for fixed-layout generics
// <rdar://problem/15081049>
-// CHECK: @_T015generic_classes22RootGenericFixedLayoutC1xs5UInt8VvWvd = hidden constant i64 16, align 8
-// CHECK: @_T015generic_classes22RootGenericFixedLayoutC1ySayxGvWvd = hidden constant i64 24, align 8
-// CHECK: @_T015generic_classes22RootGenericFixedLayoutC1zs5UInt8VvWvd = hidden constant i64 32, align 8
+// CHECK: @_T015generic_classes22RootGenericFixedLayoutC1xs5UInt8VvpWvd = hidden constant i64 16, align 8
+// CHECK: @_T015generic_classes22RootGenericFixedLayoutC1ySayxGvpWvd = hidden constant i64 24, align 8
+// CHECK: @_T015generic_classes22RootGenericFixedLayoutC1zs5UInt8VvpWvd = hidden constant i64 32, align 8
// -- fixed-layout nongeneric descriptor
// FIXME: Strings should be unnamed_addr. rdar://problem/22674524
diff --git a/test/IRGen/globals.swift b/test/IRGen/globals.swift
index de9c770..102df69 100644
--- a/test/IRGen/globals.swift
+++ b/test/IRGen/globals.swift
@@ -40,20 +40,20 @@
// CHECK-NOT: TY8
// CHECK-NOT: TY9
-// CHECK: @_T07globals2g0Siv = hidden global [[INT]] zeroinitializer, align 8
-// CHECK: @_T07globals2g1yt_Siyttv = hidden global <{ [[INT]] }> zeroinitializer, align 8
-// CHECK: @_T07globals2g2yt_S2itv = hidden global <{ [[INT]], [[INT]] }> zeroinitializer, align 8
-// CHECK: @_T07globals2g3Sbv = hidden global [[BOOL]] zeroinitializer, align 1
-// CHECK: @_T07globals2g6Sdv = hidden global [[DOUBLE]] zeroinitializer, align 8
-// CHECK: @_T07globals2g7Sfv = hidden global [[FLOAT]] zeroinitializer, align 4
-// CHECK: @_T07globals1AV3fooSivZ = hidden global [[INT]] zeroinitializer, align 8
+// CHECK: @_T07globals2g0Sivp = hidden global [[INT]] zeroinitializer, align 8
+// CHECK: @_T07globals2g1yt_Siyttvp = hidden global <{ [[INT]] }> zeroinitializer, align 8
+// CHECK: @_T07globals2g2yt_S2itvp = hidden global <{ [[INT]], [[INT]] }> zeroinitializer, align 8
+// CHECK: @_T07globals2g3Sbvp = hidden global [[BOOL]] zeroinitializer, align 1
+// CHECK: @_T07globals2g6Sdvp = hidden global [[DOUBLE]] zeroinitializer, align 8
+// CHECK: @_T07globals2g7Sfvp = hidden global [[FLOAT]] zeroinitializer, align 4
+// CHECK: @_T07globals1AV3fooSivpZ = hidden global [[INT]] zeroinitializer, align 8
// CHECK-NOT: g8
// CHECK-NOT: g9
// CHECK: define{{( protected)?}} i32 @main(i32, i8**) {{.*}} {
-// CHECK: store i64 {{.*}}, i64* getelementptr inbounds ([[INT]], [[INT]]* @_T07globals2g0Siv, i32 0, i32 0), align 8
+// CHECK: store i64 {{.*}}, i64* getelementptr inbounds ([[INT]], [[INT]]* @_T07globals2g0Sivp, i32 0, i32 0), align 8
// FIXME: give these initializers a real mangled name
// CHECK: define internal swiftcc void @globalinit_{{.*}}func0() {{.*}} {
-// CHECK: store i64 5, i64* getelementptr inbounds (%TSi, %TSi* @_T07globals1AV3fooSivZ, i32 0, i32 0), align 8
+// CHECK: store i64 5, i64* getelementptr inbounds (%TSi, %TSi* @_T07globals1AV3fooSivpZ, i32 0, i32 0), align 8
diff --git a/test/IRGen/keypaths_objc.sil b/test/IRGen/keypaths_objc.sil
index 8ec51e2..c66756f 100644
--- a/test/IRGen/keypaths_objc.sil
+++ b/test/IRGen/keypaths_objc.sil
@@ -22,7 +22,7 @@
// CHECK: [[KEYPATH_B:@keypath.*]] = private global
// -- 0x5ffffffd: class stored property with indirect offset
// CHECK-SAME: i32 1610612733,
-// CHECK-SAME: @_T013keypaths_objc1CC6storedSivWvd
+// CHECK-SAME: @_T013keypaths_objc1CC6storedSivpWvd
// CHECK-LABEL: define swiftcc void @objc_only_property()
sil @objc_only_property : $@convention(thin) () -> () {
@@ -32,7 +32,7 @@
unreachable
}
-sil hidden @_T013keypaths_objc1CC1xSo8NSStringCfgTo : $@convention(objc_method) (@guaranteed C) -> NSString {
+sil hidden @_T013keypaths_objc1CC1xSo8NSStringCvgTo : $@convention(objc_method) (@guaranteed C) -> NSString {
entry(%0 : $C):
unreachable
}
diff --git a/test/IRGen/lazy_globals.swift b/test/IRGen/lazy_globals.swift
index a24b5d8..3354abc 100644
--- a/test/IRGen/lazy_globals.swift
+++ b/test/IRGen/lazy_globals.swift
@@ -3,40 +3,40 @@
// REQUIRES: CPU=x86_64
// CHECK: @globalinit_[[T:.*]]_token0 = internal global i64 0, align 8
-// CHECK: @_T012lazy_globals1xSiv = hidden global %TSi zeroinitializer, align 8
-// CHECK: @_T012lazy_globals1ySiv = hidden global %TSi zeroinitializer, align 8
-// CHECK: @_T012lazy_globals1zSiv = hidden global %TSi zeroinitializer, align 8
+// CHECK: @_T012lazy_globals1xSivp = hidden global %TSi zeroinitializer, align 8
+// CHECK: @_T012lazy_globals1ySivp = hidden global %TSi zeroinitializer, align 8
+// CHECK: @_T012lazy_globals1zSivp = hidden global %TSi zeroinitializer, align 8
// CHECK: define internal swiftcc void @globalinit_[[T]]_func0() {{.*}} {
// CHECK: entry:
-// CHECK: store i64 1, i64* getelementptr inbounds (%TSi, %TSi* @_T012lazy_globals1xSiv, i32 0, i32 0), align 8
-// CHECK: store i64 2, i64* getelementptr inbounds (%TSi, %TSi* @_T012lazy_globals1ySiv, i32 0, i32 0), align 8
-// CHECK: store i64 3, i64* getelementptr inbounds (%TSi, %TSi* @_T012lazy_globals1zSiv, i32 0, i32 0), align 8
+// CHECK: store i64 1, i64* getelementptr inbounds (%TSi, %TSi* @_T012lazy_globals1xSivp, i32 0, i32 0), align 8
+// CHECK: store i64 2, i64* getelementptr inbounds (%TSi, %TSi* @_T012lazy_globals1ySivp, i32 0, i32 0), align 8
+// CHECK: store i64 3, i64* getelementptr inbounds (%TSi, %TSi* @_T012lazy_globals1zSivp, i32 0, i32 0), align 8
// CHECK: ret void
// CHECK: }
-// CHECK: define hidden swiftcc i8* @_T012lazy_globals1xSifau() {{.*}} {
+// CHECK: define hidden swiftcc i8* @_T012lazy_globals1xSivau() {{.*}} {
// CHECK: entry:
// CHECK: call void @swift_once(i64* @globalinit_[[T]]_token0, i8* bitcast (void ()* @globalinit_[[T]]_func0 to i8*), i8* undef)
-// CHECK: ret i8* bitcast (%TSi* @_T012lazy_globals1xSiv to i8*)
+// CHECK: ret i8* bitcast (%TSi* @_T012lazy_globals1xSivp to i8*)
// CHECK: }
-// CHECK: define hidden swiftcc i8* @_T012lazy_globals1ySifau() {{.*}} {
+// CHECK: define hidden swiftcc i8* @_T012lazy_globals1ySivau() {{.*}} {
// CHECK: entry:
// CHECK: call void @swift_once(i64* @globalinit_[[T]]_token0, i8* bitcast (void ()* @globalinit_[[T]]_func0 to i8*), i8* undef)
-// CHECK: ret i8* bitcast (%TSi* @_T012lazy_globals1ySiv to i8*)
+// CHECK: ret i8* bitcast (%TSi* @_T012lazy_globals1ySivp to i8*)
// CHECK: }
-// CHECK: define hidden swiftcc i8* @_T012lazy_globals1zSifau() {{.*}} {
+// CHECK: define hidden swiftcc i8* @_T012lazy_globals1zSivau() {{.*}} {
// CHECK: entry:
// CHECK: call void @swift_once(i64* @globalinit_[[T]]_token0, i8* bitcast (void ()* @globalinit_[[T]]_func0 to i8*), i8* undef)
-// CHECK: ret i8* bitcast (%TSi* @_T012lazy_globals1zSiv to i8*)
+// CHECK: ret i8* bitcast (%TSi* @_T012lazy_globals1zSivp to i8*)
// CHECK: }
var (x, y, z) = (1, 2, 3)
// CHECK: define hidden swiftcc i64 @_T012lazy_globals4getXSiyF() {{.*}} {
// CHECK: entry:
-// CHECK: %0 = call swiftcc i8* @_T012lazy_globals1xSifau()
+// CHECK: %0 = call swiftcc i8* @_T012lazy_globals1xSivau()
// CHECK: %1 = bitcast i8* %0 to %TSi*
// CHECK: %._value = getelementptr inbounds %TSi, %TSi* %1, i32 0, i32 0
// CHECK: [[V:%.*]] = load i64, i64* %._value, align 8
diff --git a/test/IRGen/local_types.swift b/test/IRGen/local_types.swift
index 0049936..b54fbe6 100644
--- a/test/IRGen/local_types.swift
+++ b/test/IRGen/local_types.swift
@@ -16,7 +16,7 @@
}
public let singleClosure: () -> () = {
- // CHECK-DAG: @_T011local_types13singleClosureyycvfiyycfU_06SingleD6StructL_VWV = internal constant
+ // CHECK-DAG: @_T011local_types13singleClosureyycvpfiyycfU_06SingleD6StructL_VWV = internal constant
struct SingleClosureStruct {
let i: Int
}
@@ -24,7 +24,7 @@
public struct PatternStruct {
public var singlePattern: Int = ({
- // CHECK-DAG: @_T011local_types13PatternStructV06singleC0SivfiSiycfU_06SinglecD0L_VWV = internal constant
+ // CHECK-DAG: @_T011local_types13PatternStructV06singleC0SivpfiSiycfU_06SinglecD0L_VWV = internal constant
struct SinglePatternStruct {
let i: Int
}
diff --git a/test/IRGen/objc_bridge.swift b/test/IRGen/objc_bridge.swift
index 1f60e3c..f357d04 100644
--- a/test/IRGen/objc_bridge.swift
+++ b/test/IRGen/objc_bridge.swift
@@ -18,42 +18,42 @@
// CHECK: { i8*, i8*, i8* } {
// CHECK: i8* getelementptr inbounds ([12 x i8], [12 x i8]* @"\01L_selector_data(strRealProp)", i64 0, i64 0),
// CHECK: i8* getelementptr inbounds ([8 x i8], [8 x i8]* [[GETTER_SIGNATURE]], i64 0, i64 0),
-// CHECK: i8* bitcast ([[OPAQUE:.*]]* ([[OPAQUE:.*]]*, i8*)* @_T011objc_bridge3BasC11strRealPropSSfgTo to i8*)
+// CHECK: i8* bitcast ([[OPAQUE:.*]]* ([[OPAQUE:.*]]*, i8*)* @_T011objc_bridge3BasC11strRealPropSSvgTo to i8*)
// CHECK: },
// CHECK: { i8*, i8*, i8* } {
// CHECK: i8* getelementptr inbounds ([16 x i8], [16 x i8]* @"\01L_selector_data(setStrRealProp:)", i64 0, i64 0),
// CHECK: i8* getelementptr inbounds ([11 x i8], [11 x i8]* [[SETTER_SIGNATURE]], i64 0, i64 0),
-// CHECK: i8* bitcast (void ([[OPAQUE:.*]]*, i8*, [[OPAQUE:.*]]*)* @_T011objc_bridge3BasC11strRealPropSSfsTo to i8*)
+// CHECK: i8* bitcast (void ([[OPAQUE:.*]]*, i8*, [[OPAQUE:.*]]*)* @_T011objc_bridge3BasC11strRealPropSSvsTo to i8*)
// CHECK: },
// CHECK: { i8*, i8*, i8* } {
// CHECK: i8* getelementptr inbounds ([12 x i8], [12 x i8]* @"\01L_selector_data(strFakeProp)", i64 0, i64 0),
// CHECK: i8* getelementptr inbounds ([8 x i8], [8 x i8]* [[GETTER_SIGNATURE]], i64 0, i64 0),
-// CHECK: i8* bitcast ([[OPAQUE:.*]]* ([[OPAQUE:.*]]*, i8*)* @_T011objc_bridge3BasC11strFakePropSSfgTo to i8*)
+// CHECK: i8* bitcast ([[OPAQUE:.*]]* ([[OPAQUE:.*]]*, i8*)* @_T011objc_bridge3BasC11strFakePropSSvgTo to i8*)
// CHECK: },
// CHECK: { i8*, i8*, i8* } {
// CHECK: i8* getelementptr inbounds ([16 x i8], [16 x i8]* @"\01L_selector_data(setStrFakeProp:)", i64 0, i64 0),
// CHECK: i8* getelementptr inbounds ([11 x i8], [11 x i8]* [[SETTER_SIGNATURE]], i64 0, i64 0),
-// CHECK: i8* bitcast (void ([[OPAQUE:.*]]*, i8*, [[OPAQUE:.*]]*)* @_T011objc_bridge3BasC11strFakePropSSfsTo to i8*)
+// CHECK: i8* bitcast (void ([[OPAQUE:.*]]*, i8*, [[OPAQUE:.*]]*)* @_T011objc_bridge3BasC11strFakePropSSvsTo to i8*)
// CHECK: },
// CHECK: { i8*, i8*, i8* } {
// CHECK: i8* getelementptr inbounds ([14 x i8], [14 x i8]* @"\01L_selector_data(nsstrRealProp)", i64 0, i64 0),
// CHECK: i8* getelementptr inbounds ([8 x i8], [8 x i8]* [[GETTER_SIGNATURE]], i64 0, i64 0),
-// CHECK: i8* bitcast ([[OPAQUE:.*]]* ([[OPAQUE:.*]]*, i8*)* @_T011objc_bridge3BasC13nsstrRealPropSo8NSStringCfgTo to i8*)
+// CHECK: i8* bitcast ([[OPAQUE:.*]]* ([[OPAQUE:.*]]*, i8*)* @_T011objc_bridge3BasC13nsstrRealPropSo8NSStringCvgTo to i8*)
// CHECK: },
// CHECK: { i8*, i8*, i8* } {
// CHECK: i8* getelementptr inbounds ([18 x i8], [18 x i8]* @"\01L_selector_data(setNsstrRealProp:)", i64 0, i64 0),
// CHECK: i8* getelementptr inbounds ([11 x i8], [11 x i8]* [[SETTER_SIGNATURE]], i64 0, i64 0),
-// CHECK: i8* bitcast (void ([[OPAQUE:.*]]*, i8*, [[OPAQUE:.*]]*)* @_T011objc_bridge3BasC13nsstrRealPropSo8NSStringCfsTo to i8*)
+// CHECK: i8* bitcast (void ([[OPAQUE:.*]]*, i8*, [[OPAQUE:.*]]*)* @_T011objc_bridge3BasC13nsstrRealPropSo8NSStringCvsTo to i8*)
// CHECK: },
// CHECK: { i8*, i8*, i8* } {
// CHECK: i8* getelementptr inbounds ([14 x i8], [14 x i8]* @"\01L_selector_data(nsstrFakeProp)", i64 0, i64 0),
// CHECK: i8* getelementptr inbounds ([8 x i8], [8 x i8]* [[GETTER_SIGNATURE]], i64 0, i64 0),
-// CHECK: i8* bitcast ([[OPAQUE:.*]]* ([[OPAQUE:.*]]*, i8*)* @_T011objc_bridge3BasC13nsstrFakePropSo8NSStringCfgTo to i8*)
+// CHECK: i8* bitcast ([[OPAQUE:.*]]* ([[OPAQUE:.*]]*, i8*)* @_T011objc_bridge3BasC13nsstrFakePropSo8NSStringCvgTo to i8*)
// CHECK: },
// CHECK: { i8*, i8*, i8* } {
// CHECK: i8* getelementptr inbounds ([18 x i8], [18 x i8]* @"\01L_selector_data(setNsstrFakeProp:)", i64 0, i64 0),
// CHECK: i8* getelementptr inbounds ([11 x i8], [11 x i8]* [[SETTER_SIGNATURE]], i64 0, i64 0),
-// CHECK: i8* bitcast (void ([[OPAQUE:.*]]*, i8*, [[OPAQUE:.*]]*)* @_T011objc_bridge3BasC13nsstrFakePropSo8NSStringCfsTo to i8*)
+// CHECK: i8* bitcast (void ([[OPAQUE:.*]]*, i8*, [[OPAQUE:.*]]*)* @_T011objc_bridge3BasC13nsstrFakePropSo8NSStringCvsTo to i8*)
// CHECK: },
// CHECK: { i8*, i8*, i8* } {
// CHECK: i8* getelementptr inbounds ([10 x i8], [10 x i8]* @"\01L_selector_data(strResult)", i64 0, i64 0),
@@ -130,8 +130,8 @@
// -- NSString methods don't convert 'self'
extension NSString {
- // CHECK: define internal [[OPAQUE:.*]]* @_T0So8NSStringC11objc_bridgeE13nsstrFakePropABfgTo([[OPAQUE:.*]]*, i8*) unnamed_addr
- // CHECK: define internal void @_T0So8NSStringC11objc_bridgeE13nsstrFakePropABfsTo([[OPAQUE:.*]]*, i8*, [[OPAQUE:.*]]*) unnamed_addr
+ // CHECK: define internal [[OPAQUE:.*]]* @_T0So8NSStringC11objc_bridgeE13nsstrFakePropABvgTo([[OPAQUE:.*]]*, i8*) unnamed_addr
+ // CHECK: define internal void @_T0So8NSStringC11objc_bridgeE13nsstrFakePropABvsTo([[OPAQUE:.*]]*, i8*, [[OPAQUE:.*]]*) unnamed_addr
var nsstrFakeProp : NSString {
get {
return NSS
@@ -147,12 +147,12 @@
}
class Bas : NSObject {
- // CHECK: define internal [[OPAQUE:.*]]* @_T011objc_bridge3BasC11strRealPropSSfgTo([[OPAQUE:.*]]*, i8*) unnamed_addr {{.*}} {
- // CHECK: define internal void @_T011objc_bridge3BasC11strRealPropSSfsTo([[OPAQUE:.*]]*, i8*, [[OPAQUE:.*]]*) unnamed_addr {{.*}} {
+ // CHECK: define internal [[OPAQUE:.*]]* @_T011objc_bridge3BasC11strRealPropSSvgTo([[OPAQUE:.*]]*, i8*) unnamed_addr {{.*}} {
+ // CHECK: define internal void @_T011objc_bridge3BasC11strRealPropSSvsTo([[OPAQUE:.*]]*, i8*, [[OPAQUE:.*]]*) unnamed_addr {{.*}} {
var strRealProp : String
- // CHECK: define internal [[OPAQUE:.*]]* @_T011objc_bridge3BasC11strFakePropSSfgTo([[OPAQUE:.*]]*, i8*) unnamed_addr {{.*}} {
- // CHECK: define internal void @_T011objc_bridge3BasC11strFakePropSSfsTo([[OPAQUE:.*]]*, i8*, [[OPAQUE:.*]]*) unnamed_addr {{.*}} {
+ // CHECK: define internal [[OPAQUE:.*]]* @_T011objc_bridge3BasC11strFakePropSSvgTo([[OPAQUE:.*]]*, i8*) unnamed_addr {{.*}} {
+ // CHECK: define internal void @_T011objc_bridge3BasC11strFakePropSSvsTo([[OPAQUE:.*]]*, i8*, [[OPAQUE:.*]]*) unnamed_addr {{.*}} {
var strFakeProp : String {
get {
return ""
@@ -160,12 +160,12 @@
set {}
}
- // CHECK: define internal [[OPAQUE:.*]]* @_T011objc_bridge3BasC13nsstrRealPropSo8NSStringCfgTo([[OPAQUE:.*]]*, i8*) unnamed_addr {{.*}} {
- // CHECK: define internal void @_T011objc_bridge3BasC13nsstrRealPropSo8NSStringCfsTo([[OPAQUE:.*]]*, i8*, [[OPAQUE:.*]]*) unnamed_addr {{.*}} {
+ // CHECK: define internal [[OPAQUE:.*]]* @_T011objc_bridge3BasC13nsstrRealPropSo8NSStringCvgTo([[OPAQUE:.*]]*, i8*) unnamed_addr {{.*}} {
+ // CHECK: define internal void @_T011objc_bridge3BasC13nsstrRealPropSo8NSStringCvsTo([[OPAQUE:.*]]*, i8*, [[OPAQUE:.*]]*) unnamed_addr {{.*}} {
var nsstrRealProp : NSString
- // CHECK: define hidden swiftcc %TSo8NSStringC* @_T011objc_bridge3BasC13nsstrFakePropSo8NSStringCfg(%T11objc_bridge3BasC* swiftself) {{.*}} {
- // CHECK: define internal void @_T011objc_bridge3BasC13nsstrFakePropSo8NSStringCfsTo([[OPAQUE:.*]]*, i8*, [[OPAQUE:.*]]*) unnamed_addr {{.*}} {
+ // CHECK: define hidden swiftcc %TSo8NSStringC* @_T011objc_bridge3BasC13nsstrFakePropSo8NSStringCvg(%T11objc_bridge3BasC* swiftself) {{.*}} {
+ // CHECK: define internal void @_T011objc_bridge3BasC13nsstrFakePropSo8NSStringCvsTo([[OPAQUE:.*]]*, i8*, [[OPAQUE:.*]]*) unnamed_addr {{.*}} {
var nsstrFakeProp : NSString {
get {
return NSS
diff --git a/test/IRGen/objc_class_in_storage_decls.swift b/test/IRGen/objc_class_in_storage_decls.swift
new file mode 100644
index 0000000..b7d3253
--- /dev/null
+++ b/test/IRGen/objc_class_in_storage_decls.swift
@@ -0,0 +1,51 @@
+// RUN: %target-swift-frontend -emit-ir -disable-objc-attr-requires-foundation-module %s | %FileCheck %s
+
+// REQUIRES: objc_interop
+
+struct WrapperStruct {
+ subscript() -> Void {
+ unsafeAddress {
+ // CHECK: @_METACLASS_DATA__TtCFV27objc_class_in_storage_decls13WrapperStructlu9subscriptFT_T_L_31ClassInSubscriptUnsafeAddressor
+ @objc class ClassInSubscriptUnsafeAddressor {}
+ fatalError()
+ }
+ unsafeMutableAddress {
+ // CHECK: @_METACLASS_DATA__TtCFV27objc_class_in_storage_decls13WrapperStructau9subscriptFT_T_L_38ClassInSubscriptUnsafeMutableAddressor
+ @objc class ClassInSubscriptUnsafeMutableAddressor {}
+ fatalError()
+ }
+ }
+
+ subscript(x: Void) -> Void {
+ get {
+ // CHECK: @_METACLASS_DATA__TtCFV27objc_class_in_storage_decls13WrapperStructg9subscriptFTT__T_L_22ClassInSubscriptGetter
+ @objc class ClassInSubscriptGetter {}
+ }
+ set {
+ // CHECK: @_METACLASS_DATA__TtCFV27objc_class_in_storage_decls13WrapperStructs9subscriptFTT__T_L_22ClassInSubscriptSetter
+ @objc class ClassInSubscriptSetter {}
+ }
+ }
+
+ private subscript(privateSubscript x: Void) -> Void {
+ // CHECK: @_METACLASS_DATA__TtCFV27objc_class_in_storage_decls13WrapperStructgP33_B60F3A889B72E7873A11885C46E5DF289subscriptFT16privateSubscriptT__T_L_23ClassInPrivateSubscript
+ @objc class ClassInPrivateSubscript {}
+ }
+
+ var foo: Void {
+ get {
+ // CHECK: @_METACLASS_DATA__TtCFV27objc_class_in_storage_decls13WrapperStructg3fooT_L_21ClassInVariableGetter
+ @objc class ClassInVariableGetter {}
+ }
+ set {
+ // CHECK: @_METACLASS_DATA__TtCFV27objc_class_in_storage_decls13WrapperStructs3fooT_L_21ClassInVariableSetter
+ @objc class ClassInVariableSetter {}
+ }
+ }
+
+ private var privateVariable: Void {
+ // CHECK: @_METACLASS_DATA__TtCFV27objc_class_in_storage_decls13WrapperStructgP33_B60F3A889B72E7873A11885C46E5DF2815privateVariableT_L_22ClassInPrivateVariable
+ @objc class ClassInPrivateVariable {}
+ }
+}
+
diff --git a/test/IRGen/objc_dealloc.sil b/test/IRGen/objc_dealloc.sil
index 85a4fe7..f0cccc8 100644
--- a/test/IRGen/objc_dealloc.sil
+++ b/test/IRGen/objc_dealloc.sil
@@ -86,7 +86,7 @@
// Destroy instance variables
// FIXME: This should move to .cxx_destruct
- // CHECK: [[XOFFSET:%[a-zA-Z0-9]+]] = load i64, i64* @_T012objc_dealloc10SwiftGizmoC1xAA1XCvWvd, align 8
+ // CHECK: [[XOFFSET:%[a-zA-Z0-9]+]] = load i64, i64* @_T012objc_dealloc10SwiftGizmoC1xAA1XCvpWvd, align 8
// CHECK-NEXT: bitcast
// CHECK-NEXT: [[IVAR_ADDR:%[a-zA-Z0-9]+]] = getelementptr inbounds i8, i8* {{.*}}, i64 [[XOFFSET]]
// CHECK-NEXT: [[XADDR:%[.a-zA-Z0-9]+]] = bitcast i8* [[IVAR_ADDR]] to %T12objc_dealloc1XC**
diff --git a/test/IRGen/objc_ns_enum.swift b/test/IRGen/objc_ns_enum.swift
index ab3dc74..43a76b6 100644
--- a/test/IRGen/objc_ns_enum.swift
+++ b/test/IRGen/objc_ns_enum.swift
@@ -120,8 +120,8 @@
// CHECK: define internal i64 @_T012objc_ns_enum15ObjCEnumMethodsC0C3OutAA010ExportedToD1COyFTo([[OBJC_ENUM_METHODS]]*, i8*)
dynamic func enumOut() -> ExportedToObjC { return .Foo }
- // CHECK: define internal i64 @_T012objc_ns_enum15ObjCEnumMethodsC4propAA010ExportedToD1COfgTo([[OBJC_ENUM_METHODS]]*, i8*)
- // CHECK: define internal void @_T012objc_ns_enum15ObjCEnumMethodsC4propAA010ExportedToD1COfsTo([[OBJC_ENUM_METHODS]]*, i8*, i64)
+ // CHECK: define internal i64 @_T012objc_ns_enum15ObjCEnumMethodsC4propAA010ExportedToD1COvgTo([[OBJC_ENUM_METHODS]]*, i8*)
+ // CHECK: define internal void @_T012objc_ns_enum15ObjCEnumMethodsC4propAA010ExportedToD1COvsTo([[OBJC_ENUM_METHODS]]*, i8*, i64)
dynamic var prop: ExportedToObjC = .Foo
}
diff --git a/test/IRGen/objc_properties.swift b/test/IRGen/objc_properties.swift
index 98066de..63a2f09 100644
--- a/test/IRGen/objc_properties.swift
+++ b/test/IRGen/objc_properties.swift
@@ -107,31 +107,31 @@
// CHECK: [8 x { i8*, i8*, i8* }] [{
// CHECK: i8* getelementptr inbounds ([9 x i8], [9 x i8]* @"\01L_selector_data(readonly)", i64 0, i64 0),
// CHECK: i8* getelementptr inbounds ([8 x i8], [8 x i8]* [[GETTER_SIGNATURE]], i64 0, i64 0),
-// CHECK: i8* bitcast ([[OPAQUE0:%.*]]* ([[OPAQUE1:%.*]]*, i8*)* @_T015objc_properties10SomeObjectC8readonlyACfgTo to i8*)
+// CHECK: i8* bitcast ([[OPAQUE0:%.*]]* ([[OPAQUE1:%.*]]*, i8*)* @_T015objc_properties10SomeObjectC8readonlyACvgTo to i8*)
// CHECK: }, {
// CHECK: i8* getelementptr inbounds ([10 x i8], [10 x i8]* @"\01L_selector_data(readwrite)", i64 0, i64 0),
// CHECK: i8* getelementptr inbounds ([8 x i8], [8 x i8]* [[GETTER_SIGNATURE]], i64 0, i64 0),
-// CHECK: i8* bitcast ([[OPAQUE0]]* ([[OPAQUE1]]*, i8*)* @_T015objc_properties10SomeObjectC9readwriteACfgTo to i8*)
+// CHECK: i8* bitcast ([[OPAQUE0]]* ([[OPAQUE1]]*, i8*)* @_T015objc_properties10SomeObjectC9readwriteACvgTo to i8*)
// CHECK: }, {
// CHECK: i8* getelementptr inbounds ([14 x i8], [14 x i8]* @"\01L_selector_data(setReadwrite:)", i64 0, i64 0),
// CHECK: i8* getelementptr inbounds ([11 x i8], [11 x i8]* [[SETTER_SIGNATURE]], i64 0, i64 0),
-// CHECK: i8* bitcast (void ([[OPAQUE3:%.*]]*, i8*, [[OPAQUE4:%.*]]*)* @_T015objc_properties10SomeObjectC9readwriteACfsTo to i8*)
+// CHECK: i8* bitcast (void ([[OPAQUE3:%.*]]*, i8*, [[OPAQUE4:%.*]]*)* @_T015objc_properties10SomeObjectC9readwriteACvsTo to i8*)
// CHECK: }, {
// CHECK: i8* getelementptr inbounds ([9 x i8], [9 x i8]* @"\01L_selector_data(bareIvar)", i64 0, i64 0),
// CHECK: i8* getelementptr inbounds ([8 x i8], [8 x i8]* [[GETTER_SIGNATURE]], i64 0, i64 0),
-// CHECK: i8* bitcast ([[OPAQUE0]]* ([[OPAQUE1]]*, i8*)* @_T015objc_properties10SomeObjectC8bareIvarACfgTo to i8*)
+// CHECK: i8* bitcast ([[OPAQUE0]]* ([[OPAQUE1]]*, i8*)* @_T015objc_properties10SomeObjectC8bareIvarACvgTo to i8*)
// CHECK: }, {
// CHECK: i8* getelementptr inbounds ([13 x i8], [13 x i8]* @"\01L_selector_data(setBareIvar:)", i64 0, i64 0),
// CHECK: i8* getelementptr inbounds ([11 x i8], [11 x i8]* [[SETTER_SIGNATURE]], i64 0, i64 0),
-// CHECK: i8* bitcast (void ([[OPAQUE3]]*, i8*, [[OPAQUE4]]*)* @_T015objc_properties10SomeObjectC8bareIvarACfsTo to i8*)
+// CHECK: i8* bitcast (void ([[OPAQUE3]]*, i8*, [[OPAQUE4]]*)* @_T015objc_properties10SomeObjectC8bareIvarACvsTo to i8*)
// CHECK: }, {
// CHECK: i8* getelementptr inbounds ([7 x i8], [7 x i8]* @"\01L_selector_data(wobble)", i64 0, i64 0),
// CHECK: i8* getelementptr inbounds ([8 x i8], [8 x i8]* [[GETTER_SIGNATURE]], i64 0, i64 0),
-// CHECK: i8* bitcast (%0* (%0*, i8*)* @_T015objc_properties10SomeObjectC6wibbleACfgTo to i8*)
+// CHECK: i8* bitcast (%0* (%0*, i8*)* @_T015objc_properties10SomeObjectC6wibbleACvgTo to i8*)
// CHECK: }, {
// CHECK: i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"\01L_selector_data(setWobble:)", i64 0, i64 0),
// CHECK: i8* getelementptr inbounds ([11 x i8], [11 x i8]* [[SETTER_SIGNATURE]], i64 0, i64 0),
-// CHECK: i8* bitcast (void (%0*, i8*, %0*)* @_T015objc_properties10SomeObjectC6wibbleACfsTo to i8*)
+// CHECK: i8* bitcast (void (%0*, i8*, %0*)* @_T015objc_properties10SomeObjectC6wibbleACvsTo to i8*)
// CHECK: }, {
// CHECK: i8* getelementptr inbounds ([5 x i8], [5 x i8]* @"\01L_selector_data(init)", i64 0, i64 0),
// CHECK: i8* getelementptr inbounds ([8 x i8], [8 x i8]* [[GETTER_SIGNATURE]], i64 0, i64 0),
@@ -188,11 +188,11 @@
// CHECK: [2 x { i8*, i8*, i8* }] [{
// CHECK: { i8* getelementptr inbounds ([18 x i8], [18 x i8]* @"\01L_selector_data(extensionProperty)", i64 0, i64 0),
// CHECK: i8* getelementptr inbounds ([8 x i8], [8 x i8]* [[GETTER_SIGNATURE]], i64 0, i64 0),
-// CHECK: i8* bitcast ([[OPAQUE0]]* ([[OPAQUE1]]*, i8*)* @_T015objc_properties10SomeObjectC17extensionPropertyACfgTo to i8*)
+// CHECK: i8* bitcast ([[OPAQUE0]]* ([[OPAQUE1]]*, i8*)* @_T015objc_properties10SomeObjectC17extensionPropertyACvgTo to i8*)
// CHECK: }, {
// CHECK: i8* getelementptr inbounds ([22 x i8], [22 x i8]* @"\01L_selector_data(setExtensionProperty:)", i64 0, i64 0),
// CHECK: i8* getelementptr inbounds ([11 x i8], [11 x i8]* [[SETTER_SIGNATURE]], i64 0, i64 0),
-// CHECK: i8* bitcast (void ([[OPAQUE3]]*, i8*, [[OPAQUE4]]*)* @_T015objc_properties10SomeObjectC17extensionPropertyACfsTo to i8*)
+// CHECK: i8* bitcast (void ([[OPAQUE3]]*, i8*, [[OPAQUE4]]*)* @_T015objc_properties10SomeObjectC17extensionPropertyACvsTo to i8*)
// CHECK: }]
// CHECK: }, section "__DATA, __objc_const", align 8
@@ -235,10 +235,10 @@
// CHECK: @_INSTANCE_METHODS__TtC15objc_properties4Tree =
// CHECK: i8* getelementptr inbounds ([7 x i8], [7 x i8]* @"\01L_selector_data(parent)", i64 0, i64 0),
// CHECK: i8* getelementptr inbounds ([8 x i8], [8 x i8]* [[GETTER_SIGNATURE]], i64 0, i64 0),
-// CHECK: i8* bitcast (%2* (%2*, i8*)* @_T015objc_properties4TreeC6parentACSgXwfgTo to i8*)
+// CHECK: i8* bitcast (%2* (%2*, i8*)* @_T015objc_properties4TreeC6parentACSgXwvgTo to i8*)
// CHECK: i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"\01L_selector_data(setParent:)", i64 0, i64 0),
// CHECK: i8* getelementptr inbounds ([11 x i8], [11 x i8]* [[SETTER_SIGNATURE]], i64 0, i64 0),
-// CHECK: i8* bitcast (void (%2*, i8*, %2*)* @_T015objc_properties4TreeC6parentACSgXwfsTo to i8*)
+// CHECK: i8* bitcast (void (%2*, i8*, %2*)* @_T015objc_properties4TreeC6parentACSgXwvsTo to i8*)
// CHECK: @_PROTOCOL__TtP15objc_properties5Proto_ = private constant { {{.+}} } {
// CHECK: i8* null,
diff --git a/test/IRGen/objc_subclass.swift b/test/IRGen/objc_subclass.swift
index 602c56f..7984556 100644
--- a/test/IRGen/objc_subclass.swift
+++ b/test/IRGen/objc_subclass.swift
@@ -12,8 +12,8 @@
// CHECK: [[GIZMO:%TSo5GizmoC]] = type opaque
// CHECK: [[OBJC:%objc_object]] = type opaque
-// CHECK-32: @_T013objc_subclass10SwiftGizmoC1xSivWvd = hidden global i32 4, align [[WORD_SIZE_IN_BYTES:4]]
-// CHECK-64: @_T013objc_subclass10SwiftGizmoC1xSivWvd = hidden global i64 8, align [[WORD_SIZE_IN_BYTES:8]]
+// CHECK-32: @_T013objc_subclass10SwiftGizmoC1xSivpWvd = hidden global i32 4, align [[WORD_SIZE_IN_BYTES:4]]
+// CHECK-64: @_T013objc_subclass10SwiftGizmoC1xSivpWvd = hidden global i64 8, align [[WORD_SIZE_IN_BYTES:8]]
// CHECK: @"OBJC_METACLASS_$__TtC13objc_subclass10SwiftGizmo" = hidden global [[OBJC_CLASS]] { [[OBJC_CLASS]]* @"OBJC_METACLASS_$_NSObject", [[OBJC_CLASS]]* @"OBJC_METACLASS_$_Gizmo", [[OPAQUE]]* @_objc_empty_cache, [[OPAQUE]]* null, [[LLVM_PTRSIZE_INT]] ptrtoint ({{.*}} @_METACLASS_DATA__TtC13objc_subclass10SwiftGizmo to [[LLVM_PTRSIZE_INT]]) }
// CHECK: [[STRING_SWIFTGIZMO:@.*]] = private unnamed_addr constant [32 x i8] c"_TtC13objc_subclass10SwiftGizmo\00"
@@ -62,11 +62,11 @@
// CHECK-32: [11 x { i8*, i8*, i8* }] [{ i8*, i8*, i8* } {
// CHECK-32: i8* getelementptr inbounds ([2 x i8], [2 x i8]* @"\01L_selector_data(x)", i32 0, i32 0),
// CHECK-32: i8* getelementptr inbounds ([7 x i8], [7 x i8]* [[METHOD_TYPE_ENCODING1]], i32 0, i32 0),
-// CHECK-32: i8* bitcast (i32 (%0*, i8*)* @_T013objc_subclass10SwiftGizmoC1xSifgTo to i8*)
+// CHECK-32: i8* bitcast (i32 (%0*, i8*)* @_T013objc_subclass10SwiftGizmoC1xSivgTo to i8*)
// CHECK-32: }, { i8*, i8*, i8* } {
// CHECK-32: i8* getelementptr inbounds ([6 x i8], [6 x i8]* @"\01L_selector_data(setX:)", i32 0, i32 0),
// CHECK-32: i8* getelementptr inbounds ([10 x i8], [10 x i8]* [[METHOD_TYPE_ENCODING2]], i32 0, i32 0),
-// CHECK-32: i8* bitcast (void (%0*, i8*, i32)* @_T013objc_subclass10SwiftGizmoC1xSifsTo to i8*)
+// CHECK-32: i8* bitcast (void (%0*, i8*, i32)* @_T013objc_subclass10SwiftGizmoC1xSivsTo to i8*)
// CHECK-32: }, { i8*, i8*, i8* } {
// CHECK-32: i8* getelementptr inbounds ([5 x i8], [5 x i8]* @"\01L_selector_data(getX)", i32 0, i32 0),
// CHECK-32: i8* getelementptr inbounds ([7 x i8], [7 x i8]* [[METHOD_TYPE_ENCODING1]], i32 0, i32 0),
@@ -90,11 +90,11 @@
// CHECK-32: }, { i8*, i8*, i8* } {
// CHECK-32: i8* getelementptr inbounds ([10 x i8], [10 x i8]* @"\01L_selector_data(isEnabled)", i32 0, i32 0),
// CHECK-32: i8* getelementptr inbounds ([7 x i8], [7 x i8]* {{@[0-9]+}}, i32 0, i32 0),
-// CHECK-32: i8* bitcast ({{(i8|i1)}} (%0*, i8*)* @_T013objc_subclass10SwiftGizmoC7enabledSbfgTo to i8*)
+// CHECK-32: i8* bitcast ({{(i8|i1)}} (%0*, i8*)* @_T013objc_subclass10SwiftGizmoC7enabledSbvgTo to i8*)
// CHECK-32: }, { i8*, i8*, i8* } {
// CHECK-32: i8* getelementptr inbounds ([14 x i8], [14 x i8]* @"\01L_selector_data(setIsEnabled:)", i32 0, i32 0),
// CHECK-32: i8* getelementptr inbounds ([10 x i8], [10 x i8]* {{@[0-9]+}}, i32 0, i32 0),
-// CHECK-32: i8* bitcast (void (%0*, i8*, {{(i8|i1)}})* @_T013objc_subclass10SwiftGizmoC7enabledSbfsTo to i8*)
+// CHECK-32: i8* bitcast (void (%0*, i8*, {{(i8|i1)}})* @_T013objc_subclass10SwiftGizmoC7enabledSbvsTo to i8*)
// CHECK-32: }, { i8*, i8*, i8* } {
// CHECK-32: i8* getelementptr inbounds ([17 x i8], [17 x i8]* @"\01L_selector_data(initWithBellsOn:)", i32 0, i32 0),
// CHECK-32: i8* getelementptr inbounds ([10 x i8], [10 x i8]* {{@[0-9]+}}, i32 0, i32 0),
@@ -112,11 +112,11 @@
// CHECK-64: [11 x { i8*, i8*, i8* }] [{
// CHECK-64: i8* getelementptr inbounds ([2 x i8], [2 x i8]* @"\01L_selector_data(x)", i64 0, i64 0),
// CHECK-64: i8* getelementptr inbounds ([8 x i8], [8 x i8]* [[METHOD_TYPE_ENCODING1]], i64 0, i64 0)
-// CHECK-64: i8* bitcast (i64 ([[OPAQUE2:%.*]]*, i8*)* @_T013objc_subclass10SwiftGizmoC1xSifgTo to i8*)
+// CHECK-64: i8* bitcast (i64 ([[OPAQUE2:%.*]]*, i8*)* @_T013objc_subclass10SwiftGizmoC1xSivgTo to i8*)
// CHECK-64: }, {
// CHECK-64: i8* getelementptr inbounds ([6 x i8], [6 x i8]* @"\01L_selector_data(setX:)", i64 0, i64 0),
// CHECK-64: i8* getelementptr inbounds ([11 x i8], [11 x i8]* [[METHOD_TYPE_ENCODING2]], i64 0, i64 0)
-// CHECK-64: i8* bitcast (void ([[OPAQUE3:%.*]]*, i8*, i64)* @_T013objc_subclass10SwiftGizmoC1xSifsTo to i8*)
+// CHECK-64: i8* bitcast (void ([[OPAQUE3:%.*]]*, i8*, i64)* @_T013objc_subclass10SwiftGizmoC1xSivsTo to i8*)
// CHECK-64: }, {
// CHECK-64: i8* getelementptr inbounds ([5 x i8], [5 x i8]* @"\01L_selector_data(getX)", i64 0, i64 0),
// CHECK-64: i8* getelementptr inbounds ([8 x i8], [8 x i8]* [[METHOD_TYPE_ENCODING1]], i64 0, i64 0)
@@ -140,11 +140,11 @@
// CHECK-64: }, {
// CHECK-64: i8* getelementptr inbounds ([10 x i8], [10 x i8]* @"\01L_selector_data(isEnabled)", i64 0, i64 0),
// CHECK-64: i8* getelementptr inbounds ([8 x i8], [8 x i8]* {{@[0-9]+}}, i64 0, i64 0),
-// CHECK-64: i8* bitcast ({{(i8|i1)}} ([[OPAQUE11:%.*]]*, i8*)* @_T013objc_subclass10SwiftGizmoC7enabledSbfgTo to i8*)
+// CHECK-64: i8* bitcast ({{(i8|i1)}} ([[OPAQUE11:%.*]]*, i8*)* @_T013objc_subclass10SwiftGizmoC7enabledSbvgTo to i8*)
// CHECK-64: }, {
// CHECK-64: i8* getelementptr inbounds ([14 x i8], [14 x i8]* @"\01L_selector_data(setIsEnabled:)", i64 0, i64 0),
// CHECK-64: i8* getelementptr inbounds ([11 x i8], [11 x i8]* {{@[0-9]+}}, i64 0, i64 0),
-// CHECK-64: i8* bitcast (void ([[OPAQUE12:%.*]]*, i8*, {{(i8|i1)}})* @_T013objc_subclass10SwiftGizmoC7enabledSbfsTo to i8*)
+// CHECK-64: i8* bitcast (void ([[OPAQUE12:%.*]]*, i8*, {{(i8|i1)}})* @_T013objc_subclass10SwiftGizmoC7enabledSbvsTo to i8*)
// CHECK-64: }, {
// CHECK-64: i8* getelementptr inbounds ([17 x i8], [17 x i8]* @"\01L_selector_data(initWithBellsOn:)", i64 0, i64 0),
// CHECK-64: i8* getelementptr inbounds ([11 x i8], [11 x i8]* {{@[0-9]+}}, i64 0, i64 0),
@@ -163,7 +163,7 @@
// CHECK-32: i32 20,
// CHECK-32: i32 1,
// CHECK-32: [1 x { i32*, i8*, i8*, i32, i32 }] [{ i32*, i8*, i8*, i32, i32 } {
-// CHECK-32: i32* @_T013objc_subclass10SwiftGizmoC1xSivWvd,
+// CHECK-32: i32* @_T013objc_subclass10SwiftGizmoC1xSivpWvd,
// CHECK-32: i8* getelementptr inbounds ([2 x i8], [2 x i8]* [[STRING_X]], i32 0, i32 0),
// CHECK-32: i8* getelementptr inbounds ([1 x i8], [1 x i8]* [[STRING_EMPTY]], i32 0, i32 0),
// CHECK-32: i32 2,
@@ -174,7 +174,7 @@
// CHECK-64: i32 32,
// CHECK-64: i32 1,
// CHECK-64: [1 x { i64*, i8*, i8*, i32, i32 }] [{ i64*, i8*, i8*, i32, i32 } {
-// CHECK-64: i64* @_T013objc_subclass10SwiftGizmoC1xSivWvd,
+// CHECK-64: i64* @_T013objc_subclass10SwiftGizmoC1xSivpWvd,
// CHECK-64: i8* getelementptr inbounds ([2 x i8], [2 x i8]* [[STRING_X]], i64 0, i64 0),
// CHECK-64: i8* getelementptr inbounds ([1 x i8], [1 x i8]* [[STRING_EMPTY]], i64 0, i64 0),
// CHECK-64: i32 3,
@@ -222,11 +222,11 @@
// CHECK-32: {
// CHECK-32: i8* getelementptr inbounds ([3 x i8], [3 x i8]* @"\01L_selector_data(sg)", i32 0, i32 0),
// CHECK-32: i8* getelementptr inbounds ([7 x i8], [7 x i8]* [[GETTER_ENCODING]], i32 0, i32 0),
-// CHECK-32: i8* bitcast (%0* (%3*, i8*)* @_T013objc_subclass11SwiftGizmo2C2sgAA0C5GizmoCfgTo to i8*)
+// CHECK-32: i8* bitcast (%0* (%3*, i8*)* @_T013objc_subclass11SwiftGizmo2C2sgAA0C5GizmoCvgTo to i8*)
// CHECK-32: }, {
// CHECK-32: i8* getelementptr inbounds ([7 x i8], [7 x i8]* @"\01L_selector_data(setSg:)", i32 0, i32 0),
// CHECK-32: i8* getelementptr inbounds ([10 x i8], [10 x i8]* [[SETTER_ENCODING]], i32 0, i32 0),
-// CHECK-32: i8* bitcast (void (%3*, i8*, %0*)* @_T013objc_subclass11SwiftGizmo2C2sgAA0C5GizmoCfsTo to i8*)
+// CHECK-32: i8* bitcast (void (%3*, i8*, %0*)* @_T013objc_subclass11SwiftGizmo2C2sgAA0C5GizmoCvsTo to i8*)
// CHECK-32: }, {
// CHECK-32: i8* getelementptr inbounds ([5 x i8], [5 x i8]* @"\01L_selector_data(init)", i32 0, i32 0),
// CHECK-32: i8* getelementptr inbounds ([7 x i8], [7 x i8]* [[GETTER_ENCODING]], i32 0, i32 0),
@@ -250,11 +250,11 @@
// CHECK-64: {
// CHECK-64: i8* getelementptr inbounds ([3 x i8], [3 x i8]* @"\01L_selector_data(sg)", i64 0, i64 0),
// CHECK-64: i8* getelementptr inbounds ([8 x i8], [8 x i8]* [[GETTER_ENCODING]], i64 0, i64 0),
-// CHECK-64: i8* bitcast ([[OPAQUE13:%.*]]* ([[OPAQUE14:%.*]]*, i8*)* @_T013objc_subclass11SwiftGizmo2C2sgAA0C5GizmoCfgTo to i8*)
+// CHECK-64: i8* bitcast ([[OPAQUE13:%.*]]* ([[OPAQUE14:%.*]]*, i8*)* @_T013objc_subclass11SwiftGizmo2C2sgAA0C5GizmoCvgTo to i8*)
// CHECK-64: }, {
// CHECK-64: i8* getelementptr inbounds ([7 x i8], [7 x i8]* @"\01L_selector_data(setSg:)", i64 0, i64 0),
// CHECK-64: i8* getelementptr inbounds ([11 x i8], [11 x i8]* [[SETTER_ENCODING]], i64 0, i64 0),
-// CHECK-64: i8* bitcast (void ([[OPAQUE15:%.*]]*, i8*, [[OPAQUE16:%.*]]*)* @_T013objc_subclass11SwiftGizmo2C2sgAA0C5GizmoCfsTo to i8*)
+// CHECK-64: i8* bitcast (void ([[OPAQUE15:%.*]]*, i8*, [[OPAQUE16:%.*]]*)* @_T013objc_subclass11SwiftGizmo2C2sgAA0C5GizmoCvsTo to i8*)
// CHECK-64: }, {
// CHECK-64: i8* getelementptr inbounds ([5 x i8], [5 x i8]* @"\01L_selector_data(init)", i64 0, i64 0),
// CHECK-64: i8* getelementptr inbounds ([8 x i8], [8 x i8]* [[GETTER_ENCODING]], i64 0, i64 0),
@@ -319,7 +319,7 @@
var array : [T] = []
}
-// CHECK: define hidden swiftcc [[LLVM_PTRSIZE_INT]] @_T013objc_subclass12GenericGizmoC1xSifg(
+// CHECK: define hidden swiftcc [[LLVM_PTRSIZE_INT]] @_T013objc_subclass12GenericGizmoC1xSivg(
var sg = SwiftGizmo()
sg.duplicate()
diff --git a/test/IRGen/objc_subscripts.swift b/test/IRGen/objc_subscripts.swift
index 6352501..4e48a93 100644
--- a/test/IRGen/objc_subscripts.swift
+++ b/test/IRGen/objc_subscripts.swift
@@ -11,25 +11,25 @@
// CHECK: {
// CHECK: i8* getelementptr inbounds ([26 x i8], [26 x i8]* @"\01L_selector_data(objectAtIndexedSubscript:)", i64 0, i64 0),
// CHECK: i8* null,
-// CHECK: i8* bitcast ([[OPAQUE0:%.*]]* ([[OPAQUE1:%.*]]*, i8*, i64)* @_T015objc_subscripts10SomeObjectC9subscriptACSicfgTo to i8*)
+// CHECK: i8* bitcast ([[OPAQUE0:%.*]]* ([[OPAQUE1:%.*]]*, i8*, i64)* @_T015objc_subscripts10SomeObjectCACSicigTo to i8*)
// CHECK: },
// CHECK: { i8*, i8*, i8* }
// CHECK: {
// CHECK: i8* getelementptr inbounds ([30 x i8], [30 x i8]* @"\01L_selector_data(setObject:atIndexedSubscript:)", i64 0, i64 0),
// CHECK: i8* null,
-// CHECK: i8* bitcast (void ([[OPAQUE2:%.*]]*, i8*, [[OPAQUE3:%.*]]*, i64)* @_T015objc_subscripts10SomeObjectC9subscriptACSicfsTo to i8*)
+// CHECK: i8* bitcast (void ([[OPAQUE2:%.*]]*, i8*, [[OPAQUE3:%.*]]*, i64)* @_T015objc_subscripts10SomeObjectCACSicisTo to i8*)
// CHECK: },
// CHECK: { i8*, i8*, i8* }
// CHECK: {
// CHECK: i8* getelementptr inbounds ([25 x i8], [25 x i8]* @"\01L_selector_data(objectForKeyedSubscript:)", i64 0, i64 0),
// CHECK: i8* null,
-// CHECK: i8* bitcast (i64 ([[OPAQUE4:%.*]]*, i8*, [[OPAQUE5:%.*]]*)* @_T015objc_subscripts10SomeObjectC9subscriptSiACcfgTo to i8*)
+// CHECK: i8* bitcast (i64 ([[OPAQUE4:%.*]]*, i8*, [[OPAQUE5:%.*]]*)* @_T015objc_subscripts10SomeObjectCSiACcigTo to i8*)
// CHECK: },
// CHECK: { i8*, i8*, i8* }
// CHECK: {
// CHECK: i8* getelementptr inbounds ([29 x i8], [29 x i8]* @"\01L_selector_data(setObject:forKeyedSubscript:)", i64 0, i64 0),
// CHECK: i8* null,
-// CHECK: i8* bitcast (void ([[OPAQUE6:%.*]]*, i8*, i64, [[OPAQUE7:%.*]]*)* @_T015objc_subscripts10SomeObjectC9subscriptSiACcfsTo to i8*)
+// CHECK: i8* bitcast (void ([[OPAQUE6:%.*]]*, i8*, i64, [[OPAQUE7:%.*]]*)* @_T015objc_subscripts10SomeObjectCSiACcisTo to i8*)
// CHECK: },
// CHECK: { i8*, i8*, i8* }
// CHECK: { i8* getelementptr inbounds ([5 x i8], [5 x i8]* @"\01L_selector_data(init)", i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @{{[0-9]+}}, i64 0, i64 0), i8* bitcast ([[OPAQUE8:%.*]]* ([[OPAQUE9:%.*]]*, i8*)* @_T015objc_subscripts10SomeObjectCACycfcTo to i8*) }
@@ -38,28 +38,28 @@
@objc class SomeObject {
subscript (i : Int) -> SomeObject {
- // CHECK: define internal [[OPAQUE0:%.*]]* @_T015objc_subscripts10SomeObjectC9subscriptACSicfgTo([[OPAQUE1]]*, i8*, i64) unnamed_addr
+ // CHECK: define internal [[OPAQUE0:%.*]]* @_T015objc_subscripts10SomeObjectCACSicigTo([[OPAQUE1]]*, i8*, i64) unnamed_addr
get {
- // CHECK: call swiftcc %T15objc_subscripts10SomeObjectC* @_T015objc_subscripts10SomeObjectC9subscriptACSicfg
+ // CHECK: call swiftcc %T15objc_subscripts10SomeObjectC* @_T015objc_subscripts10SomeObjectCACSicig
return self
}
- // CHECK-LABEL: define internal void @_T015objc_subscripts10SomeObjectC9subscriptACSicfsTo
+ // CHECK-LABEL: define internal void @_T015objc_subscripts10SomeObjectCACSicisTo
set {
- // CHECK: swiftcc void @_T015objc_subscripts10SomeObjectC9subscriptACSicfs
+ // CHECK: swiftcc void @_T015objc_subscripts10SomeObjectCACSicis
}
}
subscript (s : SomeObject) -> Int {
- // CHECK-LABEL: define internal i64 @_T015objc_subscripts10SomeObjectC9subscriptSiACcfgTo
+ // CHECK-LABEL: define internal i64 @_T015objc_subscripts10SomeObjectCSiACcigTo
get {
- // CHECK: call swiftcc i64 @_T015objc_subscripts10SomeObjectC9subscriptSiACcfg
+ // CHECK: call swiftcc i64 @_T015objc_subscripts10SomeObjectCSiACcig
return 5
}
- // CHECK-LABEL: define internal void @_T015objc_subscripts10SomeObjectC9subscriptSiACcfsTo
+ // CHECK-LABEL: define internal void @_T015objc_subscripts10SomeObjectCSiACcisTo
set {
- // CHECK: call swiftcc void @_T015objc_subscripts10SomeObjectC9subscriptSiACcfs
+ // CHECK: call swiftcc void @_T015objc_subscripts10SomeObjectCSiACcis
}
}
}
diff --git a/test/IRGen/objc_super.swift b/test/IRGen/objc_super.swift
index 67da81e..af050e2 100644
--- a/test/IRGen/objc_super.swift
+++ b/test/IRGen/objc_super.swift
@@ -87,7 +87,7 @@
// Use a constant indirect field access instead of a non-constant direct
// access because the layout dependents on the alignment of y.
-// CHECK: define hidden swiftcc i64 @_T010objc_super13GenericRuncerC1xSo5GizmoCSgfg(%T10objc_super13GenericRuncerC* swiftself)
+// CHECK: define hidden swiftcc i64 @_T010objc_super13GenericRuncerC1xSo5GizmoCSgvg(%T10objc_super13GenericRuncerC* swiftself)
// CHECK: inttoptr
// CHECK: [[CAST:%.*]] = bitcast %T10objc_super13GenericRuncerC* %0 to i64*
// CHECK: [[ISA:%.*]] = load i64, i64* [[CAST]]
diff --git a/test/IRGen/pic.swift b/test/IRGen/pic.swift
index 606290f..710a6dd 100644
--- a/test/IRGen/pic.swift
+++ b/test/IRGen/pic.swift
@@ -12,41 +12,41 @@
}
// x86_64-LABEL: __T04main10use_globalSiyF:
-// x86_64: movq __T04main6globalSiv(%rip), %rax
+// x86_64: movq __T04main6globalSivp(%rip), %rax
// i386-LABEL: __T04main10use_globalSiyF:
// i386: [[PIC_BLOCK:^L.*\$pb]]:{{$}}
// i386: popl [[PIC_REG:%[a-z]+]]
-// i386: movl __T04main6globalSiv-[[PIC_BLOCK]]([[PIC_REG]]), {{%[a-z]+}}
+// i386: movl __T04main6globalSivp-[[PIC_BLOCK]]([[PIC_REG]]), {{%[a-z]+}}
// armv7-LABEL: __T04main10use_globalSiyF:
// Check for the runtime memory enforcement call. The global address may be
// materialized in a different register prior to that call.
// armv7: bl _swift_beginAccess
-// armv7: movw [[R_ADR:r.*]], :lower16:(__T04main6globalSiv-([[PIC_0:L.*]]+4))
-// armv7: movt [[R_ADR]], :upper16:(__T04main6globalSiv-([[PIC_0]]+4))
+// armv7: movw [[R_ADR:r.*]], :lower16:(__T04main6globalSivp-([[PIC_0:L.*]]+4))
+// armv7: movt [[R_ADR]], :upper16:(__T04main6globalSivp-([[PIC_0]]+4))
// armv7: [[PIC_0]]:{{$}}
// armv7: add [[R_ADR]], pc
// armv7: ldr [[R_ADR]], {{\[}}[[R_ADR]]{{\]}}
// armv7s-LABEL: __T04main10use_globalSiyF:
// armv7s: bl _swift_beginAccess
-// armv7s: movw [[R_ADR:r.*]], :lower16:(__T04main6globalSiv-([[PIC_0:L.*]]+4))
-// armv7s: movt [[R_ADR]], :upper16:(__T04main6globalSiv-([[PIC_0]]+4))
+// armv7s: movw [[R_ADR:r.*]], :lower16:(__T04main6globalSivp-([[PIC_0:L.*]]+4))
+// armv7s: movt [[R_ADR]], :upper16:(__T04main6globalSivp-([[PIC_0]]+4))
// armv7s: [[PIC_0]]:{{$}}
// armv7s: add [[R_ADR]], pc
// armv7s: ldr [[R_ADR]], {{\[}}[[R_ADR]]{{\]}}
// armv7k-LABEL: __T04main10use_globalSiyF:
// armv7k: bl _swift_beginAccess
-// armv7k: movw [[R_ADR:r.*]], :lower16:(__T04main6globalSiv-([[PIC_0:L.*]]+4))
-// armv7k: movt [[R_ADR]], :upper16:(__T04main6globalSiv-([[PIC_0]]+4))
+// armv7k: movw [[R_ADR:r.*]], :lower16:(__T04main6globalSivp-([[PIC_0:L.*]]+4))
+// armv7k: movt [[R_ADR]], :upper16:(__T04main6globalSivp-([[PIC_0]]+4))
// armv7k: [[PIC_0]]:{{$}}
// armv7k: add [[R_ADR]], pc
// armv7k: ldr [[R_ADR]], {{\[}}[[R_ADR]]{{\]}}
// arm64-LABEL: __T04main10use_globalSiyF:
// arm64: bl _swift_beginAccess
-// arm64: adrp [[REG1:x[0-9]+]], __T04main6globalSiv@PAGE
-// arm64: add [[REG2:x[0-9]+]], [[REG1]], __T04main6globalSiv@PAGEOFF
+// arm64: adrp [[REG1:x[0-9]+]], __T04main6globalSivp@PAGE
+// arm64: add [[REG2:x[0-9]+]], [[REG1]], __T04main6globalSivp@PAGEOFF
// arm64: ldr {{x[0-9]+}}, {{\[}}[[REG2]]{{\]}}
diff --git a/test/IRGen/rdar15304329.swift b/test/IRGen/rdar15304329.swift
index 93ca00d..2a44bbb 100644
--- a/test/IRGen/rdar15304329.swift
+++ b/test/IRGen/rdar15304329.swift
@@ -5,7 +5,7 @@
// REQUIRES: objc_interop
// CHECK-NOT: @_TWvi{{.*}}
-// CHECK: _T012rdar153043293BarC3fooAA3FooVySiGvWvd
+// CHECK: _T012rdar153043293BarC3fooAA3FooVySiGvpWvd
// CHECK-NOT: @_TWvi{{.*}}
import Foundation
diff --git a/test/IRGen/struct_resilience.swift b/test/IRGen/struct_resilience.swift
index 4c915df..5614f63 100644
--- a/test/IRGen/struct_resilience.swift
+++ b/test/IRGen/struct_resilience.swift
@@ -113,7 +113,7 @@
// resilient layout, and go through the field offset vector in the
// metadata when accessing stored properties.
-// CHECK-LABEL: define{{( protected)?}} swiftcc {{i32|i64}} @_T017struct_resilience26StructWithResilientStorageV1nSifg(%T17struct_resilience26StructWithResilientStorageV* {{.*}})
+// CHECK-LABEL: define{{( protected)?}} swiftcc {{i32|i64}} @_T017struct_resilience26StructWithResilientStorageV1nSivg(%T17struct_resilience26StructWithResilientStorageV* {{.*}})
// CHECK: [[METADATA:%.*]] = call %swift.type* @_T017struct_resilience26StructWithResilientStorageVMa()
// CHECK-NEXT: [[METADATA_ADDR:%.*]] = bitcast %swift.type* [[METADATA]] to [[INT]]*
// CHECK-NEXT: [[FIELD_OFFSET_VECTOR:%.*]] = getelementptr inbounds [[INT]], [[INT]]* [[METADATA_ADDR]], [[INT]] 3
@@ -135,7 +135,7 @@
}
-// CHECK-LABEL: define{{( protected)?}} swiftcc {{i32|i64}} @_T017struct_resilience31StructWithIndirectResilientEnumV1nSifg(%T17struct_resilience31StructWithIndirectResilientEnumV* {{.*}})
+// CHECK-LABEL: define{{( protected)?}} swiftcc {{i32|i64}} @_T017struct_resilience31StructWithIndirectResilientEnumV1nSivg(%T17struct_resilience31StructWithIndirectResilientEnumV* {{.*}})
// CHECK: [[FIELD_PTR:%.*]] = getelementptr inbounds %T17struct_resilience31StructWithIndirectResilientEnumV, %T17struct_resilience31StructWithIndirectResilientEnumV* %0, i32 0, i32 1
// CHECK-NEXT: [[FIELD_PAYLOAD_PTR:%.*]] = getelementptr inbounds %TSi, %TSi* [[FIELD_PTR]], i32 0, i32 0
// CHECK-NEXT: [[FIELD_PAYLOAD:%.*]] = load [[INT]], [[INT]]* [[FIELD_PAYLOAD_PTR]]
diff --git a/test/IRGen/zombies.swift b/test/IRGen/zombies.swift
index bb0af35..d8acfb5 100644
--- a/test/IRGen/zombies.swift
+++ b/test/IRGen/zombies.swift
@@ -8,5 +8,5 @@
init(i: Int) { self.i = i }
}
-// CHECK: @_T07zombies1CC1i33_{{.*}}fg = hidden alias void (), void ()* @_swift_dead_method_stub
+// CHECK: @_T07zombies1CC1i33_{{.*}}vg = hidden alias void (), void ()* @_swift_dead_method_stub
// CHECK: define internal void @_swift_dead_method_stub()
diff --git a/test/Index/Store/record-sourcefile.swift b/test/Index/Store/record-sourcefile.swift
index 129f7cc..a4f0c73 100644
--- a/test/Index/Store/record-sourcefile.swift
+++ b/test/Index/Store/record-sourcefile.swift
@@ -9,17 +9,17 @@
// CHECK: record-sourcefile.swift
// CHECK: ------------
// CHECK: struct/Swift | S1 | s:4file2S1V | <no-cgname> | Def,Ref,RelCont -
-// CHECK: instance-method/acc-get/Swift | getter:property | s:4file2S1V8propertySifg | <no-cgname> | Def,Ref,Call,Impl,RelChild,RelRec,RelCall,RelAcc,RelCont -
-// CHECK: instance-property/Swift | property | [[property_USR:s:4file2S1V8propertySiv]] | <no-cgname> | Def,Ref,Read,RelChild,RelCont -
-// CHECK: static-method/acc-get/Swift | getter:staticProperty | s:4file2S1V14staticPropertySifg | <no-cgname> | Def,Ref,Call,Impl,RelChild,RelRec,RelCall,RelAcc,RelCont -
+// CHECK: instance-method/acc-get/Swift | getter:property | s:4file2S1V8propertySivg | <no-cgname> | Def,Ref,Call,Impl,RelChild,RelRec,RelCall,RelAcc,RelCont -
+// CHECK: instance-property/Swift | property | [[property_USR:s:4file2S1V8propertySivp]] | <no-cgname> | Def,Ref,Read,RelChild,RelCont -
+// CHECK: static-method/acc-get/Swift | getter:staticProperty | s:4file2S1V14staticPropertySivg | <no-cgname> | Def,Ref,Call,Impl,RelChild,RelRec,RelCall,RelAcc,RelCont -
// CHECK: static-property/Swift | staticProperty | s:{{.*}} | <no-cgname> | Def,Ref,Read,RelChild,RelCont -
// CHECK: instance-property/Swift | computedPropertyGetSet | s:{{.*}} | <no-cgname> | Def,RelChild -
// CHECK: struct/Swift | Int | s:Si | <no-cgname> | Ref -
-// CHECK: instance-method/acc-get/Swift | getter:computedPropertyGetSet | s:4file2S1V22computedPropertyGetSetSifg | <no-cgname> | Def,RelChild,RelAcc -
-// CHECK: instance-method/acc-set/Swift | setter:computedPropertyGetSet | s:4file2S1V22computedPropertyGetSetSifs | <no-cgname> | Def,RelChild,RelAcc -
+// CHECK: instance-method/acc-get/Swift | getter:computedPropertyGetSet | s:4file2S1V22computedPropertyGetSetSivg | <no-cgname> | Def,RelChild,RelAcc -
+// CHECK: instance-method/acc-set/Swift | setter:computedPropertyGetSet | s:4file2S1V22computedPropertyGetSetSivs | <no-cgname> | Def,RelChild,RelAcc -
// CHECK: instance-property/Swift | computedPropertyWillDid | s:{{.*}} | <no-cgname> | Def,RelChild -
-// CHECK: instance-method/acc-willset/Swift | willSet:computedPropertyWillDid | s:4file2S1V23computedPropertyWillDidSifw | <no-cgname> | Def,RelChild,RelAcc -
-// CHECK: instance-method/acc-didset/Swift | didSet:computedPropertyWillDid | s:4file2S1V23computedPropertyWillDidSifW | <no-cgname> | Def,RelChild,RelAcc -
+// CHECK: instance-method/acc-willset/Swift | willSet:computedPropertyWillDid | s:4file2S1V23computedPropertyWillDidSivw | <no-cgname> | Def,RelChild,RelAcc -
+// CHECK: instance-method/acc-didset/Swift | didSet:computedPropertyWillDid | s:4file2S1V23computedPropertyWillDidSivW | <no-cgname> | Def,RelChild,RelAcc -
// CHECK: instance-property/Swift | computedPropertyAddressor | s:{{.*}} | <no-cgname> | Def,RelChild -
// CHECK: instance-method/acc-addr/Swift | <no-name> | s:{{.*}} | <no-cgname> | Def,RelChild,RelAcc -
// CHECK: instance-method/acc-mutaddr/Swift | <no-name> | s:{{.*}} | <no-cgname> | Def,RelChild,RelAcc -
diff --git a/test/Index/kinds.swift b/test/Index/kinds.swift
index a831a9e..2f73e09 100644
--- a/test/Index/kinds.swift
+++ b/test/Index/kinds.swift
@@ -18,21 +18,21 @@
// Subscript
subscript(index: Int) -> Int {
- // CHECK: [[@LINE-1]]:3 | instance-property/subscript/Swift | subscript(_:) | s:14swift_ide_test7AStructV9subscriptS2ici | Def,RelChild | rel: 1
+ // CHECK: [[@LINE-1]]:3 | instance-property/subscript/Swift | subscript(_:) | s:14swift_ide_test7AStructVS2icip | Def,RelChild | rel: 1
// CHECK-NEXT: RelChild | struct/Swift | AStruct | s:14swift_ide_test7AStructV
// Accessor + AccessorAddressor
unsafeAddress {
- // CHECK: [[@LINE-1]]:5 | instance-method/acc-addr/Swift | | s:14swift_ide_test7AStructV9subscriptS2icflu | Def,RelChild,RelAcc | rel: 1
- // CHECK-NEXT: RelChild,RelAcc | instance-property/subscript/Swift | subscript(_:) | s:14swift_ide_test7AStructV9subscriptS2ici
+ // CHECK: [[@LINE-1]]:5 | instance-method/acc-addr/Swift | | s:14swift_ide_test7AStructVS2icilu | Def,RelChild,RelAcc | rel: 1
+ // CHECK-NEXT: RelChild,RelAcc | instance-property/subscript/Swift | subscript(_:) | s:14swift_ide_test7AStructVS2icip
return UnsafePointer(base)
}
// Accessor + AccessorMutableAddressor
unsafeMutableAddress {
- // CHECK: [[@LINE-1]]:5 | instance-method/acc-mutaddr/Swift | | s:14swift_ide_test7AStructV9subscriptS2icfau | Def,RelChild,RelAcc | rel: 1
- // CHECK-NEXT: RelChild,RelAcc | instance-property/subscript/Swift | subscript(_:) | s:14swift_ide_test7AStructV9subscriptS2ici
+ // CHECK: [[@LINE-1]]:5 | instance-method/acc-mutaddr/Swift | | s:14swift_ide_test7AStructVS2iciau | Def,RelChild,RelAcc | rel: 1
+ // CHECK-NEXT: RelChild,RelAcc | instance-property/subscript/Swift | subscript(_:) | s:14swift_ide_test7AStructVS2icip
return base
}
@@ -50,7 +50,7 @@
func instanceMethod(a: Int, b b: Int, _ c: Int, d _: Int, _: Int) {
// CHECK: [[@LINE-1]]:8 | instance-method/Swift | instanceMethod(a:b:_:d:_:) | s:14swift_ide_test6AClassC14instanceMethodySi1a_Si1bS2i1dSitF | Def,Dyn,RelChild | rel: 1
// CHECK-NEXT: RelChild | class/Swift | AClass | s:14swift_ide_test6AClassC
- // CHECK: [[@LINE-3]]:23 | param/Swift | a | s:14swift_ide_test6AClassC14instanceMethodySi1a_Si1bS2i1dSitFAEL_Siv | Def,RelChild | rel: 1
+ // CHECK: [[@LINE-3]]:23 | param/Swift | a | s:14swift_ide_test6AClassC14instanceMethodySi1a_Si1bS2i1dSitFAEL_Sivp | Def,RelChild | rel: 1
// CHECK-NEXT: RelChild | instance-method/Swift | instanceMethod(a:b:_:d:_:) | s:14swift_ide_test6AClassC14instanceMethodySi1a_Si1bS2i1dSitF
// CHECK: [[@LINE-5]]:33 | param(local)/Swift | b | s:{{.*}} | Def,RelChild | rel: 1
// CHECK: [[@LINE-6]]:43 | param(local)/Swift | c | s:{{.*}} | Def,RelChild | rel: 1
@@ -77,12 +77,12 @@
// InstanceProperty
var instanceProperty: Int {
- // CHECK: [[@LINE-1]]:7 | instance-property/Swift | instanceProperty | s:14swift_ide_test6AClassC16instancePropertySiv | Def,RelChild | rel: 1
+ // CHECK: [[@LINE-1]]:7 | instance-property/Swift | instanceProperty | s:14swift_ide_test6AClassC16instancePropertySivp | Def,RelChild | rel: 1
// CHECK-NEXT: RelChild | class/Swift | AClass | s:14swift_ide_test6AClassC
// Accessor + AccessorGetter
get {
- // CHECK: [[@LINE-1]]:5 | instance-method/acc-get/Swift | getter:instanceProperty | s:14swift_ide_test6AClassC16instancePropertySifg | Def,Dyn,RelChild,RelAcc | rel: 1
+ // CHECK: [[@LINE-1]]:5 | instance-method/acc-get/Swift | getter:instanceProperty | s:14swift_ide_test6AClassC16instancePropertySivg | Def,Dyn,RelChild,RelAcc | rel: 1
// CHECK-NEXT: RelChild,RelAcc | instance-property/Swift | instanceProperty | s:14swift_ide_test6AClassC16instancePropertySiv
return 1
@@ -90,7 +90,7 @@
// Accessor + AccessorSetter
set {}
- // CHECK: [[@LINE-1]]:5 | instance-method/acc-set/Swift | setter:instanceProperty | s:14swift_ide_test6AClassC16instancePropertySifs | Def,Dyn,RelChild,RelAcc | rel: 1
+ // CHECK: [[@LINE-1]]:5 | instance-method/acc-set/Swift | setter:instanceProperty | s:14swift_ide_test6AClassC16instancePropertySivs | Def,Dyn,RelChild,RelAcc | rel: 1
// CHECK-NEXT: RelChild,RelAcc | instance-property/Swift | instanceProperty | s:14swift_ide_test6AClassC16instancePropertySiv
}
@@ -98,23 +98,23 @@
// Accessor + AccessorWillSet
willSet {}
- // CHECK: [[@LINE-1]]:5 | instance-method/acc-willset/Swift | willSet:observed | s:14swift_ide_test6AClassC8observedSifw | Def,RelChild,RelAcc | rel: 1
+ // CHECK: [[@LINE-1]]:5 | instance-method/acc-willset/Swift | willSet:observed | s:14swift_ide_test6AClassC8observedSivw | Def,RelChild,RelAcc | rel: 1
// CHECK-NEXT: RelChild,RelAcc | instance-property/Swift | observed | s:14swift_ide_test6AClassC8observedSiv
// Accessor + AccessorDidSet
didSet {}
- // CHECK: [[@LINE-1]]:5 | instance-method/acc-didset/Swift | didSet:observed | s:14swift_ide_test6AClassC8observedSifW | Def,RelChild,RelAcc | rel: 1
+ // CHECK: [[@LINE-1]]:5 | instance-method/acc-didset/Swift | didSet:observed | s:14swift_ide_test6AClassC8observedSivW | Def,RelChild,RelAcc | rel: 1
// CHECK-NEXT: RelChild,RelAcc | instance-property/Swift | observed | s:14swift_ide_test6AClassC8observedSiv
}
// ClassProperty
class let classProperty = 1
- // CHECK: [[@LINE-1]]:13 | class-property/Swift | classProperty | s:14swift_ide_test6AClassC13classPropertySivZ | Def,RelChild | rel: 1
+ // CHECK: [[@LINE-1]]:13 | class-property/Swift | classProperty | s:14swift_ide_test6AClassC13classPropertySivpZ | Def,RelChild | rel: 1
// CHECK-NEXT: RelChild | class/Swift | AClass | s:14swift_ide_test6AClassC
// StaticProperty
static let staticProperty = 1
- // CHECK: [[@LINE-1]]:14 | static-property/Swift | staticProperty | s:14swift_ide_test6AClassC14staticPropertySivZ | Def,RelChild | rel: 1
+ // CHECK: [[@LINE-1]]:14 | static-property/Swift | staticProperty | s:14swift_ide_test6AClassC14staticPropertySivpZ | Def,RelChild | rel: 1
// CHECK-NEXT: RelChild | class/Swift | AClass | s:14swift_ide_test6AClassC
// Constructor
@@ -178,7 +178,7 @@
// Variable
var foo = 1
-// CHECK: [[@LINE-1]]:5 | variable/Swift | foo | s:14swift_ide_test3fooSiv | Def | rel: 0
+// CHECK: [[@LINE-1]]:5 | variable/Swift | foo | s:14swift_ide_test3fooSivp | Def | rel: 0
// PrefixOperator
prefix func -(a: AStruct) -> AStruct { return a }
diff --git a/test/Index/roles.swift b/test/Index/roles.swift
index d215d65..76fe95a 100644
--- a/test/Index/roles.swift
+++ b/test/Index/roles.swift
@@ -7,53 +7,53 @@
import func imported_swift_module.importedFunc
// CHECK: [[@LINE-1]]:35 | function/Swift | importedFunc() | s:21imported_swift_module0A4FuncyyF | Ref | rel: 0
import var imported_swift_module.importedGlobal
-// CHECK: [[@LINE-1]]:34 | variable/Swift | importedGlobal | s:21imported_swift_module0A6GlobalSiv | Ref | rel: 0
+// CHECK: [[@LINE-1]]:34 | variable/Swift | importedGlobal | s:21imported_swift_module0A6GlobalSivp | Ref | rel: 0
// Definition
let x = 2
-// CHECK: [[@LINE-1]]:5 | variable/Swift | x | s:14swift_ide_test1xSiv | Def | rel: 0
+// CHECK: [[@LINE-1]]:5 | variable/Swift | x | s:14swift_ide_test1xSivp | Def | rel: 0
// Definition + Read of x
var y = x + 1
-// CHECK: [[@LINE-1]]:5 | variable/Swift | y | s:14swift_ide_test1ySiv | Def | rel: 0
-// CHECK: [[@LINE-2]]:9 | variable/Swift | x | s:14swift_ide_test1xSiv | Ref,Read | rel: 0
+// CHECK: [[@LINE-1]]:5 | variable/Swift | y | s:14swift_ide_test1ySivp | Def | rel: 0
+// CHECK: [[@LINE-2]]:9 | variable/Swift | x | s:14swift_ide_test1xSivp | Ref,Read | rel: 0
// CHECK: [[@LINE-3]]:11 | static-method/infix-operator/Swift | +(_:_:) | s:Si1poiS2i_SitFZ | Ref | rel: 0
// Read of x + Write of y
y = x + 1
-// CHECK: [[@LINE-1]]:1 | variable/Swift | y | s:14swift_ide_test1ySiv | Ref,Writ | rel: 0
-// CHECK: [[@LINE-2]]:5 | variable/Swift | x | s:14swift_ide_test1xSiv | Ref,Read | rel: 0
+// CHECK: [[@LINE-1]]:1 | variable/Swift | y | s:14swift_ide_test1ySivp | Ref,Writ | rel: 0
+// CHECK: [[@LINE-2]]:5 | variable/Swift | x | s:14swift_ide_test1xSivp | Ref,Read | rel: 0
// CHECK: [[@LINE-3]]:7 | static-method/infix-operator/Swift | +(_:_:) | s:Si1poiS2i_SitFZ | Ref | rel: 0
// Read of y + Write of y
y += x
-// CHECK: [[@LINE-1]]:1 | variable/Swift | y | s:14swift_ide_test1ySiv | Ref,Read,Writ | rel: 0
+// CHECK: [[@LINE-1]]:1 | variable/Swift | y | s:14swift_ide_test1ySivp | Ref,Read,Writ | rel: 0
// CHECK: [[@LINE-2]]:3 | static-method/infix-operator/Swift | +=(_:_:) | s:Si2peoiySiz_SitFZ | Ref | rel: 0
-// CHECK: [[@LINE-3]]:6 | variable/Swift | x | s:14swift_ide_test1xSiv | Ref,Read | rel: 0
+// CHECK: [[@LINE-3]]:6 | variable/Swift | x | s:14swift_ide_test1xSivp | Ref,Read | rel: 0
var z: Int {
-// CHECK: [[@LINE-1]]:5 | variable/Swift | z | s:14swift_ide_test1zSiv | Def | rel: 0
+// CHECK: [[@LINE-1]]:5 | variable/Swift | z | s:14swift_ide_test1zSivp | Def | rel: 0
get {
- // CHECK: [[@LINE-1]]:3 | function/acc-get/Swift | getter:z | s:14swift_ide_test1zSifg | Def,RelChild,RelAcc | rel: 1
+ // CHECK: [[@LINE-1]]:3 | function/acc-get/Swift | getter:z | s:14swift_ide_test1zSivg | Def,RelChild,RelAcc | rel: 1
return y
- // CHECK: [[@LINE-1]]:12 | variable/Swift | y | s:14swift_ide_test1ySiv | Ref,Read,RelCont | rel: 1
- // CHECK-NEXT: RelCont | function/acc-get/Swift | getter:z | s:14swift_ide_test1zSifg
+ // CHECK: [[@LINE-1]]:12 | variable/Swift | y | s:14swift_ide_test1ySivp | Ref,Read,RelCont | rel: 1
+ // CHECK-NEXT: RelCont | function/acc-get/Swift | getter:z | s:14swift_ide_test1zSivg
}
set {
- // CHECK: [[@LINE-1]]:3 | function/acc-set/Swift | setter:z | s:14swift_ide_test1zSifs | Def,RelChild,RelAcc | rel: 1
+ // CHECK: [[@LINE-1]]:3 | function/acc-set/Swift | setter:z | s:14swift_ide_test1zSivs | Def,RelChild,RelAcc | rel: 1
y = newValue
- // CHECK: [[@LINE-1]]:5 | variable/Swift | y | s:14swift_ide_test1ySiv | Ref,Writ,RelCont | rel: 1
- // CHECK-NEXT: RelCont | function/acc-set/Swift | setter:z | s:14swift_ide_test1zSifs
+ // CHECK: [[@LINE-1]]:5 | variable/Swift | y | s:14swift_ide_test1ySivp | Ref,Writ,RelCont | rel: 1
+ // CHECK-NEXT: RelCont | function/acc-set/Swift | setter:z | s:14swift_ide_test1zSivs
}
}
// Write + Read of z
z = z + 1
-// CHECK: [[@LINE-1]]:1 | variable/Swift | z | s:14swift_ide_test1zSiv | Ref,Writ | rel: 0
-// CHECK: [[@LINE-2]]:1 | function/acc-set/Swift | setter:z | s:14swift_ide_test1zSifs | Ref,Call,Impl | rel: 0
-// CHECK: [[@LINE-3]]:5 | variable/Swift | z | s:14swift_ide_test1zSiv | Ref,Read | rel: 0
-// CHECK: [[@LINE-4]]:5 | function/acc-get/Swift | getter:z | s:14swift_ide_test1zSifg | Ref,Call,Impl | rel: 0
+// CHECK: [[@LINE-1]]:1 | variable/Swift | z | s:14swift_ide_test1zSivp | Ref,Writ | rel: 0
+// CHECK: [[@LINE-2]]:1 | function/acc-set/Swift | setter:z | s:14swift_ide_test1zSivs | Ref,Call,Impl | rel: 0
+// CHECK: [[@LINE-3]]:5 | variable/Swift | z | s:14swift_ide_test1zSivp | Ref,Read | rel: 0
+// CHECK: [[@LINE-4]]:5 | function/acc-get/Swift | getter:z | s:14swift_ide_test1zSivg | Ref,Call,Impl | rel: 0
// Call
func aCalledFunction(a: Int, b: inout Int) {
@@ -82,7 +82,7 @@
aCalledFunction(a: 1, b: &z)
// CHECK: [[@LINE-1]]:1 | function/Swift | aCalledFunction(a:b:) | s:14swift_ide_test15aCalledFunctionySi1a_Siz1btF | Ref,Call | rel: 0
-// CHECK: [[@LINE-2]]:27 | variable/Swift | z | s:14swift_ide_test1zSiv | Ref,Read,Writ | rel: 0
+// CHECK: [[@LINE-2]]:27 | variable/Swift | z | s:14swift_ide_test1zSivp | Ref,Read,Writ | rel: 0
func aCaller() {
// CHECK: [[@LINE-1]]:6 | function/Swift | aCaller() | s:14swift_ide_test7aCalleryyF | Def | rel: 0
@@ -113,10 +113,10 @@
x += 1
// CHECK: [[@LINE-1]]:5 | instance-property/Swift | x | [[AStruct_x_USR]] | Ref,Read,Writ,RelCont | rel: 1
// CHECK-NEXT: RelCont | instance-method/Swift | aMethod() | s:14swift_ide_test7AStructV7aMethodyyF
- // CHECK: [[@LINE-3]]:5 | instance-method/acc-get/Swift | getter:x | s:14swift_ide_test7AStructV1xSifg | Ref,Call,Impl,RelRec,RelCall,RelCont | rel: 2
+ // CHECK: [[@LINE-3]]:5 | instance-method/acc-get/Swift | getter:x | s:14swift_ide_test7AStructV1xSivg | Ref,Call,Impl,RelRec,RelCall,RelCont | rel: 2
// CHECK-NEXT: RelCall,RelCont | instance-method/Swift | aMethod() | s:14swift_ide_test7AStructV7aMethodyyF
// CHECK-NEXT: RelRec | struct/Swift | AStruct | [[AStruct_USR]]
- // CHECK: [[@LINE-6]]:5 | instance-method/acc-set/Swift | setter:x | s:14swift_ide_test7AStructV1xSifs | Ref,Call,Impl,RelRec,RelCall,RelCont | rel: 2
+ // CHECK: [[@LINE-6]]:5 | instance-method/acc-set/Swift | setter:x | s:14swift_ide_test7AStructV1xSivs | Ref,Call,Impl,RelRec,RelCall,RelCont | rel: 2
// CHECK-NEXT: RelCall,RelCont | instance-method/Swift | aMethod() | s:14swift_ide_test7AStructV7aMethodyyF
// CHECK-NEXT: RelRec | struct/Swift | AStruct | [[AStruct_USR]]
// CHECK: [[@LINE-9]]:7 | static-method/infix-operator/Swift | +=(_:_:) | s:Si2peoiySiz_SitFZ | Ref,RelCont | rel: 1
@@ -125,18 +125,18 @@
// RelationChildOf, RelationAccessorOf
subscript(index: Int) -> Int {
- // CHECK: [[@LINE-1]]:3 | instance-property/subscript/Swift | subscript(_:) | s:14swift_ide_test7AStructV9subscriptS2ici | Def,RelChild | rel: 1
+ // CHECK: [[@LINE-1]]:3 | instance-property/subscript/Swift | subscript(_:) | s:14swift_ide_test7AStructVS2icip | Def,RelChild | rel: 1
// CHECK-NEXT: RelChild | struct/Swift | AStruct | [[AStruct_USR]]
get {
- // CHECK: [[@LINE-1]]:5 | instance-method/acc-get/Swift | getter:subscript(_:) | s:14swift_ide_test7AStructV9subscriptS2icfg | Def,RelChild,RelAcc | rel: 1
- // CHECK-NEXT: RelChild,RelAcc | instance-property/subscript/Swift | subscript(_:) | s:14swift_ide_test7AStructV9subscriptS2ici
+ // CHECK: [[@LINE-1]]:5 | instance-method/acc-get/Swift | getter:subscript(_:) | s:14swift_ide_test7AStructVS2icig | Def,RelChild,RelAcc | rel: 1
+ // CHECK-NEXT: RelChild,RelAcc | instance-property/subscript/Swift | subscript(_:) | s:14swift_ide_test7AStructVS2icip
return x
}
set {
- // CHECK: [[@LINE-1]]:5 | instance-method/acc-set/Swift | setter:subscript(_:) | s:14swift_ide_test7AStructV9subscriptS2icfs | Def,RelChild,RelAcc | rel: 1
- // CHECK-NEXT: RelChild,RelAcc | instance-property/subscript/Swift | subscript(_:) | s:14swift_ide_test7AStructV9subscriptS2ici
+ // CHECK: [[@LINE-1]]:5 | instance-method/acc-set/Swift | setter:subscript(_:) | s:14swift_ide_test7AStructVS2icis | Def,RelChild,RelAcc | rel: 1
+ // CHECK-NEXT: RelChild,RelAcc | instance-property/subscript/Swift | subscript(_:) | s:14swift_ide_test7AStructVS2ici
x = newValue
}
@@ -318,24 +318,24 @@
// CHECK: [[@LINE-2]]:18 | constructor/Swift | init(x:) | s:14swift_ide_test6AClassCACSi1x_tcfc | Ref,Call | rel: 0
anInstance.y.x = anInstance.y.x
-// CHECK: [[@LINE-1]]:1 | variable/Swift | anInstance | s:14swift_ide_test10anInstanceAA6AClassCv | Ref,Read | rel: 0
+// CHECK: [[@LINE-1]]:1 | variable/Swift | anInstance | s:14swift_ide_test10anInstanceAA6AClassCvp | Ref,Read | rel: 0
// CHECK: [[@LINE-2]]:12 | instance-property/Swift | y | [[AClass_y_USR]] | Ref,Read,Writ | rel: 0
// CHECK: [[@LINE-3]]:14 | instance-property/Swift | x | [[AStruct_x_USR]] | Ref,Writ | rel: 0
-// CHECK: [[@LINE-4]]:18 | variable/Swift | anInstance | s:14swift_ide_test10anInstanceAA6AClassCv | Ref,Read | rel: 0
+// CHECK: [[@LINE-4]]:18 | variable/Swift | anInstance | s:14swift_ide_test10anInstanceAA6AClassCvp | Ref,Read | rel: 0
// CHECK: [[@LINE-5]]:29 | instance-property/Swift | y | [[AClass_y_USR]] | Ref,Read | rel: 0
// CHECK: [[@LINE-6]]:31 | instance-property/Swift | x | [[AStruct_x_USR]] | Ref,Read | rel: 0
anInstance.y.aMethod()
-// CHECK: [[@LINE-1]]:1 | variable/Swift | anInstance | s:14swift_ide_test10anInstanceAA6AClassCv | Ref,Read | rel: 0
+// CHECK: [[@LINE-1]]:1 | variable/Swift | anInstance | s:14swift_ide_test10anInstanceAA6AClassCvp | Ref,Read | rel: 0
// CHECK: [[@LINE-2]]:12 | instance-property/Swift | y | [[AClass_y_USR]] | Ref,Read,Writ | rel: 0
// CHECK: [[@LINE-3]]:14 | instance-method/Swift | aMethod() | s:14swift_ide_test7AStructV7aMethodyyF | Ref,Call | rel: 0
// FIXME Write role of z occurrence on the RHS?
anInstance.z[1] = anInstance.z[0]
-// CHECK: [[@LINE-1]]:1 | variable/Swift | anInstance | s:14swift_ide_test10anInstanceAA6AClassCv | Ref,Read | rel: 0
-// CHECK: [[@LINE-2]]:12 | instance-property/Swift | z | s:14swift_ide_test6AClassC1zSaySiGv | Ref,Read,Writ | rel: 0
-// CHECK: [[@LINE-3]]:19 | variable/Swift | anInstance | s:14swift_ide_test10anInstanceAA6AClassCv | Ref,Read | rel: 0
-// CHECK: [[@LINE-4]]:30 | instance-property/Swift | z | s:14swift_ide_test6AClassC1zSaySiGv | Ref,Read,Writ | rel: 0
+// CHECK: [[@LINE-1]]:1 | variable/Swift | anInstance | s:14swift_ide_test10anInstanceAA6AClassCvp | Ref,Read | rel: 0
+// CHECK: [[@LINE-2]]:12 | instance-property/Swift | z | s:14swift_ide_test6AClassC1zSaySiGvp | Ref,Read,Writ | rel: 0
+// CHECK: [[@LINE-3]]:19 | variable/Swift | anInstance | s:14swift_ide_test10anInstanceAA6AClassCvp | Ref,Read | rel: 0
+// CHECK: [[@LINE-4]]:30 | instance-property/Swift | z | s:14swift_ide_test6AClassC1zSaySiGvp | Ref,Read,Writ | rel: 0
let otherInstance = AStruct(x: 1)
// CHECK: [[@LINE-1]]:29 | instance-property/Swift | x | [[AStruct_x_USR]] | Ref | rel: 0
@@ -346,35 +346,35 @@
// CHECK: [[@LINE-2]]:5 | struct/Swift | AStruct | [[AStruct_USR]] | Ref | rel: 0
let _ = otherInstance[0]
-// CHECK: [[@LINE-1]]:9 | variable/Swift | otherInstance | s:14swift_ide_test13otherInstanceAA7AStructVv | Ref,Read | rel: 0
-// CHECK: [[@LINE-2]]:22 | instance-property/subscript/Swift | subscript(_:) | s:14swift_ide_test7AStructV9subscriptS2ici | Ref,Read | rel: 0
+// CHECK: [[@LINE-1]]:9 | variable/Swift | otherInstance | s:14swift_ide_test13otherInstanceAA7AStructVvp | Ref,Read | rel: 0
+// CHECK: [[@LINE-2]]:22 | instance-property/subscript/Swift | subscript(_:) | s:14swift_ide_test7AStructVS2icip | Ref,Read | rel: 0
let _ = anInstance[0]
-// CHECK: [[@LINE-1]]:9 | variable/Swift | anInstance | s:14swift_ide_test10anInstanceAA6AClassCv | Ref,Read | rel: 0
+// CHECK: [[@LINE-1]]:9 | variable/Swift | anInstance | s:14swift_ide_test10anInstanceAA6AClassCvp | Ref,Read | rel: 0
// CHECK: [[@LINE-2]]:19 | instance-property/subscript/Swift | subscript(_:) | [[AClass_subscript_USR]] | Ref,Read | rel: 0
let aSubInstance: AClass = ASubClass(x: 1)
-// CHECK: [[@LINE-1]]:5 | variable/Swift | aSubInstance | s:14swift_ide_test12aSubInstanceAA6AClassCv | Def | rel: 0
+// CHECK: [[@LINE-1]]:5 | variable/Swift | aSubInstance | s:14swift_ide_test12aSubInstanceAA6AClassCvp | Def | rel: 0
// CHECK: [[@LINE-2]]:28 | class/Swift | ASubClass | s:14swift_ide_test9ASubClassC | Ref | rel: 0
// Dynamic, RelationReceivedBy
let _ = aSubInstance.foo()
-// CHECK: [[@LINE-1]]:9 | variable/Swift | aSubInstance | s:14swift_ide_test12aSubInstanceAA6AClassCv | Ref,Read | rel: 0
+// CHECK: [[@LINE-1]]:9 | variable/Swift | aSubInstance | s:14swift_ide_test12aSubInstanceAA6AClassCvp | Ref,Read | rel: 0
// CHECK: [[@LINE-2]]:22 | instance-method/Swift | foo() | [[AClass_foo_USR]] | Ref,Call,Dyn,RelRec | rel: 1
// CHECK-NEXT: RelRec | class/Swift | AClass | s:14swift_ide_test6AClassC
// RelationContainedBy
let contained = 2
-// CHECK: [[@LINE-1]]:5 | variable/Swift | contained | s:14swift_ide_test9containedSiv | Def | rel: 0
+// CHECK: [[@LINE-1]]:5 | variable/Swift | contained | s:14swift_ide_test9containedSivp | Def | rel: 0
func containing() {
// CHECK: [[@LINE-1]]:6 | function/Swift | containing() | s:14swift_ide_test10containingyyF | Def | rel: 0
let _ = contained
- // CHECK: [[@LINE-1]]:11 | variable/Swift | contained | s:14swift_ide_test9containedSiv | Ref,Read,RelCont | rel: 1
+ // CHECK: [[@LINE-1]]:11 | variable/Swift | contained | s:14swift_ide_test9containedSivp | Ref,Read,RelCont | rel: 1
// CHECK-NEXT: RelCont | function/Swift | containing() | s:14swift_ide_test10containingyyF
var x = contained
- // CHECK: [[@LINE-1]]:11 | variable/Swift | contained | s:14swift_ide_test9containedSiv | Ref,Read,RelCont | rel: 1
+ // CHECK: [[@LINE-1]]:11 | variable/Swift | contained | s:14swift_ide_test9containedSivp | Ref,Read,RelCont | rel: 1
// CHECK-NEXT: RelCont | function/Swift | containing() | s:14swift_ide_test10containingyyF
struct LocalStruct {
@@ -383,7 +383,7 @@
// CHECK-NEXT: RelCont | function/Swift | containing() | s:14swift_ide_test10containingyyF
// CHECK: [[@LINE-3]]:21 | class/Swift | AClass | s:14swift_ide_test6AClassC | Ref,RelCont | rel: 1
// CHECK-NEXT: RelCont | function/Swift | containing() | s:14swift_ide_test10containingyyF
- // CHECK: [[@LINE-5]]:31 | variable/Swift | contained | s:14swift_ide_test9containedSiv | Ref,Read,RelCont | rel: 1
+ // CHECK: [[@LINE-5]]:31 | variable/Swift | contained | s:14swift_ide_test9containedSivp | Ref,Read,RelCont | rel: 1
// CHECK-NEXT: RelCont | function/Swift | containing() | s:14swift_ide_test10containingyyF
init(i _: AClass) {}
@@ -396,7 +396,7 @@
// CHECK-NEXT: RelCont | function/Swift | containing() | s:14swift_ide_test10containingyyF
// CHECK: [[@LINE-3]]:23 | class/Swift | AClass | s:14swift_ide_test6AClassC | Ref,RelCont | rel: 1
// CHECK-NEXT: RelCont | function/Swift | containing() | s:14swift_ide_test10containingyyF
- // CHECK: [[@LINE-5]]:33 | variable/Swift | contained | s:14swift_ide_test9containedSiv | Ref,Read,RelCont | rel: 1
+ // CHECK: [[@LINE-5]]:33 | variable/Swift | contained | s:14swift_ide_test9containedSivp | Ref,Read,RelCont | rel: 1
// CHECK-NEXT: RelCont | function/Swift | containing() | s:14swift_ide_test10containingyyF
aCalledFunction(a: 1, b: &z)
diff --git a/test/Inputs/comment_to_something_conversion.swift b/test/Inputs/comment_to_something_conversion.swift
index b90637f..480f77a 100644
--- a/test/Inputs/comment_to_something_conversion.swift
+++ b/test/Inputs/comment_to_something_conversion.swift
@@ -15,7 +15,7 @@
/// Aaa. subscript(i: Int).
@objc public subscript(i: Int) -> Int {
-// CHECK: {{.*}}DocCommentAsXML=[<Other file="{{.*}}" line="{{.*}}" column="{{.*}}"><Name>subscript(_:)</Name><USR>s:14comment_to_xml21A010_AttachToEntitiesC9subscriptS2ici</USR><Declaration>@objc public subscript(i: Int) -> Int { get set }</Declaration><CommentParts><Abstract><Para>Aaa. subscript(i: Int).</Para></Abstract></CommentParts></Other>]
+// CHECK: {{.*}}DocCommentAsXML=[<Other file="{{.*}}" line="{{.*}}" column="{{.*}}"><Name>subscript(_:)</Name><USR>s:14comment_to_xml21A010_AttachToEntitiesCS2icip</USR><Declaration>@objc public subscript(i: Int) -> Int { get set }</Declaration><CommentParts><Abstract><Para>Aaa. subscript(i: Int).</Para></Abstract></CommentParts></Other>]
get {
// CHECK: {{.*}}DocCommentAsXML=none
return 0
diff --git a/test/Migrator/Inputs/qualified.json b/test/Migrator/Inputs/qualified.json
index 9a942ed..385af40 100644
--- a/test/Migrator/Inputs/qualified.json
+++ b/test/Migrator/Inputs/qualified.json
@@ -25,7 +25,7 @@
},
{
"DiffItemKind": "TypeMemberDiffItem",
- "Usr": "s:6CitiesAAC8CityKindV4TownSivZ",
+ "Usr": "s:6CitiesAAC8CityKindV4TownSivpZ",
"OldPrintedName": "town",
"OldTypeName": "Cities.CityKind",
"NewPrintedName": "NewTown",
diff --git a/test/Parse/subscripting.swift b/test/Parse/subscripting.swift
index a81c6ae..0351c5b 100644
--- a/test/Parse/subscripting.swift
+++ b/test/Parse/subscripting.swift
@@ -59,8 +59,7 @@
struct Y1 {
var stored: Int
- // FIXME: Duplicate diagnostics
- subscript(_: i, j: Int) -> Int { // expected-error 3{{use of undeclared type 'i'}}
+ subscript(_: i, j: Int) -> Int { // expected-error {{use of undeclared type 'i'}}
get {
return stored + j
}
diff --git a/test/SIL/opaque-verify.sil b/test/SIL/opaque-verify.sil
new file mode 100644
index 0000000..5a8fcbe
--- /dev/null
+++ b/test/SIL/opaque-verify.sil
@@ -0,0 +1,23 @@
+// RUN: %target-sil-opt -enable-sil-opaque-values -assume-parsing-unqualified-ownership-sil %s
+
+// REQUIRES: asserts
+
+protocol P {
+ func foo()
+}
+
+// Ensure that open_existential_addr can be used by an unqualified load.
+sil @loadFromExis : $@convention(thin) (@in P) -> () {
+bb(%0 : $P):
+ %tempP = alloc_stack $P, var
+ store %0 to %tempP : $*P
+ %opened = open_existential_addr immutable_access %tempP : $*P to $*@opened("295A5344-9728-11E7-B89E-38C9860EC692") P
+ %val = load %opened : $*@opened("295A5344-9728-11E7-B89E-38C9860EC692") P
+ %copy = copy_value %val : $@opened("295A5344-9728-11E7-B89E-38C9860EC692") P
+ %wm = witness_method $@opened("295A5344-9728-11E7-B89E-38C9860EC692") P, #P.foo!1 : <Self where Self : P> (Self) -> () -> (), %opened : $*@opened("295A5344-9728-11E7-B89E-38C9860EC692") P : $@convention(witness_method) <τ_0_0 where τ_0_0 : P> (@in_guaranteed τ_0_0) -> ()
+ %call = apply %wm<@opened("295A5344-9728-11E7-B89E-38C9860EC692") P>(%copy) : $@convention(witness_method) <τ_0_0 where τ_0_0 : P> (@in_guaranteed τ_0_0) -> ()
+ destroy_value %val : $@opened("295A5344-9728-11E7-B89E-38C9860EC692") P
+ dealloc_stack %tempP : $*P
+ %void = tuple ()
+ return %void : $()
+}
diff --git a/test/SILGen/access_marker_gen.swift b/test/SILGen/access_marker_gen.swift
index d47a390..03af5ba 100644
--- a/test/SILGen/access_marker_gen.swift
+++ b/test/SILGen/access_marker_gen.swift
@@ -66,7 +66,7 @@
}
// CHECK-LABEL: sil hidden @_T017access_marker_gen10readGlobalyXlSgyF
-// CHECK: [[ADDRESSOR:%.*]] = function_ref @_T017access_marker_gen6globalAA1SVfau :
+// CHECK: [[ADDRESSOR:%.*]] = function_ref @_T017access_marker_gen6globalAA1SVvau :
// CHECK-NEXT: [[T0:%.*]] = apply [[ADDRESSOR]]()
// CHECK-NEXT: [[T1:%.*]] = pointer_to_address [[T0]] : $Builtin.RawPointer to [strict] $*S
// CHECK-NEXT: [[T2:%.*]] = begin_access [read] [dynamic] [[T1]]
@@ -118,11 +118,11 @@
var x: Int = 0
}
// materializeForSet callback
-// CHECK-LABEL: sil private [transparent] @_T017access_marker_gen1DC1xSifmytfU_
+// CHECK-LABEL: sil private [transparent] @_T017access_marker_gen1DC1xSivmytfU_
// CHECK: end_unpaired_access [dynamic] %1 : $*Builtin.UnsafeValueBuffer
// materializeForSet
-// CHECK-LABEL: sil hidden [transparent] @_T017access_marker_gen1DC1xSifm
+// CHECK-LABEL: sil hidden [transparent] @_T017access_marker_gen1DC1xSivm
// CHECK: [[T0:%.*]] = ref_element_addr %2 : $D, #D.x
// CHECK-NEXT: begin_unpaired_access [modify] [dynamic] [[T0]] : $*Int
diff --git a/test/SILGen/accessibility_vtables.swift b/test/SILGen/accessibility_vtables.swift
index 8a48228..ef64314 100644
--- a/test/SILGen/accessibility_vtables.swift
+++ b/test/SILGen/accessibility_vtables.swift
@@ -18,13 +18,13 @@
// CHECK-LABEL: sil_vtable Sub {
// CHECK-NEXT: #Base.internalMethod!1: {{.*}} : _T028accessibility_vtables_helper4BaseC14internalMethodyyF [inherited]
-// CHECK-NEXT: #Base.prop!getter.1: {{.*}} : _T021accessibility_vtables3SubC4propSifg [override] // accessibility_vtables.Sub.prop.getter : Swift.Int
-// CHECK-NEXT: #Base.prop!setter.1: {{.*}} : _T028accessibility_vtables_helper4BaseC4propSifs [inherited] // accessibility_vtables_helper.Base.prop.setter : Swift.Int
-// CHECK-NEXT: #Base.prop!materializeForSet.1: {{.*}} : _T028accessibility_vtables_helper4BaseC4propSifm [inherited] // accessibility_vtables_helper.Base.prop.materializeForSet : Swift.Int
+// CHECK-NEXT: #Base.prop!getter.1: {{.*}} : _T021accessibility_vtables3SubC4propSivg [override] // accessibility_vtables.Sub.prop.getter : Swift.Int
+// CHECK-NEXT: #Base.prop!setter.1: {{.*}} : _T028accessibility_vtables_helper4BaseC4propSivs [inherited] // accessibility_vtables_helper.Base.prop.setter : Swift.Int
+// CHECK-NEXT: #Base.prop!materializeForSet.1: {{.*}} : _T028accessibility_vtables_helper4BaseC4propSivm [inherited] // accessibility_vtables_helper.Base.prop.materializeForSet : Swift.Int
// CHECK-NEXT: #Base.init!initializer.1: {{.*}} : _T021accessibility_vtables3SubCACycfc [override] // accessibility_vtables.Sub.init() -> accessibility_vtables.Sub
// CHECK-NEXT: #Sub.internalMethod!1: {{.*}} : _T021accessibility_vtables3SubC14internalMethodyyF
-// CHECK-NEXT: #Sub.prop!setter.1: {{.*}} : _T021accessibility_vtables3SubC4propSifs // accessibility_vtables.Sub.prop.setter : Swift.Int
-// CHECK-NEXT: #Sub.prop!materializeForSet.1: {{.*}} : _T021accessibility_vtables3SubC4propSifm // accessibility_vtables.Sub.prop.materializeForSet : Swift.Int
+// CHECK-NEXT: #Sub.prop!setter.1: {{.*}} : _T021accessibility_vtables3SubC4propSivs // accessibility_vtables.Sub.prop.setter : Swift.Int
+// CHECK-NEXT: #Sub.prop!materializeForSet.1: {{.*}} : _T021accessibility_vtables3SubC4propSivm // accessibility_vtables.Sub.prop.materializeForSet : Swift.Int
// CHECK-NEXT: #Sub.deinit
// CHECK-NEXT: }
@@ -38,13 +38,13 @@
// CHECK-LABEL: sil_vtable InternalSub {
// CHECK-NEXT: #InternalBase.method!1: {{.*}} : _T021accessibility_vtables12InternalBaseC6method{{[0-9]+}}[[DISCRIMINATOR:_.+]] [inherited]
-// CHECK-NEXT: #InternalBase.prop!getter.1: {{.*}} : _T021accessibility_vtables11InternalSubC4propSifg [override] // accessibility_vtables.InternalSub.prop.getter : Swift.Int
-// CHECK-NEXT: #InternalBase.prop!setter.1: {{.*}} : _T021accessibility_vtables12InternalBaseC4propSifs [inherited] // accessibility_vtables.InternalBase.prop.setter : Swift.Int
-// CHECK-NEXT: #InternalBase.prop!materializeForSet.1: {{.*}} : _T021accessibility_vtables12InternalBaseC4propSifm [inherited] // accessibility_vtables.InternalBase.prop.materializeForSet : Swift.Int
+// CHECK-NEXT: #InternalBase.prop!getter.1: {{.*}} : _T021accessibility_vtables11InternalSubC4propSivg [override] // accessibility_vtables.InternalSub.prop.getter : Swift.Int
+// CHECK-NEXT: #InternalBase.prop!setter.1: {{.*}} : _T021accessibility_vtables12InternalBaseC4propSivs [inherited] // accessibility_vtables.InternalBase.prop.setter : Swift.Int
+// CHECK-NEXT: #InternalBase.prop!materializeForSet.1: {{.*}} : _T021accessibility_vtables12InternalBaseC4propSivm [inherited] // accessibility_vtables.InternalBase.prop.materializeForSet : Swift.Int
// CHECK-NEXT: #InternalBase.init!initializer.1: {{.*}} : _T021accessibility_vtables11InternalSubCACycfc [override]
// CHECK-NEXT: #InternalSub.method!1: {{.*}} : _T021accessibility_vtables11InternalSubC6methodyyF
-// CHECK-NEXT: #InternalSub.prop!setter.1: {{.*}} : _T021accessibility_vtables11InternalSubC4propSifs // accessibility_vtables.InternalSub.prop.setter : Swift.Int
-// CHECK-NEXT: #InternalSub.prop!materializeForSet.1: {{.*}} : _T021accessibility_vtables11InternalSubC4propSifm // accessibility_vtables.InternalSub.prop.materializeForSet : Swift.Int
+// CHECK-NEXT: #InternalSub.prop!setter.1: {{.*}} : _T021accessibility_vtables11InternalSubC4propSivs // accessibility_vtables.InternalSub.prop.setter : Swift.Int
+// CHECK-NEXT: #InternalSub.prop!materializeForSet.1: {{.*}} : _T021accessibility_vtables11InternalSubC4propSivm // accessibility_vtables.InternalSub.prop.materializeForSet : Swift.Int
// CHECK-NEXT: #InternalSub.deinit
// CHECK-NEXT: }
diff --git a/test/SILGen/accessibility_warnings.swift b/test/SILGen/accessibility_warnings.swift
index c9f4ba2..f2584d7 100644
--- a/test/SILGen/accessibility_warnings.swift
+++ b/test/SILGen/accessibility_warnings.swift
@@ -5,7 +5,7 @@
// is valid according to SILGen and the verifiers.
public struct PublicStruct {
- // CHECK-DAG: sil{{( \[.+\])*}} @_T022accessibility_warnings12PublicStructV9publicVarSifg
+ // CHECK-DAG: sil{{( \[.+\])*}} @_T022accessibility_warnings12PublicStructV9publicVarSivg
public var publicVar = 0
// CHECK-DAG: sil hidden @_T022accessibility_warnings12PublicStructVACycfC
}
@@ -17,10 +17,10 @@
public public(set) var publicVarPublicSet = 0
- // CHECK-DAG: sil hidden @_T022accessibility_warnings14InternalStructV16publicVarGetOnlySifg
+ // CHECK-DAG: sil hidden @_T022accessibility_warnings14InternalStructV16publicVarGetOnlySivg
public var publicVarGetOnly: Int { return 0 }
- // CHECK-DAG: sil hidden @_T022accessibility_warnings14InternalStructV15publicVarGetSetSifg
+ // CHECK-DAG: sil hidden @_T022accessibility_warnings14InternalStructV15publicVarGetSetSivg
public var publicVarGetSet: Int { get { return 0 } set {} }
// CHECK-DAG: sil hidden @_T022accessibility_warnings14InternalStructVACycfC
@@ -36,7 +36,7 @@
// CHECK-DAG: sil @_T022accessibility_warnings12PublicStructVACSi1x_tcfC
public init(x: Int) { self.init() }
- // CHECK-DAG: sil @_T022accessibility_warnings12PublicStructV18publicVarExtensionSifg
+ // CHECK-DAG: sil @_T022accessibility_warnings12PublicStructV18publicVarExtensionSivg
public var publicVarExtension: Int { get { return 0 } set {} }
}
@@ -44,7 +44,7 @@
// CHECK-DAG: sil hidden @_T022accessibility_warnings14InternalStructVACSi1x_tcfC
public init(x: Int) { self.init() }
- // CHECK-DAG: sil hidden @_T022accessibility_warnings14InternalStructV18publicVarExtensionSifg
+ // CHECK-DAG: sil hidden @_T022accessibility_warnings14InternalStructV18publicVarExtensionSivg
public var publicVarExtension: Int { get { return 0 } set {} }
}
@@ -52,7 +52,7 @@
// CHECK-DAG: sil private @_T022accessibility_warnings13PrivateStruct33_5D2F2E026754A901C0FF90C404896D02LLVADSi1x_tcfC
public init(x: Int) { self.init() }
- // CHECK-DAG: sil private @_T022accessibility_warnings13PrivateStruct33_5D2F2E026754A901C0FF90C404896D02LLV18publicVarExtensionSifg
+ // CHECK-DAG: sil private @_T022accessibility_warnings13PrivateStruct33_5D2F2E026754A901C0FF90C404896D02LLV18publicVarExtensionSivg
public var publicVarExtension: Int { get { return 0 } set {} }
}
@@ -102,10 +102,10 @@
}
internal struct PrivateSettersForReadOnlyInternal : PublicReadOnlyOperations {
- // CHECK-DAG: sil hidden{{( \[.+\])*}} @_T022accessibility_warnings33PrivateSettersForReadOnlyInternalV4sizeSifg
+ // CHECK-DAG: sil hidden{{( \[.+\])*}} @_T022accessibility_warnings33PrivateSettersForReadOnlyInternalV4sizeSivg
public private(set) var size = 0
- // CHECK-DAG: sil hidden @_T022accessibility_warnings33PrivateSettersForReadOnlyInternalV9subscriptS2icfg
- // CHECK-DAG: sil private @_T022accessibility_warnings33PrivateSettersForReadOnlyInternalV9subscriptS2icfs
+ // CHECK-DAG: sil hidden @_T022accessibility_warnings33PrivateSettersForReadOnlyInternalVS2icig
+ // CHECK-DAG: sil private @_T022accessibility_warnings33PrivateSettersForReadOnlyInternalVS2icis
internal private(set) subscript (_: Int) -> Int { // no-warning
get { return 42 }
set {}
@@ -114,31 +114,31 @@
public class PublicClass {
- // CHECK-DAG: sil{{( \[.+\])*}} @_T022accessibility_warnings11PublicClassC9publicVarSifg
+ // CHECK-DAG: sil{{( \[.+\])*}} @_T022accessibility_warnings11PublicClassC9publicVarSivg
public var publicVar = 0
// CHECK-DAG: sil hidden @_T022accessibility_warnings11PublicClassCACycfc
}
internal class InternalClass {
- // CHECK-DAG: sil hidden{{( \[.+\])*}} @_T022accessibility_warnings13InternalClassC9publicVarSifg
+ // CHECK-DAG: sil hidden{{( \[.+\])*}} @_T022accessibility_warnings13InternalClassC9publicVarSivg
public var publicVar = 0
- // CHECK-DAG: sil hidden [transparent] @_T022accessibility_warnings13InternalClassC19publicVarPrivateSetSifg
+ // CHECK-DAG: sil hidden [transparent] @_T022accessibility_warnings13InternalClassC19publicVarPrivateSetSivg
public private(set) var publicVarPrivateSet = 0
public public(set) var publicVarPublicSet = 0
- // CHECK-DAG: sil hidden @_T022accessibility_warnings13InternalClassC16publicVarGetOnlySifg
+ // CHECK-DAG: sil hidden @_T022accessibility_warnings13InternalClassC16publicVarGetOnlySivg
public var publicVarGetOnly: Int { return 0 }
- // CHECK-DAG: sil hidden @_T022accessibility_warnings13InternalClassC15publicVarGetSetSifg
+ // CHECK-DAG: sil hidden @_T022accessibility_warnings13InternalClassC15publicVarGetSetSivg
public var publicVarGetSet: Int { get { return 0 } set {} }
// CHECK-DAG: sil hidden @_T022accessibility_warnings13InternalClassCACycfc
}
private class PrivateClass {
- // CHECK-DAG: sil private{{( \[.+\])*}} @_T022accessibility_warnings12PrivateClass33_5D2F2E026754A901C0FF90C404896D02LLC9publicVarSifg
+ // CHECK-DAG: sil private{{( \[.+\])*}} @_T022accessibility_warnings12PrivateClass33_5D2F2E026754A901C0FF90C404896D02LLC9publicVarSivg
public var publicVar = 0
// CHECK-DAG: sil private @_T022accessibility_warnings12PrivateClass33_5D2F2E026754A901C0FF90C404896D02LLCADycfc
}
diff --git a/test/SILGen/accessors.swift b/test/SILGen/accessors.swift
index 2e848f2..81ed0ab 100644
--- a/test/SILGen/accessors.swift
+++ b/test/SILGen/accessors.swift
@@ -45,13 +45,13 @@
// CHECK-NEXT: store [[T1]] to [init] [[TEMP]]
// CHECK-NEXT: [[T0:%.*]] = load_borrow [[TEMP]]
// CHECK-NEXT: // function_ref accessors.OrdinarySub.subscript.getter : (Swift.Int) -> Swift.Int
-// CHECK-NEXT: [[T1:%.*]] = function_ref @_T09accessors11OrdinarySubV9subscriptS2icfg
+// CHECK-NEXT: [[T1:%.*]] = function_ref @_T09accessors11OrdinarySubVS2icig
// CHECK-NEXT: [[VALUE:%.*]] = apply [[T1]]([[INDEX1]], [[T0]])
// CHECK-NEXT: end_borrow [[T0]] from [[TEMP]]
// CHECK-NEXT: destroy_addr [[TEMP]]
// Formal access to LHS.
// CHECK-NEXT: // function_ref accessors.OrdinarySub.subscript.setter : (Swift.Int) -> Swift.Int
-// CHECK-NEXT: [[SETTER:%.*]] = function_ref @_T09accessors11OrdinarySubV9subscriptS2icfs
+// CHECK-NEXT: [[SETTER:%.*]] = function_ref @_T09accessors11OrdinarySubVS2icis
// CHECK-NEXT: [[STORAGE:%.*]] = alloc_stack $Builtin.UnsafeValueBuffer
// CHECK-NEXT: [[BUFFER:%.*]] = alloc_stack $OrdinarySub
// CHECK-NEXT: [[T0:%.*]] = address_to_pointer [[BUFFER]]
@@ -123,7 +123,7 @@
// CHECK-NEXT: [[T4:%.*]] = pointer_to_address [[T3]]
// CHECK-NEXT: [[ADDR:%.*]] = mark_dependence [[T4]] : $*MutatingSub on [[BORROWED_ARG_RHS]] : $B
// CHECK-NEXT: // function_ref accessors.MutatingSub.subscript.getter : (Swift.Int) -> Swift.Int
-// CHECK-NEXT: [[T0:%.*]] = function_ref @_T09accessors11MutatingSubV9subscriptS2icfg : $@convention(method) (Int, @inout MutatingSub) -> Int
+// CHECK-NEXT: [[T0:%.*]] = function_ref @_T09accessors11MutatingSubVS2icig : $@convention(method) (Int, @inout MutatingSub) -> Int
// CHECK-NEXT: [[VALUE:%.*]] = apply [[T0]]([[INDEX1]], [[ADDR]])
// CHECK-NEXT: switch_enum [[OPT_CALLBACK]] : $Optional<Builtin.RawPointer>, case #Optional.some!enumelt.1: [[WRITEBACK:bb[0-9]+]], case #Optional.none!enumelt: [[CONT:bb[0-9]+]]
//
@@ -140,7 +140,7 @@
// CHECK: [[CONT]]:
// Formal access to LHS.
// CHECK-NEXT: // function_ref accessors.MutatingSub.subscript.setter : (Swift.Int) -> Swift.Int
-// CHECK-NEXT: [[SETTER:%.*]] = function_ref @_T09accessors11MutatingSubV9subscriptS2icfs : $@convention(method) (Int, Int, @inout MutatingSub) -> ()
+// CHECK-NEXT: [[SETTER:%.*]] = function_ref @_T09accessors11MutatingSubVS2icis : $@convention(method) (Int, Int, @inout MutatingSub) -> ()
// CHECK-NEXT: [[STORAGE2:%.*]] = alloc_stack $Builtin.UnsafeValueBuffer
// CHECK-NEXT: [[BUFFER2:%.*]] = alloc_stack $MutatingSub
// CHECK-NEXT: [[T0:%.*]] = address_to_pointer [[BUFFER2]]
@@ -191,7 +191,7 @@
}
// This uses the immutable addressor.
// CHECK: sil hidden @_T09accessors8test_recSiAA8RecOuterVzF : $@convention(thin) (@inout RecOuter) -> Int {
-// CHECK: function_ref @_T09accessors8RecOuterV5innerAA0B5InnerVflu : $@convention(method) (RecOuter) -> UnsafePointer<RecInner>
+// CHECK: function_ref @_T09accessors8RecOuterV5innerAA0B5InnerVvlu : $@convention(method) (RecOuter) -> UnsafePointer<RecInner>
struct Rec2Inner {
subscript(i: Int) -> Int {
@@ -209,4 +209,38 @@
}
// This uses the mutable addressor.
// CHECK: sil hidden @_T09accessors9test_rec2SiAA9Rec2OuterVzF : $@convention(thin) (@inout Rec2Outer) -> Int {
-// CHECK: function_ref @_T09accessors9Rec2OuterV5innerAA0B5InnerVfau : $@convention(method) (@inout Rec2Outer) -> UnsafeMutablePointer<Rec2Inner>
+// CHECK: function_ref @_T09accessors9Rec2OuterV5innerAA0B5InnerVvau : $@convention(method) (@inout Rec2Outer) -> UnsafeMutablePointer<Rec2Inner>
+
+struct Foo {
+ private subscript(privateSubscript x: Void) -> Void {
+ // CHECK-DAG: sil private @_T09accessors3FooVyyt16privateSubscript_tc33_D7F31B09EE737C687DC580B2014D759CLlig : $@convention(method) (Foo) -> () {
+ get {}
+ }
+ private(set) subscript(withPrivateSet x: Void) -> Void {
+ // CHECK-DAG: sil hidden @_T09accessors3FooVyyt14withPrivateSet_tcig : $@convention(method) (Foo) -> () {
+ get {}
+ // CHECK-DAG: sil private @_T09accessors3FooVyyt14withPrivateSet_tcis : $@convention(method) (@inout Foo) -> () {
+ set {}
+ }
+ subscript(withNestedClass x: Void) -> Void {
+ // Check for initializer of NestedClass
+ // CHECK-DAG: sil private @_T09accessors3FooVyyt15withNestedClass_tcig0dE0L_CAFycfc : $@convention(method) (@owned NestedClass) -> @owned NestedClass {
+ class NestedClass {}
+ }
+
+ // CHECK-DAG: sil private @_T09accessors3FooV15privateVariable33_D7F31B09EE737C687DC580B2014D759CLLytvg : $@convention(method) (Foo) -> () {
+ private var privateVariable: Void {
+ return
+ }
+ private(set) var variableWithPrivateSet: Void {
+ // CHECK-DAG: sil hidden @_T09accessors3FooV22variableWithPrivateSetytvg : $@convention(method) (Foo) -> () {
+ get {}
+ // CHECK-DAG: sil private @_T09accessors3FooV22variableWithPrivateSetytvs : $@convention(method) (@inout Foo) -> () {
+ set {}
+ }
+ var propertyWithNestedClass: Void {
+ // Check for initializer of NestedClass
+ // CHECK-DAG: sil private @_T09accessors3FooV23propertyWithNestedClassytvg0eF0L_CAFycfc : $@convention(method) (@owned NestedClass) -> @owned NestedClass {
+ class NestedClass {}
+ }
+}
diff --git a/test/SILGen/address_only_types.swift b/test/SILGen/address_only_types.swift
index 369ee24..b1d19c2 100644
--- a/test/SILGen/address_only_types.swift
+++ b/test/SILGen/address_only_types.swift
@@ -194,7 +194,7 @@
func address_only_assignment_from_temp_to_property() {
// CHECK: bb0:
global_prop = some_address_only_function_1()
- // CHECK: [[SETTER:%[0-9]+]] = function_ref @_T018address_only_types11global_propAA10Unloadable_pfs
+ // CHECK: [[SETTER:%[0-9]+]] = function_ref @_T018address_only_types11global_propAA10Unloadable_pvs
// CHECK: [[TEMP:%[0-9]+]] = alloc_stack $Unloadable
// CHECK: apply [[SETTER]]([[TEMP]])
// CHECK: dealloc_stack [[TEMP]]
@@ -204,7 +204,7 @@
func address_only_assignment_from_lv_to_property(_ v: Unloadable) {
// CHECK: bb0([[VARG:%[0-9]+]] : @trivial $*Unloadable):
// CHECK: debug_value_addr [[VARG]] : $*Unloadable
- // CHECK: [[SETTER:%[0-9]+]] = function_ref @_T018address_only_types11global_propAA10Unloadable_pfs
+ // CHECK: [[SETTER:%[0-9]+]] = function_ref @_T018address_only_types11global_propAA10Unloadable_pvs
// CHECK: [[TEMP:%[0-9]+]] = alloc_stack $Unloadable
// CHECK: copy_addr [[VARG]] to [initialization] [[TEMP]]
// CHECK: apply [[SETTER]]([[TEMP]])
diff --git a/test/SILGen/addressors.swift b/test/SILGen/addressors.swift
index 204a9d2..247e6c9 100644
--- a/test/SILGen/addressors.swift
+++ b/test/SILGen/addressors.swift
@@ -31,14 +31,14 @@
}
}
-// CHECK-LABEL: sil hidden @_T010addressors1AV9subscripts5Int32VAFcflu : $@convention(method) (Int32, A) -> UnsafePointer<Int32>
+// CHECK-LABEL: sil hidden @_T010addressors1AVs5Int32VAEcilu : $@convention(method) (Int32, A) -> UnsafePointer<Int32>
// CHECK: bb0([[INDEX:%.*]] : $Int32, [[SELF:%.*]] : $A):
// CHECK: [[BASE:%.*]] = struct_extract [[SELF]] : $A, #A.base
// CHECK: [[T0:%.*]] = struct_extract [[BASE]] : $UnsafeMutablePointer<Int32>, #UnsafeMutablePointer._rawValue
// CHECK: [[T1:%.*]] = struct $UnsafePointer<Int32> ([[T0]] : $Builtin.RawPointer)
// CHECK: return [[T1]] : $UnsafePointer<Int32>
-// CHECK-LABEL: sil hidden @_T010addressors1AV9subscripts5Int32VAFcfau : $@convention(method) (Int32, @inout A) -> UnsafeMutablePointer<Int32>
+// CHECK-LABEL: sil hidden @_T010addressors1AVs5Int32VAEciau : $@convention(method) (Int32, @inout A) -> UnsafeMutablePointer<Int32>
// CHECK: bb0([[INDEX:%.*]] : $Int32, [[SELF:%.*]] : $*A):
// CHECK: [[READ:%.*]] = begin_access [read] [static] [[SELF]] : $*A
// CHECK: [[T0:%.*]] = struct_element_addr [[READ]] : $*A, #A.base
@@ -54,7 +54,7 @@
// CHECK: store [[AVAL]] to [[A]]
var a = A()
-// CHECK: [[T0:%.*]] = function_ref @_T010addressors1AV9subscripts5Int32VAFcflu :
+// CHECK: [[T0:%.*]] = function_ref @_T010addressors1AVs5Int32VAEcilu :
// CHECK: [[T1:%.*]] = apply [[T0]]({{%.*}}, [[AVAL]])
// CHECK: [[T2:%.*]] = struct_extract [[T1]] : $UnsafePointer<Int32>, #UnsafePointer._rawValue
// CHECK: [[T3:%.*]] = pointer_to_address [[T2]] : $Builtin.RawPointer to [strict] $*Int32
@@ -62,7 +62,7 @@
let z = a[10]
// CHECK: [[WRITE:%.*]] = begin_access [modify] [static] [[A]] : $*A
-// CHECK: [[T0:%.*]] = function_ref @_T010addressors1AV9subscripts5Int32VAFcfau :
+// CHECK: [[T0:%.*]] = function_ref @_T010addressors1AVs5Int32VAEciau :
// CHECK: [[T1:%.*]] = apply [[T0]]({{%.*}}, [[WRITE]])
// CHECK: [[T2:%.*]] = struct_extract [[T1]] : $UnsafeMutablePointer<Int32>, #UnsafeMutablePointer._rawValue
// CHECK: [[T3:%.*]] = pointer_to_address [[T2]] : $Builtin.RawPointer to [strict] $*Int32
@@ -72,7 +72,7 @@
a[5] += z
// CHECK: [[WRITE:%.*]] = begin_access [modify] [static] [[A]] : $*A
-// CHECK: [[T0:%.*]] = function_ref @_T010addressors1AV9subscripts5Int32VAFcfau :
+// CHECK: [[T0:%.*]] = function_ref @_T010addressors1AVs5Int32VAEciau :
// CHECK: [[T1:%.*]] = apply [[T0]]({{%.*}}, [[WRITE]])
// CHECK: [[T2:%.*]] = struct_extract [[T1]] : $UnsafeMutablePointer<Int32>, #UnsafeMutablePointer._rawValue
// CHECK: [[T3:%.*]] = pointer_to_address [[T2]] : $Builtin.RawPointer to [strict] $*Int32
@@ -85,7 +85,7 @@
// CHECK: [[CTOR:%.*]] = function_ref @_T010addressors1AV{{[_0-9a-zA-Z]*}}fC
// CHECK: [[T0:%.*]] = metatype $@thin A.Type
// CHECK: [[A:%.*]] = apply [[CTOR]]([[T0]]) : $@convention(method) (@thin A.Type) -> A
-// CHECK: [[ACCESSOR:%.*]] = function_ref @_T010addressors1AV9subscripts5Int32VAFcflu : $@convention(method) (Int32, A) -> UnsafePointer<Int32>
+// CHECK: [[ACCESSOR:%.*]] = function_ref @_T010addressors1AVs5Int32VAEcilu : $@convention(method) (Int32, A) -> UnsafePointer<Int32>
// CHECK: [[PTR:%.*]] = apply [[ACCESSOR]]({{%.*}}, [[A]]) : $@convention(method) (Int32, A) -> UnsafePointer<Int32>
// CHECK: [[T0:%.*]] = struct_extract [[PTR]] : $UnsafePointer<Int32>, #UnsafePointer._rawValue
// CHECK: [[T1:%.*]] = pointer_to_address [[T0]] : $Builtin.RawPointer to [strict] $*Int32
@@ -99,8 +99,8 @@
unsafeAddress {
return UnsafePointer(uninitAddr)
}
-// CHECK: sil hidden @_T010addressors6globals5Int32Vflu : $@convention(thin) () -> UnsafePointer<Int32> {
-// CHECK: [[T0:%.*]] = global_addr @_T010addressors10uninitAddrSpys5Int32VGv : $*UnsafeMutablePointer<Int32>
+// CHECK: sil hidden @_T010addressors6globals5Int32Vvlu : $@convention(thin) () -> UnsafePointer<Int32> {
+// CHECK: [[T0:%.*]] = global_addr @_T010addressors10uninitAddrSpys5Int32VGvp : $*UnsafeMutablePointer<Int32>
// CHECK: [[T1:%.*]] = load [[T0]] : $*UnsafeMutablePointer<Int32>
// CHECK: [[T2:%.*]] = struct_extract [[T1]] : $UnsafeMutablePointer<Int32>, #UnsafeMutablePointer._rawValue
// CHECK: [[T3:%.*]] = struct $UnsafePointer<Int32> ([[T2]] : $Builtin.RawPointer)
@@ -111,7 +111,7 @@
return global
}
// CHECK-LABEL: sil hidden @_T010addressors11test_globals5Int32VyF : $@convention(thin) () -> Int32 {
-// CHECK: [[T0:%.*]] = function_ref @_T010addressors6globals5Int32Vflu : $@convention(thin) () -> UnsafePointer<Int32>
+// CHECK: [[T0:%.*]] = function_ref @_T010addressors6globals5Int32Vvlu : $@convention(thin) () -> UnsafePointer<Int32>
// CHECK: [[T1:%.*]] = apply [[T0]]() : $@convention(thin) () -> UnsafePointer<Int32>
// CHECK: [[T2:%.*]] = struct_extract [[T1]] : $UnsafePointer<Int32>, #UnsafePointer._rawValue
// CHECK: [[T3:%.*]] = pointer_to_address [[T2]] : $Builtin.RawPointer to [strict] $*Int32
@@ -137,7 +137,7 @@
// CHECK: [[INDEX:%.*]] = struct $Int32 ([[T0]] : $Builtin.Int32)
// CHECK: [[RHS:%.*]] = integer_literal $Builtin.Int32, 7
// CHECK: [[WRITE:%.*]] = begin_access [modify] [static] [[B]] : $*B
-// CHECK: [[T0:%.*]] = function_ref @_T010addressors1BV9subscripts5Int32VAFcfau
+// CHECK: [[T0:%.*]] = function_ref @_T010addressors1BVs5Int32VAEciau
// CHECK: [[PTR:%.*]] = apply [[T0]]([[INDEX]], [[WRITE]])
// CHECK: [[T0:%.*]] = struct_extract [[PTR]] : $UnsafeMutablePointer<Int32>,
// CHECK: [[ADDR:%.*]] = pointer_to_address [[T0]] : $Builtin.RawPointer to [strict] $*Int32
@@ -165,7 +165,7 @@
// CHECK: bb0([[ARRAY:%.*]] : $*CArray<(Int32) -> Int32>):
func test_carray(_ array: inout CArray<(Int32) -> Int32>) -> Int32 {
// CHECK: [[WRITE:%.*]] = begin_access [modify] [static] [[ARRAY]] : $*CArray<(Int32) -> Int32>
-// CHECK: [[T0:%.*]] = function_ref @_T010addressors6CArrayV9subscriptxSicfau :
+// CHECK: [[T0:%.*]] = function_ref @_T010addressors6CArrayVxSiciau :
// CHECK: [[T1:%.*]] = apply [[T0]]<(Int32) -> Int32>({{%.*}}, [[WRITE]])
// CHECK: [[T2:%.*]] = struct_extract [[T1]] : $UnsafeMutablePointer<(Int32) -> Int32>, #UnsafeMutablePointer._rawValue
// CHECK: [[T3:%.*]] = pointer_to_address [[T2]] : $Builtin.RawPointer to [strict] $*@callee_owned (@in Int32) -> @out Int32
@@ -174,7 +174,7 @@
// CHECK: [[READ:%.*]] = begin_access [read] [static] [[ARRAY]] : $*CArray<(Int32) -> Int32>
// CHECK: [[T0:%.*]] = load [[READ]]
-// CHECK: [[T1:%.*]] = function_ref @_T010addressors6CArrayV9subscriptxSicflu :
+// CHECK: [[T1:%.*]] = function_ref @_T010addressors6CArrayVxSicilu :
// CHECK: [[T2:%.*]] = apply [[T1]]<(Int32) -> Int32>({{%.*}}, [[T0]])
// CHECK: [[T3:%.*]] = struct_extract [[T2]] : $UnsafePointer<(Int32) -> Int32>, #UnsafePointer._rawValue
// CHECK: [[T4:%.*]] = pointer_to_address [[T3]] : $Builtin.RawPointer to [strict] $*@callee_owned (@in Int32) -> @out Int32
@@ -190,22 +190,22 @@
}
}
// Setter.
-// SILGEN-LABEL: sil hidden [transparent] @_T010addressors1DV9subscripts5Int32VAFcfs
+// SILGEN-LABEL: sil hidden [transparent] @_T010addressors1DVs5Int32VAEcis
// SILGEN: bb0([[VALUE:%.*]] : @trivial $Int32, [[I:%.*]] : @trivial $Int32, [[SELF:%.*]] : @trivial $*D):
// SILGEN: debug_value [[VALUE]] : $Int32
// SILGEN: debug_value [[I]] : $Int32
// SILGEN: debug_value_addr [[SELF]]
// SILGEN: [[ACCESS:%.*]] = begin_access [modify] [unknown] [[SELF]] : $*D // users: %12, %8
-// SILGEN: [[T0:%.*]] = function_ref @_T010addressors1DV9subscripts5Int32VAFcfau{{.*}}
+// SILGEN: [[T0:%.*]] = function_ref @_T010addressors1DVs5Int32VAEciau{{.*}}
// SILGEN: [[PTR:%.*]] = apply [[T0]]([[I]], [[ACCESS]])
// SILGEN: [[T0:%.*]] = struct_extract [[PTR]] : $UnsafeMutablePointer<Int32>,
// SILGEN: [[ADDR:%.*]] = pointer_to_address [[T0]] : $Builtin.RawPointer to [strict] $*Int32
// SILGEN: assign [[VALUE]] to [[ADDR]] : $*Int32
// materializeForSet.
-// SILGEN-LABEL: sil hidden [transparent] @_T010addressors1DV9subscripts5Int32VAFcfm
+// SILGEN-LABEL: sil hidden [transparent] @_T010addressors1DVs5Int32VAEcim
// SILGEN: bb0([[BUFFER:%.*]] : @trivial $Builtin.RawPointer, [[STORAGE:%.*]] : @trivial $*Builtin.UnsafeValueBuffer, [[I:%.*]] : @trivial $Int32, [[SELF:%.*]] : @trivial $*D):
-// SILGEN: [[T0:%.*]] = function_ref @_T010addressors1DV9subscripts5Int32VAFcfau
+// SILGEN: [[T0:%.*]] = function_ref @_T010addressors1DVs5Int32VAEciau
// SILGEN: [[PTR:%.*]] = apply [[T0]]([[I]], [[SELF]])
// SILGEN: [[ADDR_TMP:%.*]] = struct_extract [[PTR]] : $UnsafeMutablePointer<Int32>,
// SILGEN: [[ADDR:%.*]] = pointer_to_address [[ADDR_TMP]]
@@ -223,7 +223,7 @@
// CHECK: [[T0:%.*]] = function_ref @_T010addressors8make_ints5Int32VyF
// CHECK: [[V:%.*]] = apply [[T0]]()
// CHECK: [[WRITE:%.*]] = begin_access [modify] [static] [[ARRAY]] : $*D
-// CHECK: [[T0:%.*]] = function_ref @_T010addressors1DV9subscripts5Int32VAFcfau
+// CHECK: [[T0:%.*]] = function_ref @_T010addressors1DVs5Int32VAEciau
// CHECK: [[T1:%.*]] = apply [[T0]]({{%.*}}, [[WRITE]])
// CHECK: [[T2:%.*]] = struct_extract [[T1]] : $UnsafeMutablePointer<Int32>,
// CHECK: [[ADDR:%.*]] = pointer_to_address [[T2]] : $Builtin.RawPointer to [strict] $*Int32
@@ -232,7 +232,7 @@
// CHECK: [[FN:%.*]] = function_ref @_T010addressors14take_int_inoutys5Int32VzF
// CHECK: [[WRITE:%.*]] = begin_access [modify] [static] [[ARRAY]] : $*D
-// CHECK: [[T0:%.*]] = function_ref @_T010addressors1DV9subscripts5Int32VAFcfau
+// CHECK: [[T0:%.*]] = function_ref @_T010addressors1DVs5Int32VAEciau
// CHECK: [[T1:%.*]] = apply [[T0]]({{%.*}}, [[WRITE]])
// CHECK: [[T2:%.*]] = struct_extract [[T1]] : $UnsafeMutablePointer<Int32>,
// CHECK: [[ADDR:%.*]] = pointer_to_address [[T2]] : $Builtin.RawPointer to [strict] $*Int32
@@ -241,7 +241,7 @@
// CHECK: [[READ:%.*]] = begin_access [read] [static] [[ARRAY]] : $*D
// CHECK: [[T0:%.*]] = load [[READ]]
-// CHECK: [[T1:%.*]] = function_ref @_T010addressors1DV9subscripts5Int32VAFcfg
+// CHECK: [[T1:%.*]] = function_ref @_T010addressors1DVs5Int32VAEcig
// CHECK: [[T2:%.*]] = apply [[T1]]({{%.*}}, [[T0]])
// CHECK: return [[T2]]
return array[2]
@@ -256,7 +256,7 @@
// CHECK-LABEL: sil hidden @_T010addressors6test_eyAA1EVF
// CHECK: bb0([[E:%.*]] : $E):
-// CHECK: [[T0:%.*]] = function_ref @_T010addressors1EV5values5Int32Vfau
+// CHECK: [[T0:%.*]] = function_ref @_T010addressors1EV5values5Int32Vvau
// CHECK: [[T1:%.*]] = apply [[T0]]([[E]])
// CHECK: [[T2:%.*]] = struct_extract [[T1]]
// CHECK: [[T3:%.*]] = pointer_to_address [[T2]]
@@ -278,15 +278,15 @@
}
}
-// CHECK-LABEL: sil hidden @_T010addressors1FC5values5Int32Vflo : $@convention(method) (@guaranteed F) -> (UnsafePointer<Int32>, @owned Builtin.NativeObject) {
-// CHECK-LABEL: sil hidden @_T010addressors1FC5values5Int32Vfao : $@convention(method) (@guaranteed F) -> (UnsafeMutablePointer<Int32>, @owned Builtin.NativeObject) {
+// CHECK-LABEL: sil hidden @_T010addressors1FC5values5Int32Vvlo : $@convention(method) (@guaranteed F) -> (UnsafePointer<Int32>, @owned Builtin.NativeObject) {
+// CHECK-LABEL: sil hidden @_T010addressors1FC5values5Int32Vvao : $@convention(method) (@guaranteed F) -> (UnsafeMutablePointer<Int32>, @owned Builtin.NativeObject) {
func test_f0(_ f: F) -> Int32 {
return f.value
}
// CHECK-LABEL: sil hidden @_T010addressors7test_f0s5Int32VAA1FCF : $@convention(thin) (@owned F) -> Int32 {
// CHECK: bb0([[SELF:%0]] : $F):
-// CHECK: [[ADDRESSOR:%.*]] = function_ref @_T010addressors1FC5values5Int32Vflo : $@convention(method) (@guaranteed F) -> (UnsafePointer<Int32>, @owned Builtin.NativeObject)
+// CHECK: [[ADDRESSOR:%.*]] = function_ref @_T010addressors1FC5values5Int32Vvlo : $@convention(method) (@guaranteed F) -> (UnsafePointer<Int32>, @owned Builtin.NativeObject)
// CHECK: [[T0:%.*]] = apply [[ADDRESSOR]]([[SELF]])
// CHECK: [[PTR:%.*]] = tuple_extract [[T0]] : $(UnsafePointer<Int32>, Builtin.NativeObject), 0
// CHECK: [[OWNER:%.*]] = tuple_extract [[T0]] : $(UnsafePointer<Int32>, Builtin.NativeObject), 1
@@ -305,7 +305,7 @@
// CHECK: bb0([[SELF:%0]] : $F):
// CHECK: [[T0:%.*]] = integer_literal $Builtin.Int32, 14
// CHECK: [[VALUE:%.*]] = struct $Int32 ([[T0]] : $Builtin.Int32)
-// CHECK: [[ADDRESSOR:%.*]] = function_ref @_T010addressors1FC5values5Int32Vfao : $@convention(method) (@guaranteed F) -> (UnsafeMutablePointer<Int32>, @owned Builtin.NativeObject)
+// CHECK: [[ADDRESSOR:%.*]] = function_ref @_T010addressors1FC5values5Int32Vvao : $@convention(method) (@guaranteed F) -> (UnsafeMutablePointer<Int32>, @owned Builtin.NativeObject)
// CHECK: [[T0:%.*]] = apply [[ADDRESSOR]]([[SELF]])
// CHECK: [[PTR:%.*]] = tuple_extract [[T0]] : $(UnsafeMutablePointer<Int32>, Builtin.NativeObject), 0
// CHECK: [[OWNER:%.*]] = tuple_extract [[T0]] : $(UnsafeMutablePointer<Int32>, Builtin.NativeObject), 1
@@ -328,9 +328,9 @@
}
}
}
-// CHECK-LABEL: sil hidden [transparent] @_T010addressors1GC5values5Int32Vfg : $@convention(method) (@guaranteed G) -> Int32 {
+// CHECK-LABEL: sil hidden [transparent] @_T010addressors1GC5values5Int32Vvg : $@convention(method) (@guaranteed G) -> Int32 {
// CHECK: bb0([[SELF:%0]] : $G):
-// CHECK: [[ADDRESSOR:%.*]] = function_ref @_T010addressors1GC5values5Int32Vflo : $@convention(method) (@guaranteed G) -> (UnsafePointer<Int32>, @owned Builtin.NativeObject)
+// CHECK: [[ADDRESSOR:%.*]] = function_ref @_T010addressors1GC5values5Int32Vvlo : $@convention(method) (@guaranteed G) -> (UnsafePointer<Int32>, @owned Builtin.NativeObject)
// CHECK: [[T0:%.*]] = apply [[ADDRESSOR]]([[SELF]])
// CHECK: [[PTR:%.*]] = tuple_extract [[T0]] : $(UnsafePointer<Int32>, Builtin.NativeObject), 0
// CHECK: [[OWNER:%.*]] = tuple_extract [[T0]] : $(UnsafePointer<Int32>, Builtin.NativeObject), 1
@@ -341,9 +341,9 @@
// CHECK: strong_release [[OWNER]] : $Builtin.NativeObject
// CHECK: return [[VALUE]] : $Int32
-// CHECK-LABEL: sil hidden [transparent] @_T010addressors1GC5values5Int32Vfs : $@convention(method) (Int32, @guaranteed G) -> () {
+// CHECK-LABEL: sil hidden [transparent] @_T010addressors1GC5values5Int32Vvs : $@convention(method) (Int32, @guaranteed G) -> () {
// CHECK: bb0([[VALUE:%0]] : $Int32, [[SELF:%1]] : $G):
-// CHECK: [[ADDRESSOR:%.*]] = function_ref @_T010addressors1GC5values5Int32Vfao : $@convention(method) (@guaranteed G) -> (UnsafeMutablePointer<Int32>, @owned Builtin.NativeObject)
+// CHECK: [[ADDRESSOR:%.*]] = function_ref @_T010addressors1GC5values5Int32Vvao : $@convention(method) (@guaranteed G) -> (UnsafeMutablePointer<Int32>, @owned Builtin.NativeObject)
// CHECK: [[T0:%.*]] = apply [[ADDRESSOR]]([[SELF]])
// CHECK: [[PTR:%.*]] = tuple_extract [[T0]] : $(UnsafeMutablePointer<Int32>, Builtin.NativeObject), 0
// CHECK: [[OWNER:%.*]] = tuple_extract [[T0]] : $(UnsafeMutablePointer<Int32>, Builtin.NativeObject), 1
@@ -354,7 +354,7 @@
// CHECK: strong_release [[OWNER]] : $Builtin.NativeObject
// materializeForSet callback for G.value
-// CHECK-LABEL: sil private [transparent] @_T010addressors1GC5values5Int32VfmytfU_ : $@convention(method) (Builtin.RawPointer, @inout Builtin.UnsafeValueBuffer, @inout G, @thick G.Type) -> () {
+// CHECK-LABEL: sil private [transparent] @_T010addressors1GC5values5Int32VvmytfU_ : $@convention(method) (Builtin.RawPointer, @inout Builtin.UnsafeValueBuffer, @inout G, @thick G.Type) -> () {
// CHECK: bb0([[BUFFER:%0]] : $Builtin.RawPointer, [[STORAGE:%1]] : $*Builtin.UnsafeValueBuffer, [[SELF:%2]] : $*G, [[SELFTYPE:%3]] : $@thick G.Type):
// CHECK: [[T0:%.*]] = project_value_buffer $Builtin.NativeObject in [[STORAGE]] : $*Builtin.UnsafeValueBuffer
// CHECK: [[OWNER:%.*]] = load [[T0]]
@@ -362,10 +362,10 @@
// CHECK: dealloc_value_buffer $Builtin.NativeObject in [[STORAGE]] : $*Builtin.UnsafeValueBuffer
// materializeForSet for G.value
-// CHECK-LABEL: sil hidden [transparent] @_T010addressors1GC5values5Int32Vfm : $@convention(method) (Builtin.RawPointer, @inout Builtin.UnsafeValueBuffer, @guaranteed G) -> (Builtin.RawPointer, Optional<Builtin.RawPointer>) {
+// CHECK-LABEL: sil hidden [transparent] @_T010addressors1GC5values5Int32Vvm : $@convention(method) (Builtin.RawPointer, @inout Builtin.UnsafeValueBuffer, @guaranteed G) -> (Builtin.RawPointer, Optional<Builtin.RawPointer>) {
// CHECK: bb0([[BUFFER:%0]] : $Builtin.RawPointer, [[STORAGE:%1]] : $*Builtin.UnsafeValueBuffer, [[SELF:%2]] : $G):
// Call the addressor.
-// CHECK: [[ADDRESSOR:%.*]] = function_ref @_T010addressors1GC5values5Int32Vfao : $@convention(method) (@guaranteed G) -> (UnsafeMutablePointer<Int32>, @owned Builtin.NativeObject)
+// CHECK: [[ADDRESSOR:%.*]] = function_ref @_T010addressors1GC5values5Int32Vvao : $@convention(method) (@guaranteed G) -> (UnsafeMutablePointer<Int32>, @owned Builtin.NativeObject)
// CHECK: [[T0:%.*]] = apply [[ADDRESSOR]]([[SELF]])
// CHECK: [[T1:%.*]] = tuple_extract [[T0]] : $(UnsafeMutablePointer<Int32>, Builtin.NativeObject), 0
// CHECK: [[T2:%.*]] = tuple_extract [[T0]] : $(UnsafeMutablePointer<Int32>, Builtin.NativeObject), 1
@@ -378,7 +378,7 @@
// CHECK: store [[T2]] to [[T0]] : $*Builtin.NativeObject
// CHECK: [[PTR:%.*]] = address_to_pointer [[ADDR]]
// Set up the callback.
-// CHECK: [[CALLBACK_FN:%.*]] = function_ref @_T010addressors1GC5values5Int32VfmytfU_ :
+// CHECK: [[CALLBACK_FN:%.*]] = function_ref @_T010addressors1GC5values5Int32VvmytfU_ :
// CHECK: [[CALLBACK_ADDR:%.*]] = thin_function_to_pointer [[CALLBACK_FN]]
// CHECK: [[CALLBACK:%.*]] = enum $Optional<Builtin.RawPointer>, #Optional.some!enumelt.1, [[CALLBACK_ADDR]]
// Epilogue.
@@ -398,15 +398,16 @@
}
}
-// CHECK-LABEL: sil hidden @_T010addressors1HC5values5Int32Vflp : $@convention(method) (@guaranteed H) -> (UnsafePointer<Int32>, @owned Optional<Builtin.NativeObject>) {
-// CHECK-LABEL: sil hidden @_T010addressors1HC5values5Int32VfaP : $@convention(method) (@guaranteed H) -> (UnsafeMutablePointer<Int32>, @owned Optional<Builtin.NativeObject>) {
+// CHECK-LABEL: sil hidden @_T010addressors1HC5values5Int32Vvlp : $@convention(method) (@guaranteed H) -> (UnsafePointer<Int32>, @owned Optional<Builtin.NativeObject>) {
+// CHECK-LABEL: sil hidden @_T010addressors1HC5values5Int32VvaP : $@convention(method) (@guaranteed H) -> (UnsafeMutablePointer<Int32>, @owned Optional<Builtin.NativeObject>) {
func test_h0(_ f: H) -> Int32 {
return f.value
}
// CHECK-LABEL: sil hidden @_T010addressors7test_h0s5Int32VAA1HCF : $@convention(thin) (@owned H) -> Int32 {
// CHECK: bb0([[SELF:%0]] : $H):
-// CHECK: [[ADDRESSOR:%.*]] = function_ref @_T010addressors1HC5values5Int32Vflp : $@convention(method) (@guaranteed H) -> (UnsafePointer<Int32>, @owned Optional<Builtin.NativeObject>)
+// CHECK: [[ADDRESSOR:%.*]] = function_ref @_T010addressors1HC5values5Int32Vvlp : $@convention(method) (@guaranteed H) -> (UnsafePointer<Int32>, @owned Optional<Builtin.NativeObject>)
+
// CHECK: [[T0:%.*]] = apply [[ADDRESSOR]]([[SELF]])
// CHECK: [[PTR:%.*]] = tuple_extract [[T0]] : $(UnsafePointer<Int32>, Optional<Builtin.NativeObject>), 0
// CHECK: [[OWNER:%.*]] = tuple_extract [[T0]] : $(UnsafePointer<Int32>, Optional<Builtin.NativeObject>), 1
@@ -425,7 +426,7 @@
// CHECK: bb0([[SELF:%0]] : $H):
// CHECK: [[T0:%.*]] = integer_literal $Builtin.Int32, 14
// CHECK: [[VALUE:%.*]] = struct $Int32 ([[T0]] : $Builtin.Int32)
-// CHECK: [[ADDRESSOR:%.*]] = function_ref @_T010addressors1HC5values5Int32VfaP : $@convention(method) (@guaranteed H) -> (UnsafeMutablePointer<Int32>, @owned Optional<Builtin.NativeObject>)
+// CHECK: [[ADDRESSOR:%.*]] = function_ref @_T010addressors1HC5values5Int32VvaP : $@convention(method) (@guaranteed H) -> (UnsafeMutablePointer<Int32>, @owned Optional<Builtin.NativeObject>)
// CHECK: [[T0:%.*]] = apply [[ADDRESSOR]]([[SELF]])
// CHECK: [[PTR:%.*]] = tuple_extract [[T0]] : $(UnsafeMutablePointer<Int32>, Optional<Builtin.NativeObject>), 0
// CHECK: [[OWNER:%.*]] = tuple_extract [[T0]] : $(UnsafeMutablePointer<Int32>, Optional<Builtin.NativeObject>), 1
@@ -448,9 +449,9 @@
}
}
}
-// CHECK-LABEL: sil hidden [transparent] @_T010addressors1IC5values5Int32Vfg : $@convention(method) (@guaranteed I) -> Int32 {
+// CHECK-LABEL: sil hidden [transparent] @_T010addressors1IC5values5Int32Vvg : $@convention(method) (@guaranteed I) -> Int32 {
// CHECK: bb0([[SELF:%0]] : $I):
-// CHECK: [[ADDRESSOR:%.*]] = function_ref @_T010addressors1IC5values5Int32Vflp : $@convention(method) (@guaranteed I) -> (UnsafePointer<Int32>, @owned Optional<Builtin.NativeObject>)
+// CHECK: [[ADDRESSOR:%.*]] = function_ref @_T010addressors1IC5values5Int32Vvlp : $@convention(method) (@guaranteed I) -> (UnsafePointer<Int32>, @owned Optional<Builtin.NativeObject>)
// CHECK: [[T0:%.*]] = apply [[ADDRESSOR]]([[SELF]])
// CHECK: [[PTR:%.*]] = tuple_extract [[T0]] : $(UnsafePointer<Int32>, Optional<Builtin.NativeObject>), 0
// CHECK: [[OWNER:%.*]] = tuple_extract [[T0]] : $(UnsafePointer<Int32>, Optional<Builtin.NativeObject>), 1
@@ -461,9 +462,9 @@
// CHECK: strong_unpin [[OWNER]] : $Optional<Builtin.NativeObject>
// CHECK: return [[VALUE]] : $Int32
-// CHECK-LABEL: sil hidden [transparent] @_T010addressors1IC5values5Int32Vfs : $@convention(method) (Int32, @guaranteed I) -> () {
+// CHECK-LABEL: sil hidden [transparent] @_T010addressors1IC5values5Int32Vvs : $@convention(method) (Int32, @guaranteed I) -> () {
// CHECK: bb0([[VALUE:%0]] : $Int32, [[SELF:%1]] : $I):
-// CHECK: [[ADDRESSOR:%.*]] = function_ref @_T010addressors1IC5values5Int32VfaP : $@convention(method) (@guaranteed I) -> (UnsafeMutablePointer<Int32>, @owned Optional<Builtin.NativeObject>)
+// CHECK: [[ADDRESSOR:%.*]] = function_ref @_T010addressors1IC5values5Int32VvaP : $@convention(method) (@guaranteed I) -> (UnsafeMutablePointer<Int32>, @owned Optional<Builtin.NativeObject>)
// CHECK: [[T0:%.*]] = apply [[ADDRESSOR]]([[SELF]])
// CHECK: [[PTR:%.*]] = tuple_extract [[T0]] : $(UnsafeMutablePointer<Int32>, Optional<Builtin.NativeObject>), 0
// CHECK: [[OWNER:%.*]] = tuple_extract [[T0]] : $(UnsafeMutablePointer<Int32>, Optional<Builtin.NativeObject>), 1
@@ -474,17 +475,17 @@
// CHECK: strong_unpin [[OWNER]] : $Optional<Builtin.NativeObject>
// materializeForSet callback for I.value
-// CHECK-LABEL: sil private [transparent] @_T010addressors1IC5values5Int32VfmytfU_ : $@convention(method) (Builtin.RawPointer, @inout Builtin.UnsafeValueBuffer, @inout I, @thick I.Type) -> () {
+// CHECK-LABEL: sil private [transparent] @_T010addressors1IC5values5Int32VvmytfU_ : $@convention(method) (Builtin.RawPointer, @inout Builtin.UnsafeValueBuffer, @inout I, @thick I.Type) -> () {
// CHECK: bb0([[BUFFER:%0]] : $Builtin.RawPointer, [[STORAGE:%1]] : $*Builtin.UnsafeValueBuffer, [[SELF:%2]] : $*I, [[SELFTYPE:%3]] : $@thick I.Type):
// CHECK: [[T0:%.*]] = project_value_buffer $Optional<Builtin.NativeObject> in [[STORAGE]] : $*Builtin.UnsafeValueBuffer
// CHECK: [[OWNER:%.*]] = load [[T0]]
// CHECK: strong_unpin [[OWNER]] : $Optional<Builtin.NativeObject>
// CHECK: dealloc_value_buffer $Optional<Builtin.NativeObject> in [[STORAGE]] : $*Builtin.UnsafeValueBuffer
-// CHECK-LABEL: sil hidden [transparent] @_T010addressors1IC5values5Int32Vfm : $@convention(method) (Builtin.RawPointer, @inout Builtin.UnsafeValueBuffer, @guaranteed I) -> (Builtin.RawPointer, Optional<Builtin.RawPointer>) {
+// CHECK-LABEL: sil hidden [transparent] @_T010addressors1IC5values5Int32Vvm : $@convention(method) (Builtin.RawPointer, @inout Builtin.UnsafeValueBuffer, @guaranteed I) -> (Builtin.RawPointer, Optional<Builtin.RawPointer>) {
// CHECK: bb0([[BUFFER:%0]] : $Builtin.RawPointer, [[STORAGE:%1]] : $*Builtin.UnsafeValueBuffer, [[SELF:%2]] : $I):
// Call the addressor.
-// CHECK: [[ADDRESSOR:%.*]] = function_ref @_T010addressors1IC5values5Int32VfaP : $@convention(method) (@guaranteed I) -> (UnsafeMutablePointer<Int32>, @owned Optional<Builtin.NativeObject>)
+// CHECK: [[ADDRESSOR:%.*]] = function_ref @_T010addressors1IC5values5Int32VvaP : $@convention(method) (@guaranteed I) -> (UnsafeMutablePointer<Int32>, @owned Optional<Builtin.NativeObject>)
// CHECK: [[T0:%.*]] = apply [[ADDRESSOR]]([[SELF]])
// CHECK: [[T1:%.*]] = tuple_extract [[T0]] : $(UnsafeMutablePointer<Int32>, Optional<Builtin.NativeObject>), 0
// CHECK: [[T2:%.*]] = tuple_extract [[T0]] : $(UnsafeMutablePointer<Int32>, Optional<Builtin.NativeObject>), 1
@@ -497,7 +498,7 @@
// CHECK: store [[T2]] to [[T0]] : $*Optional<Builtin.NativeObject>
// CHECK: [[PTR:%.*]] = address_to_pointer [[ADDR]]
// Set up the callback.
-// CHECK: [[CALLBACK_FN:%.*]] = function_ref @_T010addressors1IC5values5Int32VfmytfU_ :
+// CHECK: [[CALLBACK_FN:%.*]] = function_ref @_T010addressors1IC5values5Int32VvmytfU_ :
// CHECK: [[CALLBACK_ADDR:%.*]] = thin_function_to_pointer [[CALLBACK_FN]]
// CHECK: [[CALLBACK:%.*]] = enum $Optional<Builtin.RawPointer>, #Optional.some!enumelt.1, [[CALLBACK_ADDR]]
// Epilogue.
@@ -528,9 +529,9 @@
}
// This uses the mutable addressor.
// CHECK-LABEL: sil hidden @_T010addressors8test_recs5Int32VAA8RecOuterCF : $@convention(thin) (@owned RecOuter) -> Int32 {
-// CHECK: function_ref @_T010addressors8RecOuterC6middleAA0B6MiddleVfaP
+// CHECK: function_ref @_T010addressors8RecOuterC6middleAA0B6MiddleVvaP
// CHECK: struct_element_addr {{.*}} : $*RecMiddle, #RecMiddle.inner
-// CHECK: function_ref @_T010addressors8RecInnerV9subscripts5Int32VAFcfg
+// CHECK: function_ref @_T010addressors8RecInnerVs5Int32VAEcig
class Base {
var data: UnsafeMutablePointer<Int32> = UnsafeMutablePointer.allocate(capacity: 100)
@@ -558,23 +559,23 @@
// Make sure addressors don't get vtable entries.
// CHECK-LABEL: sil_vtable Base {
-// CHECK-NEXT: #Base.data!getter.1: (Base) -> () -> UnsafeMutablePointer<Int32> : _T010addressors4BaseC4dataSpys5Int32VGfg
-// CHECK-NEXT: #Base.data!setter.1: (Base) -> (UnsafeMutablePointer<Int32>) -> () : _T010addressors4BaseC4dataSpys5Int32VGfs
-// CHECK-NEXT: #Base.data!materializeForSet.1: (Base) -> (Builtin.RawPointer, inout Builtin.UnsafeValueBuffer) -> (Builtin.RawPointer, Builtin.RawPointer?) : _T010addressors4BaseC4dataSpys5Int32VGfm
-// CHECK-NEXT: #Base.value!getter.1: (Base) -> () -> Int32 : _T010addressors4BaseC5values5Int32Vfg
-// CHECK-NEXT: #Base.value!setter.1: (Base) -> (Int32) -> () : _T010addressors4BaseC5values5Int32Vfs
-// CHECK-NEXT: #Base.value!materializeForSet.1: (Base) -> (Builtin.RawPointer, inout Builtin.UnsafeValueBuffer) -> (Builtin.RawPointer, Builtin.RawPointer?) : _T010addressors4BaseC5values5Int32Vfm
+// CHECK-NEXT: #Base.data!getter.1: (Base) -> () -> UnsafeMutablePointer<Int32> : _T010addressors4BaseC4dataSpys5Int32VGvg
+// CHECK-NEXT: #Base.data!setter.1: (Base) -> (UnsafeMutablePointer<Int32>) -> () : _T010addressors4BaseC4dataSpys5Int32VGvs
+// CHECK-NEXT: #Base.data!materializeForSet.1: (Base) -> (Builtin.RawPointer, inout Builtin.UnsafeValueBuffer) -> (Builtin.RawPointer, Builtin.RawPointer?) : _T010addressors4BaseC4dataSpys5Int32VGvm
+// CHECK-NEXT: #Base.value!getter.1: (Base) -> () -> Int32 : _T010addressors4BaseC5values5Int32Vvg
+// CHECK-NEXT: #Base.value!setter.1: (Base) -> (Int32) -> () : _T010addressors4BaseC5values5Int32Vvs
+// CHECK-NEXT: #Base.value!materializeForSet.1: (Base) -> (Builtin.RawPointer, inout Builtin.UnsafeValueBuffer) -> (Builtin.RawPointer, Builtin.RawPointer?) : _T010addressors4BaseC5values5Int32Vvm
// CHECK-NEXT: #Base.init!initializer.1: (Base.Type) -> () -> Base : _T010addressors4BaseCACycfc
// CHECK-NEXT: #Base.deinit!deallocator: _T010addressors4BaseCfD
// CHECK-NEXT: }
// CHECK-LABEL: sil_vtable Sub {
-// CHECK-NEXT: #Base.data!getter.1: (Base) -> () -> UnsafeMutablePointer<Int32> : _T010addressors4BaseC4dataSpys5Int32VGfg
-// CHECK-NEXT: #Base.data!setter.1: (Base) -> (UnsafeMutablePointer<Int32>) -> () : _T010addressors4BaseC4dataSpys5Int32VGfs
-// CHECK-NEXT: #Base.data!materializeForSet.1: (Base) -> (Builtin.RawPointer, inout Builtin.UnsafeValueBuffer) -> (Builtin.RawPointer, Builtin.RawPointer?) : _T010addressors4BaseC4dataSpys5Int32VGfm
-// CHECK-NEXT: #Base.value!getter.1: (Base) -> () -> Int32 : _T010addressors3SubC5values5Int32Vfg
-// CHECK-NEXT: #Base.value!setter.1: (Base) -> (Int32) -> () : _T010addressors3SubC5values5Int32Vfs
-// CHECK-NEXT: #Base.value!materializeForSet.1: (Base) -> (Builtin.RawPointer, inout Builtin.UnsafeValueBuffer) -> (Builtin.RawPointer, Builtin.RawPointer?) : _T010addressors3SubC5values5Int32Vfm
+// CHECK-NEXT: #Base.data!getter.1: (Base) -> () -> UnsafeMutablePointer<Int32> : _T010addressors4BaseC4dataSpys5Int32VGvg
+// CHECK-NEXT: #Base.data!setter.1: (Base) -> (UnsafeMutablePointer<Int32>) -> () : _T010addressors4BaseC4dataSpys5Int32VGvs
+// CHECK-NEXT: #Base.data!materializeForSet.1: (Base) -> (Builtin.RawPointer, inout Builtin.UnsafeValueBuffer) -> (Builtin.RawPointer, Builtin.RawPointer?) : _T010addressors4BaseC4dataSpys5Int32VGvm
+// CHECK-NEXT: #Base.value!getter.1: (Base) -> () -> Int32 : _T010addressors3SubC5values5Int32Vvg
+// CHECK-NEXT: #Base.value!setter.1: (Base) -> (Int32) -> () : _T010addressors3SubC5values5Int32Vvs
+// CHECK-NEXT: #Base.value!materializeForSet.1: (Base) -> (Builtin.RawPointer, inout Builtin.UnsafeValueBuffer) -> (Builtin.RawPointer, Builtin.RawPointer?) : _T010addressors3SubC5values5Int32Vvm
// CHECK-NEXT: #Base.init!initializer.1: (Base.Type) -> () -> Base : _T010addressors3SubCACycfc
// CHECK-NEXT: #Sub.deinit!deallocator: _T010addressors3SubCfD
// CHECK-NEXT: }
diff --git a/test/SILGen/arguments_as_tuple_overloads.swift b/test/SILGen/arguments_as_tuple_overloads.swift
index ade6778..be81cba 100644
--- a/test/SILGen/arguments_as_tuple_overloads.swift
+++ b/test/SILGen/arguments_as_tuple_overloads.swift
@@ -20,12 +20,12 @@
public func test(_ t: (Int, Int)) {
}
- // CHECK: sil @_T04test4PairV9subscriptS2i_Sitcfg :
+ // CHECK: sil @_T04test4PairVS2i_Sitcig :
public subscript(_:Int, _:Int) -> Int {
get { return 0 }
}
- // CHECK: sil @_T04test4PairV9subscriptS2i_Sit_tcfg :
+ // CHECK: sil @_T04test4PairVS2i_Sit_tcig :
public subscript(_:(Int, Int)) -> Int {
get { return 0 }
}
diff --git a/test/SILGen/auto_closures.swift b/test/SILGen/auto_closures.swift
index 92e3bfb..ca7dcf9 100644
--- a/test/SILGen/auto_closures.swift
+++ b/test/SILGen/auto_closures.swift
@@ -38,18 +38,18 @@
}
public class Sub : Base {
- // CHECK-LABEL: sil hidden @_T013auto_closures3SubC1xAA4BoolVfg : $@convention(method) (@guaranteed Sub) -> Bool {
+ // CHECK-LABEL: sil hidden @_T013auto_closures3SubC1xAA4BoolVvg : $@convention(method) (@guaranteed Sub) -> Bool {
// CHECK: bb0([[SELF:%.*]] : $Sub):
// CHECK: [[AUTOCLOSURE_CONSUMER:%.*]] = function_ref @_T013auto_closures05call_A8_closureAA4BoolVADyXKF : $@convention(thin)
- // CHECK: [[AUTOCLOSURE_FUNC:%.*]] = function_ref @_T013auto_closures3SubC1xAA4BoolVfgAFyXKfu_ : $@convention(thin) (@owned Sub) -> Bool
+ // CHECK: [[AUTOCLOSURE_FUNC:%.*]] = function_ref @_T013auto_closures3SubC1xAA4BoolVvgAFyXKfu_ : $@convention(thin) (@owned Sub) -> Bool
// CHECK: [[SELF_COPY:%.*]] = copy_value [[SELF]]
// CHECK: [[AUTOCLOSURE:%.*]] = partial_apply [[AUTOCLOSURE_FUNC]]([[SELF_COPY]])
// CHECK: [[RET:%.*]] = apply [[AUTOCLOSURE_CONSUMER]]([[AUTOCLOSURE]])
// CHECK: return [[RET]] : $Bool
// CHECK: }
- // CHECK-LABEL: sil private [transparent] @_T013auto_closures3SubC1xAA4BoolVfgAFyXKfu_ : $@convention(thin) (@owned Sub) -> Bool {
- // CHECK: [[SUPER:%[0-9]+]] = function_ref @_T013auto_closures4BaseC1xAA4BoolVfg : $@convention(method) (@guaranteed Base) -> Bool
+ // CHECK-LABEL: sil private [transparent] @_T013auto_closures3SubC1xAA4BoolVvgAFyXKfu_ : $@convention(thin) (@owned Sub) -> Bool {
+ // CHECK: [[SUPER:%[0-9]+]] = function_ref @_T013auto_closures4BaseC1xAA4BoolVvg : $@convention(method) (@guaranteed Base) -> Bool
// CHECK: [[RET:%.*]] = apply [[SUPER]]({{%.*}})
// CHECK: return [[RET]]
override var x: Bool { return call_auto_closure(super.x) }
diff --git a/test/SILGen/c_function_pointers.swift b/test/SILGen/c_function_pointers.swift
index bdad942..a6eaaf7 100644
--- a/test/SILGen/c_function_pointers.swift
+++ b/test/SILGen/c_function_pointers.swift
@@ -54,8 +54,8 @@
calls(unsupported, x) // expected-error{{C function pointer signature '(Any) -> Int' is not compatible with expected type '@convention(c) (Int) -> Int'}}
}
-// CHECK-LABEL: sil private @_T019c_function_pointers22StructWithInitializersV3fn1yyXCvfiyycfU_ : $@convention(thin) () -> () {
-// CHECK-LABEL: sil private [thunk] @_T019c_function_pointers22StructWithInitializersV3fn1yyXCvfiyycfU_To : $@convention(c) () -> () {
+// CHECK-LABEL: sil private @_T019c_function_pointers22StructWithInitializersV3fn1yyXCvpfiyycfU_ : $@convention(thin) () -> () {
+// CHECK-LABEL: sil private [thunk] @_T019c_function_pointers22StructWithInitializersV3fn1yyXCvpfiyycfU_To : $@convention(c) () -> () {
struct StructWithInitializers {
let fn1: @convention(c) () -> () = {}
diff --git a/test/SILGen/c_materializeForSet_linkage.swift b/test/SILGen/c_materializeForSet_linkage.swift
index 30de356..ef241bf 100644
--- a/test/SILGen/c_materializeForSet_linkage.swift
+++ b/test/SILGen/c_materializeForSet_linkage.swift
@@ -16,11 +16,11 @@
// Make sure synthesized materializeForSet and its callbacks have shared linkage
// for properties imported from Clang
-// CHECK-LABEL: sil shared [transparent] [serializable] @_T0SC7NSPointV1xSffm
-// CHECK-LABEL: sil shared [transparent] [serializable] @_T0SC7NSPointV1ySffm
+// CHECK-LABEL: sil shared [transparent] [serializable] @_T0SC7NSPointV1xSfvm
+// CHECK-LABEL: sil shared [transparent] [serializable] @_T0SC7NSPointV1ySfvm
-// CHECK-LABEL: sil shared [serializable] @_T0So16NSReferencePointC1xSffmytfU_
-// CHECK-LABEL: sil shared [serializable] @_T0So16NSReferencePointC1xSffm
+// CHECK-LABEL: sil shared [serializable] @_T0So16NSReferencePointC1xSfvmytfU_
+// CHECK-LABEL: sil shared [serializable] @_T0So16NSReferencePointC1xSfvm
-// CHECK-LABEL: sil shared [serializable] @_T0So16NSReferencePointC1ySffmytfU_
-// CHECK-LABEL: sil shared [serializable] @_T0So16NSReferencePointC1ySffm
+// CHECK-LABEL: sil shared [serializable] @_T0So16NSReferencePointC1ySfvmytfU_
+// CHECK-LABEL: sil shared [serializable] @_T0So16NSReferencePointC1ySfvm
diff --git a/test/SILGen/cf.swift b/test/SILGen/cf.swift
index 4740273..fa94723 100644
--- a/test/SILGen/cf.swift
+++ b/test/SILGen/cf.swift
@@ -65,10 +65,10 @@
extension CCImpedance: Impedance {}
-// CHECK-LABEL: sil private [transparent] [thunk] @_T0SC11CCImpedanceV2cf9ImpedanceA2cDP4real9ComponentQzfgTW
-// CHECK-LABEL: sil shared [transparent] [serializable] @_T0SC11CCImpedanceV4realSdfg
-// CHECK-LABEL: sil private [transparent] [thunk] @_T0SC11CCImpedanceV2cf9ImpedanceA2cDP4imag9ComponentQzfgTW
-// CHECK-LABEL: sil shared [transparent] [serializable] @_T0SC11CCImpedanceV4imagSdfg
+// CHECK-LABEL: sil private [transparent] [thunk] @_T0SC11CCImpedanceV2cf9ImpedanceA2cDP4real9ComponentQzvgTW
+// CHECK-LABEL: sil shared [transparent] [serializable] @_T0SC11CCImpedanceV4realSdvg
+// CHECK-LABEL: sil private [transparent] [thunk] @_T0SC11CCImpedanceV2cf9ImpedanceA2cDP4imag9ComponentQzvgTW
+// CHECK-LABEL: sil shared [transparent] [serializable] @_T0SC11CCImpedanceV4imagSdvg
class MyMagnetism : CCMagnetismModel {
// CHECK-LABEL: sil hidden [thunk] @_T02cf11MyMagnetismC15getRefrigerator{{[_0-9a-zA-Z]*}}FTo : $@convention(objc_method) (MyMagnetism) -> @autoreleased CCRefrigerator
diff --git a/test/SILGen/class_resilience.swift b/test/SILGen/class_resilience.swift
index f07131c..c9442fe 100644
--- a/test/SILGen/class_resilience.swift
+++ b/test/SILGen/class_resilience.swift
@@ -9,7 +9,7 @@
// through accessor
// CHECK-LABEL: sil @_T016class_resilience20finalPropertyOfOthery010resilient_A022ResilientOutsideParentCF
-// CHECK: function_ref @_T015resilient_class22ResilientOutsideParentC13finalPropertySSfg
+// CHECK: function_ref @_T015resilient_class22ResilientOutsideParentC13finalPropertySSvg
public func finalPropertyOfOther(_ other: ResilientOutsideParent) {
_ = other.finalProperty
diff --git a/test/SILGen/closure_inline_initializer.swift b/test/SILGen/closure_inline_initializer.swift
index 79c982a..8d1abae 100644
--- a/test/SILGen/closure_inline_initializer.swift
+++ b/test/SILGen/closure_inline_initializer.swift
@@ -1,6 +1,6 @@
// RUN: %target-swift-frontend -emit-silgen -enable-sil-ownership %s | %FileCheck %s
-// CHECK-LABEL: sil private @_T026closure_inline_initializer3FooV3fooSivfiSiycfU_
+// CHECK-LABEL: sil private @_T026closure_inline_initializer3FooV3fooSivpfiSiycfU_
struct Foo {
var foo: Int = { 2 }()
diff --git a/test/SILGen/closure_self_recursion.swift b/test/SILGen/closure_self_recursion.swift
index 67617b3..981273e 100644
--- a/test/SILGen/closure_self_recursion.swift
+++ b/test/SILGen/closure_self_recursion.swift
@@ -3,14 +3,14 @@
// CHECK-LABEL: sil @main
-// CHECK-LABEL: sil private @_T03foo5recuryycfgyycfU_
+// CHECK-LABEL: sil private @_T03foo5recuryycvgyycfU_
var recur : () -> () {
- // CHECK-LABEL: function_ref @_T03foo5recuryycfg
+ // CHECK-LABEL: function_ref @_T03foo5recuryycvg
return { recur() } // expected-warning {{attempting to access 'recur' within its own getter}}
}
-// CHECK-LABEL: sil private @_T03foo12recur_harderyycyyccfgyycyyccfU_
+// CHECK-LABEL: sil private @_T03foo12recur_harderyycyyccvgyycyyccfU_
var recur_harder : (() -> ()) -> (() -> ()) {
- // CHECK-LABEL: function_ref @_T03foo12recur_harderyycyyccfg
+ // CHECK-LABEL: function_ref @_T03foo12recur_harderyycyyccvg
return { f in recur_harder(f) } // expected-warning {{attempting to access 'recur_harder' within its own getter}}
}
diff --git a/test/SILGen/constrained_extensions.swift b/test/SILGen/constrained_extensions.swift
index 6cfa9a7..5f68d7d 100644
--- a/test/SILGen/constrained_extensions.swift
+++ b/test/SILGen/constrained_extensions.swift
@@ -8,10 +8,10 @@
self.init()
}
- // CHECK-LABEL: sil @_T0Sa22constrained_extensionsSiRszlE16instancePropertySifg : $@convention(method) (@guaranteed Array<Int>) -> Int
- // CHECK-LABEL: sil @_T0Sa22constrained_extensionsSiRszlE16instancePropertySifs : $@convention(method) (Int, @inout Array<Int>) -> ()
- // CHECK-LABEL: sil shared [transparent] [serialized] @_T0Sa22constrained_extensionsSiRszlE16instancePropertySifmytfU_ : $@convention(method) (Builtin.RawPointer, @inout Builtin.UnsafeValueBuffer, @inout Array<Int>, @thick Array<Int>.Type) -> ()
- // CHECK-LABEL: sil [transparent] [serialized] @_T0Sa22constrained_extensionsSiRszlE16instancePropertySifm : $@convention(method) (Builtin.RawPointer, @inout Builtin.UnsafeValueBuffer, @inout Array<Int>) -> (Builtin.RawPointer, Optional<Builtin.RawPointer>)
+ // CHECK-LABEL: sil @_T0Sa22constrained_extensionsSiRszlE16instancePropertySivg : $@convention(method) (@guaranteed Array<Int>) -> Int
+ // CHECK-LABEL: sil @_T0Sa22constrained_extensionsSiRszlE16instancePropertySivs : $@convention(method) (Int, @inout Array<Int>) -> ()
+ // CHECK-LABEL: sil shared [transparent] [serialized] @_T0Sa22constrained_extensionsSiRszlE16instancePropertySivmytfU_ : $@convention(method) (Builtin.RawPointer, @inout Builtin.UnsafeValueBuffer, @inout Array<Int>, @thick Array<Int>.Type) -> ()
+ // CHECK-LABEL: sil [transparent] [serialized] @_T0Sa22constrained_extensionsSiRszlE16instancePropertySivm : $@convention(method) (Builtin.RawPointer, @inout Builtin.UnsafeValueBuffer, @inout Array<Int>) -> (Builtin.RawPointer, Optional<Builtin.RawPointer>)
public var instanceProperty: Element {
get {
@@ -32,7 +32,7 @@
return e
}
- // CHECK-LABEL: sil @_T0Sa22constrained_extensionsSiRszlE14staticPropertySifgZ : $@convention(method) (@thin Array<Int>.Type) -> Int
+ // CHECK-LABEL: sil @_T0Sa22constrained_extensionsSiRszlE14staticPropertySivgZ : $@convention(method) (@thin Array<Int>.Type) -> Int
public static var staticProperty: Element {
return Array(x: ()).instanceProperty
}
@@ -48,7 +48,7 @@
return e!
}
- // CHECK-LABEL: sil @_T0Sa22constrained_extensionsSiRszlE9subscriptSiyt_tcfg : $@convention(method) (@guaranteed Array<Int>) -> Int
+ // CHECK-LABEL: sil @_T0Sa22constrained_extensionsSiRszlESiyt_tcig : $@convention(method) (@guaranteed Array<Int>) -> Int
public subscript(i: ()) -> Element {
return self[0]
}
@@ -69,10 +69,10 @@
self.init()
}
- // CHECK-LABEL: sil @_T0s10DictionaryV22constrained_extensionsSiRszr0_lE16instancePropertyq_fg : $@convention(method) <Key, Value where Key == Int> (@guaranteed Dictionary<Int, Value>) -> @out Value
- // CHECK-LABEL: sil @_T0s10DictionaryV22constrained_extensionsSiRszr0_lE16instancePropertyq_fs : $@convention(method) <Key, Value where Key == Int> (@in Value, @inout Dictionary<Int, Value>) -> ()
- // CHECK-LABEL: sil shared [transparent] [serialized] @_T0s10DictionaryV22constrained_extensionsSiRszr0_lE16instancePropertyq_fmytfU_ : $@convention(method) <Key, Value where Key == Int> (Builtin.RawPointer, @inout Builtin.UnsafeValueBuffer, @inout Dictionary<Int, Value>, @thick Dictionary<Int, Value>.Type) -> ()
- // CHECK-LABEL: sil [transparent] [serialized] @_T0s10DictionaryV22constrained_extensionsSiRszr0_lE16instancePropertyq_fm : $@convention(method) <Key, Value where Key == Int> (Builtin.RawPointer, @inout Builtin.UnsafeValueBuffer, @inout Dictionary<Int, Value>) -> (Builtin.RawPointer, Optional<Builtin.RawPointer>)
+ // CHECK-LABEL: sil @_T0s10DictionaryV22constrained_extensionsSiRszr0_lE16instancePropertyq_vg : $@convention(method) <Key, Value where Key == Int> (@guaranteed Dictionary<Int, Value>) -> @out Value
+ // CHECK-LABEL: sil @_T0s10DictionaryV22constrained_extensionsSiRszr0_lE16instancePropertyq_vs : $@convention(method) <Key, Value where Key == Int> (@in Value, @inout Dictionary<Int, Value>) -> ()
+ // CHECK-LABEL: sil shared [transparent] [serialized] @_T0s10DictionaryV22constrained_extensionsSiRszr0_lE16instancePropertyq_vmytfU_ : $@convention(method) <Key, Value where Key == Int> (Builtin.RawPointer, @inout Builtin.UnsafeValueBuffer, @inout Dictionary<Int, Value>, @thick Dictionary<Int, Value>.Type) -> ()
+ // CHECK-LABEL: sil [transparent] [serialized] @_T0s10DictionaryV22constrained_extensionsSiRszr0_lE16instancePropertyq_vm : $@convention(method) <Key, Value where Key == Int> (Builtin.RawPointer, @inout Builtin.UnsafeValueBuffer, @inout Dictionary<Int, Value>) -> (Builtin.RawPointer, Optional<Builtin.RawPointer>)
public var instanceProperty: Value {
get {
return self[0]!
@@ -97,7 +97,7 @@
return staticProperty
}
- // CHECK-LABEL: sil @_T0s10DictionaryV22constrained_extensionsSiRszr0_lE14staticPropertySifgZ : $@convention(method) <Key, Value where Key == Int> (@thin Dictionary<Int, Value>.Type) -> Int
+ // CHECK-LABEL: sil @_T0s10DictionaryV22constrained_extensionsSiRszr0_lE14staticPropertySivgZ : $@convention(method) <Key, Value where Key == Int> (@thin Dictionary<Int, Value>.Type) -> Int
public static var staticProperty: Key {
return 0
}
@@ -119,7 +119,7 @@
return Dictionary(x: ()).instanceMethod()
}
- // CHECK-LABEL: sil @_T0s10DictionaryV22constrained_extensionsSiRszr0_lE9subscriptq_yt_tcfg : $@convention(method) <Key, Value where Key == Int> (@guaranteed Dictionary<Int, Value>) -> @out Value
+ // CHECK-LABEL: sil @_T0s10DictionaryV22constrained_extensionsSiRszr0_lEq_yt_tcig : $@convention(method) <Key, Value where Key == Int> (@guaranteed Dictionary<Int, Value>) -> @out Value
public subscript(i: ()) -> Value {
return self[0]!
}
@@ -135,37 +135,37 @@
public class GenericClass<X, Y> {}
extension GenericClass where Y == () {
- // CHECK-LABEL: sil @_T022constrained_extensions12GenericClassCAAytRs_r0_lE5valuexfg : $@convention(method) <X, Y where Y == ()> (@guaranteed GenericClass<X, ()>) -> @out X
- // CHECK-LABEL: sil @_T022constrained_extensions12GenericClassCAAytRs_r0_lE5valuexfs : $@convention(method) <X, Y where Y == ()> (@in X, @guaranteed GenericClass<X, ()>) -> ()
- // CHECK-LABEL: sil shared [transparent] [serialized] @_T022constrained_extensions12GenericClassCAAytRs_r0_lE5valuexfmytfU_ : $@convention(method) <X, Y where Y == ()> (Builtin.RawPointer, @inout Builtin.UnsafeValueBuffer, @inout GenericClass<X, ()>, @thick GenericClass<X, ()>.Type) -> ()
- // CHECK-LABEL: sil [transparent] [serialized] @_T022constrained_extensions12GenericClassCAAytRs_r0_lE5valuexfm : $@convention(method) <X, Y where Y == ()> (Builtin.RawPointer, @inout Builtin.UnsafeValueBuffer, @guaranteed GenericClass<X, ()>) -> (Builtin.RawPointer, Optional<Builtin.RawPointer>)
+ // CHECK-LABEL: sil @_T022constrained_extensions12GenericClassCAAytRs_r0_lE5valuexvg : $@convention(method) <X, Y where Y == ()> (@guaranteed GenericClass<X, ()>) -> @out X
+ // CHECK-LABEL: sil @_T022constrained_extensions12GenericClassCAAytRs_r0_lE5valuexvs : $@convention(method) <X, Y where Y == ()> (@in X, @guaranteed GenericClass<X, ()>) -> ()
+ // CHECK-LABEL: sil shared [transparent] [serialized] @_T022constrained_extensions12GenericClassCAAytRs_r0_lE5valuexvmytfU_ : $@convention(method) <X, Y where Y == ()> (Builtin.RawPointer, @inout Builtin.UnsafeValueBuffer, @inout GenericClass<X, ()>, @thick GenericClass<X, ()>.Type) -> ()
+ // CHECK-LABEL: sil [transparent] [serialized] @_T022constrained_extensions12GenericClassCAAytRs_r0_lE5valuexvm : $@convention(method) <X, Y where Y == ()> (Builtin.RawPointer, @inout Builtin.UnsafeValueBuffer, @guaranteed GenericClass<X, ()>) -> (Builtin.RawPointer, Optional<Builtin.RawPointer>)
public var value: X {
get { while true {} }
set {}
}
- // CHECK-LABEL: sil @_T022constrained_extensions12GenericClassCAAytRs_r0_lE5emptyytfg : $@convention(method) <X, Y where Y == ()> (@guaranteed GenericClass<X, ()>) -> ()
- // CHECK-LABEL: sil @_T022constrained_extensions12GenericClassCAAytRs_r0_lE5emptyytfs : $@convention(method) <X, Y where Y == ()> (@guaranteed GenericClass<X, ()>) -> ()
- // CHECK-LABEL: sil shared [transparent] [serialized] @_T022constrained_extensions12GenericClassCAAytRs_r0_lE5emptyytfmytfU_ : $@convention(method) <X, Y where Y == ()> (Builtin.RawPointer, @inout Builtin.UnsafeValueBuffer, @inout GenericClass<X, ()>, @thick GenericClass<X, ()>.Type) -> ()
- // CHECK-LABEL: sil [transparent] [serialized] @_T022constrained_extensions12GenericClassCAAytRs_r0_lE5emptyytfm : $@convention(method) <X, Y where Y == ()> (Builtin.RawPointer, @inout Builtin.UnsafeValueBuffer, @guaranteed GenericClass<X, ()>) -> (Builtin.RawPointer, Optional<Builtin.RawPointer>)
+ // CHECK-LABEL: sil @_T022constrained_extensions12GenericClassCAAytRs_r0_lE5emptyytvg : $@convention(method) <X, Y where Y == ()> (@guaranteed GenericClass<X, ()>) -> ()
+ // CHECK-LABEL: sil @_T022constrained_extensions12GenericClassCAAytRs_r0_lE5emptyytvs : $@convention(method) <X, Y where Y == ()> (@guaranteed GenericClass<X, ()>) -> ()
+ // CHECK-LABEL: sil shared [transparent] [serialized] @_T022constrained_extensions12GenericClassCAAytRs_r0_lE5emptyytvmytfU_ : $@convention(method) <X, Y where Y == ()> (Builtin.RawPointer, @inout Builtin.UnsafeValueBuffer, @inout GenericClass<X, ()>, @thick GenericClass<X, ()>.Type) -> ()
+ // CHECK-LABEL: sil [transparent] [serialized] @_T022constrained_extensions12GenericClassCAAytRs_r0_lE5emptyytvm : $@convention(method) <X, Y where Y == ()> (Builtin.RawPointer, @inout Builtin.UnsafeValueBuffer, @guaranteed GenericClass<X, ()>) -> (Builtin.RawPointer, Optional<Builtin.RawPointer>)
public var empty: Y {
get { return () }
set {}
}
- // CHECK-LABEL: sil @_T022constrained_extensions12GenericClassCAAytRs_r0_lE9subscriptxyt_tcfg : $@convention(method) <X, Y where Y == ()> (@guaranteed GenericClass<X, ()>) -> @out X
- // CHECK-LABEL: sil @_T022constrained_extensions12GenericClassCAAytRs_r0_lE9subscriptxyt_tcfs : $@convention(method) <X, Y where Y == ()> (@in X, @guaranteed GenericClass<X, ()>) -> ()
- // CHECK-LABEL: sil shared [transparent] [serialized] @_T022constrained_extensions12GenericClassCAAytRs_r0_lE9subscriptxyt_tcfmytfU_ : $@convention(method) <X, Y where Y == ()> (Builtin.RawPointer, @inout Builtin.UnsafeValueBuffer, @inout GenericClass<X, ()>, @thick GenericClass<X, ()>.Type) -> ()
- // CHECK-LABEL: sil [transparent] [serialized] @_T022constrained_extensions12GenericClassCAAytRs_r0_lE9subscriptxyt_tcfm : $@convention(method) <X, Y where Y == ()> (Builtin.RawPointer, @inout Builtin.UnsafeValueBuffer, @guaranteed GenericClass<X, ()>) -> (Builtin.RawPointer, Optional<Builtin.RawPointer>)
+ // CHECK-LABEL: sil @_T022constrained_extensions12GenericClassCAAytRs_r0_lExyt_tcig : $@convention(method) <X, Y where Y == ()> (@guaranteed GenericClass<X, ()>) -> @out X
+ // CHECK-LABEL: sil @_T022constrained_extensions12GenericClassCAAytRs_r0_lExyt_tcis : $@convention(method) <X, Y where Y == ()> (@in X, @guaranteed GenericClass<X, ()>) -> ()
+ // CHECK-LABEL: sil shared [transparent] [serialized] @_T022constrained_extensions12GenericClassCAAytRs_r0_lExyt_tcimytfU_ : $@convention(method) <X, Y where Y == ()> (Builtin.RawPointer, @inout Builtin.UnsafeValueBuffer, @inout GenericClass<X, ()>, @thick GenericClass<X, ()>.Type) -> ()
+ // CHECK-LABEL: sil [transparent] [serialized] @_T022constrained_extensions12GenericClassCAAytRs_r0_lExyt_tcim : $@convention(method) <X, Y where Y == ()> (Builtin.RawPointer, @inout Builtin.UnsafeValueBuffer, @guaranteed GenericClass<X, ()>) -> (Builtin.RawPointer, Optional<Builtin.RawPointer>)
public subscript(_: Y) -> X {
get { while true {} }
set {}
}
- // CHECK-LABEL: sil @_T022constrained_extensions12GenericClassCAAytRs_r0_lE9subscriptyxcfg : $@convention(method) <X, Y where Y == ()> (@in X, @guaranteed GenericClass<X, ()>) -> ()
- // CHECK-LABEL: sil @_T022constrained_extensions12GenericClassCAAytRs_r0_lE9subscriptyxcfs : $@convention(method) <X, Y where Y == ()> (@in X, @guaranteed GenericClass<X, ()>) -> ()
- // CHECK-LABEL: sil shared [transparent] [serialized] @_T022constrained_extensions12GenericClassCAAytRs_r0_lE9subscriptyxcfmytfU_ : $@convention(method) <X, Y where Y == ()> (Builtin.RawPointer, @inout Builtin.UnsafeValueBuffer, @inout GenericClass<X, ()>, @thick GenericClass<X, ()>.Type) -> ()
- // CHECK-LABEL: sil [transparent] [serialized] @_T022constrained_extensions12GenericClassCAAytRs_r0_lE9subscriptyxcfm : $@convention(method) <X, Y where Y == ()> (Builtin.RawPointer, @inout Builtin.UnsafeValueBuffer, @in X, @guaranteed GenericClass<X, ()>) -> (Builtin.RawPointer, Optional<Builtin.RawPointer>)
+ // CHECK-LABEL: sil @_T022constrained_extensions12GenericClassCAAytRs_r0_lEyxcig : $@convention(method) <X, Y where Y == ()> (@in X, @guaranteed GenericClass<X, ()>) -> ()
+ // CHECK-LABEL: sil @_T022constrained_extensions12GenericClassCAAytRs_r0_lEyxcis : $@convention(method) <X, Y where Y == ()> (@in X, @guaranteed GenericClass<X, ()>) -> ()
+ // CHECK-LABEL: sil shared [transparent] [serialized] @_T022constrained_extensions12GenericClassCAAytRs_r0_lEyxcimytfU_ : $@convention(method) <X, Y where Y == ()> (Builtin.RawPointer, @inout Builtin.UnsafeValueBuffer, @inout GenericClass<X, ()>, @thick GenericClass<X, ()>.Type) -> ()
+ // CHECK-LABEL: sil [transparent] [serialized] @_T022constrained_extensions12GenericClassCAAytRs_r0_lEyxcim : $@convention(method) <X, Y where Y == ()> (Builtin.RawPointer, @inout Builtin.UnsafeValueBuffer, @in X, @guaranteed GenericClass<X, ()>) -> (Builtin.RawPointer, Optional<Builtin.RawPointer>)
public subscript(_: X) -> Y {
get { while true {} }
set {}
@@ -175,14 +175,14 @@
protocol VeryConstrained {}
struct AnythingGoes<T> {
- // CHECK-LABEL: sil hidden [transparent] @_T022constrained_extensions12AnythingGoesV13meaningOfLifexSgvfi : $@convention(thin) <T> () -> @out Optional<T>
+ // CHECK-LABEL: sil hidden [transparent] @_T022constrained_extensions12AnythingGoesV13meaningOfLifexSgvpfi : $@convention(thin) <T> () -> @out Optional<T>
var meaningOfLife: T? = nil
}
extension AnythingGoes where T : VeryConstrained {
// CHECK-LABEL: sil hidden @_T022constrained_extensions12AnythingGoesVA2A15VeryConstrainedRzlEACyxGyt13fromExtension_tcfC : $@convention(method) <T where T : VeryConstrained> (@thin AnythingGoes<T>.Type) -> @out AnythingGoes<T> {
- // CHECK: [[INIT:%.*]] = function_ref @_T022constrained_extensions12AnythingGoesV13meaningOfLifexSgvfi : $@convention(thin) <τ_0_0> () -> @out Optional<τ_0_0>
+ // CHECK: [[INIT:%.*]] = function_ref @_T022constrained_extensions12AnythingGoesV13meaningOfLifexSgvpfi : $@convention(thin) <τ_0_0> () -> @out Optional<τ_0_0>
// CHECK: [[RESULT:%.*]] = alloc_stack $Optional<T>
// CHECK: apply [[INIT]]<T>([[RESULT]]) : $@convention(thin) <τ_0_0> () -> @out Optional<τ_0_0>
// CHECK: return
@@ -191,7 +191,7 @@
extension Array where Element == Int {
struct Nested {
- // CHECK-LABEL: sil hidden [transparent] @_T0Sa22constrained_extensionsSiRszlE6NestedV1eSiSgvfi : $@convention(thin) () -> Optional<Int>
+ // CHECK-LABEL: sil hidden [transparent] @_T0Sa22constrained_extensionsSiRszlE6NestedV1eSiSgvpfi : $@convention(thin) () -> Optional<Int>
var e: Element? = nil
// CHECK-LABEL: sil hidden @_T0Sa22constrained_extensionsSiRszlE6NestedV10hasDefaultySiSg1e_tFfA_ : $@convention(thin) () -> Optional<Int>
@@ -213,7 +213,7 @@
}
class DerivedClass : NestedClass {
- // CHECK-LABEL: sil hidden [transparent] @_T0Sa22constrained_extensionsyXlRszlE12DerivedClassC1eyXlSgvfi : $@convention(thin) () -> @owned Optional<AnyObject>
+ // CHECK-LABEL: sil hidden [transparent] @_T0Sa22constrained_extensionsyXlRszlE12DerivedClassC1eyXlSgvpfi : $@convention(thin) () -> @owned Optional<AnyObject>
// CHECK-LABEL: sil hidden @_T0Sa22constrained_extensionsyXlRszlE12DerivedClassCfE : $@convention(method) (@guaranteed Array<AnyObject>.DerivedClass) -> ()
var e: Element? = nil
}
diff --git a/test/SILGen/copy_lvalue_peepholes.swift b/test/SILGen/copy_lvalue_peepholes.swift
index 652259d..6f76096 100644
--- a/test/SILGen/copy_lvalue_peepholes.swift
+++ b/test/SILGen/copy_lvalue_peepholes.swift
@@ -29,7 +29,7 @@
}
// CHECK-LABEL: sil hidden @_T021copy_lvalue_peepholes023init_var_from_computed_B0{{[_0-9a-zA-Z]*}}F
-// CHECK: [[GETTER:%.*]] = function_ref @_T021copy_lvalue_peepholes8computedBi64_fg
+// CHECK: [[GETTER:%.*]] = function_ref @_T021copy_lvalue_peepholes8computedBi64_vg
// CHECK: [[GOTTEN:%.*]] = apply [[GETTER]]()
// CHECK: store [[GOTTEN]] to [trivial] {{%.*}}
func init_var_from_computed_lvalue() {
@@ -41,7 +41,7 @@
// CHECK: [[PBY:%.*]] = project_box [[Y]]
// CHECK: [[READ:%.*]] = begin_access [read] [unknown] [[PBY]]
// CHECK: [[Y_VAL:%.*]] = load [trivial] [[READ]]
-// CHECK: [[SETTER:%.*]] = function_ref @_T021copy_lvalue_peepholes8computedBi64_fs
+// CHECK: [[SETTER:%.*]] = function_ref @_T021copy_lvalue_peepholes8computedBi64_vs
// CHECK: apply [[SETTER]]([[Y_VAL]])
func assign_computed_from_lvalue(y: Int) {
var y = y
diff --git a/test/SILGen/decls.swift b/test/SILGen/decls.swift
index 7ea15be..99b5bc1 100644
--- a/test/SILGen/decls.swift
+++ b/test/SILGen/decls.swift
@@ -120,7 +120,7 @@
// CHECK-LABEL: sil hidden @_T05decls16load_from_global{{[_0-9a-zA-Z]*}}F
func load_from_global() -> Int {
return global
- // CHECK: [[ACCESSOR:%[0-9]+]] = function_ref @_T05decls6globalSifau
+ // CHECK: [[ACCESSOR:%[0-9]+]] = function_ref @_T05decls6globalSivau
// CHECK: [[PTR:%[0-9]+]] = apply [[ACCESSOR]]()
// CHECK: [[ADDR:%[0-9]+]] = pointer_to_address [[PTR]]
// CHECK: [[READ:%.*]] = begin_access [read] [dynamic] [[ADDR]] : $*Int
@@ -134,7 +134,7 @@
global = x
// CHECK: [[XADDR:%[0-9]+]] = alloc_box ${ var Int }
// CHECK: [[PBX:%.*]] = project_box [[XADDR]]
- // CHECK: [[ACCESSOR:%[0-9]+]] = function_ref @_T05decls6globalSifau
+ // CHECK: [[ACCESSOR:%[0-9]+]] = function_ref @_T05decls6globalSivau
// CHECK: [[PTR:%[0-9]+]] = apply [[ACCESSOR]]()
// CHECK: [[ADDR:%[0-9]+]] = pointer_to_address [[PTR]]
// CHECK: [[READ:%.*]] = begin_access [read] [unknown] [[PBX]] : $*Int
diff --git a/test/SILGen/default_arguments.swift b/test/SILGen/default_arguments.swift
index 783d081..f2ec010 100644
--- a/test/SILGen/default_arguments.swift
+++ b/test/SILGen/default_arguments.swift
@@ -100,7 +100,7 @@
autoclosure(testMagicLiterals())
}
-// CHECK-LABEL: sil hidden @_T017default_arguments25testPropWithMagicLiteralsSifg
+// CHECK-LABEL: sil hidden @_T017default_arguments25testPropWithMagicLiteralsSivg
// CHECK: string_literal utf16 "testPropWithMagicLiterals"
var testPropWithMagicLiterals: Int {
testMagicLiterals()
@@ -127,7 +127,7 @@
autoclosure(testMagicLiterals())
}
- // CHECK-LABEL: sil hidden @_T017default_arguments3FooC9subscriptS2icfg
+ // CHECK-LABEL: sil hidden @_T017default_arguments3FooCS2icig
// CHECK: string_literal utf16 "subscript"
subscript(x: Int) -> Int {
testMagicLiterals()
diff --git a/test/SILGen/default_constructor.swift b/test/SILGen/default_constructor.swift
index 37a6a23..7ffa02b 100644
--- a/test/SILGen/default_constructor.swift
+++ b/test/SILGen/default_constructor.swift
@@ -14,7 +14,7 @@
var (i, j) : (Int, Double) = (2, 3.5)
}
-// CHECK-LABEL: sil hidden [transparent] @_T019default_constructor1DV1iSivfi : $@convention(thin) () -> (Int, Double)
+// CHECK-LABEL: sil hidden [transparent] @_T019default_constructor1DV1iSivpfi : $@convention(thin) () -> (Int, Double)
// CHECK: [[FN:%.*]] = function_ref @_T0S2iBi2048_22_builtinIntegerLiteral_tcfC : $@convention(method) (Builtin.Int2048, @thin Int.Type) -> Int
// CHECK-NEXT: [[METATYPE:%.*]] = metatype $@thin Int.Type
// CHECK-NEXT: [[VALUE:%.*]] = integer_literal $Builtin.Int2048, 2
@@ -31,7 +31,7 @@
// CHECK: [[THISBOX:%[0-9]+]] = alloc_box ${ var D }
// CHECK: [[THIS:%[0-9]+]] = mark_uninit
// CHECK: [[PB_THIS:%.*]] = project_box [[THIS]]
-// CHECK: [[INIT:%[0-9]+]] = function_ref @_T019default_constructor1DV1iSivfi
+// CHECK: [[INIT:%[0-9]+]] = function_ref @_T019default_constructor1DV1iSivpfi
// CHECK: [[RESULT:%[0-9]+]] = apply [[INIT]]()
// CHECK: [[INTVAL:%[0-9]+]] = tuple_extract [[RESULT]] : $(Int, Double), 0
// CHECK: [[FLOATVAL:%[0-9]+]] = tuple_extract [[RESULT]] : $(Int, Double), 1
@@ -55,7 +55,7 @@
// CHECK-LABEL: sil hidden @_T019default_constructor1EC{{[_0-9a-zA-Z]*}}fc : $@convention(method) (@owned E) -> @owned E
// CHECK: bb0([[SELFIN:%[0-9]+]] : @owned $E)
// CHECK: [[SELF:%[0-9]+]] = mark_uninitialized
-// CHECK: [[INIT:%[0-9]+]] = function_ref @_T019default_constructor1EC1is5Int64Vvfi : $@convention(thin) () -> Int64
+// CHECK: [[INIT:%[0-9]+]] = function_ref @_T019default_constructor1EC1is5Int64Vvpfi : $@convention(thin) () -> Int64
// CHECK-NEXT: [[VALUE:%[0-9]+]] = apply [[INIT]]() : $@convention(thin) () -> Int64
// CHECK-NEXT: [[BORROWED_SELF:%.*]] = begin_borrow [[SELF]]
// CHECK-NEXT: [[IREF:%[0-9]+]] = ref_element_addr [[BORROWED_SELF]] : $E, #E.i
@@ -103,7 +103,7 @@
var opt: T?
// CHECK-LABEL: sil hidden @_T019default_constructor1HVACyxGqd__clufC : $@convention(method) <T><U> (@in U, @thin H<T>.Type) -> @out H<T> {
- // CHECK: [[INIT_FN:%[0-9]+]] = function_ref @_T019default_constructor1HV3optxSgvfi : $@convention(thin) <τ_0_0> () -> @out Optional<τ_0_0>
+ // CHECK: [[INIT_FN:%[0-9]+]] = function_ref @_T019default_constructor1HV3optxSgvpfi : $@convention(thin) <τ_0_0> () -> @out Optional<τ_0_0>
// CHECK-NEXT: [[OPT_T:%[0-9]+]] = alloc_stack $Optional<T>
// CHECK-NEXT: apply [[INIT_FN]]<T>([[OPT_T]]) : $@convention(thin) <τ_0_0> () -> @out Optional<τ_0_0>
init<U>(_: U) { }
@@ -115,7 +115,7 @@
var x: Int = 0
// CHECK-LABEL: sil hidden @_T019default_constructor1IVACxclufC : $@convention(method) <T> (@in T, @thin I.Type) -> I {
- // CHECK: [[INIT_FN:%[0-9]+]] = function_ref @_T019default_constructor1IV1xSivfi : $@convention(thin) () -> Int
+ // CHECK: [[INIT_FN:%[0-9]+]] = function_ref @_T019default_constructor1IV1xSivpfi : $@convention(thin) () -> Int
// CHECK: [[RESULT:%[0-9]+]] = apply [[INIT_FN]]() : $@convention(thin) () -> Int
// CHECK: [[X_ADDR:%[0-9]+]] = struct_element_addr {{.*}} : $*I, #I.x
// CHECK: assign [[RESULT]] to [[X_ADDR]] : $*Int
diff --git a/test/SILGen/dynamic.swift b/test/SILGen/dynamic.swift
index 3976c52..6e0e9e1 100644
--- a/test/SILGen/dynamic.swift
+++ b/test/SILGen/dynamic.swift
@@ -68,10 +68,10 @@
// CHECK-LABEL: sil hidden [thunk] @_T07dynamic3{{[_0-9a-zA-Z]*}}fcTo
// CHECK-LABEL: sil hidden [thunk] @_T07dynamic3FooC10objcMethod{{[_0-9a-zA-Z]*}}FTo
-// CHECK-LABEL: sil hidden [transparent] [thunk] @_T07dynamic3FooC8objcPropSifgTo
-// CHECK-LABEL: sil hidden [transparent] [thunk] @_T07dynamic3FooC8objcPropSifsTo
-// CHECK-LABEL: sil hidden [thunk] @_T07dynamic3FooC9subscriptSiyXl4objc_tcfgTo
-// CHECK-LABEL: sil hidden [thunk] @_T07dynamic3FooC9subscriptSiyXl4objc_tcfsTo
+// CHECK-LABEL: sil hidden [transparent] [thunk] @_T07dynamic3FooC8objcPropSivgTo
+// CHECK-LABEL: sil hidden [transparent] [thunk] @_T07dynamic3FooC8objcPropSivsTo
+// CHECK-LABEL: sil hidden [thunk] @_T07dynamic3FooCSiyXl4objc_tcigTo
+// CHECK-LABEL: sil hidden [thunk] @_T07dynamic3FooCSiyXl4objc_tcisTo
// TODO: dynamic initializing ctor must be objc dispatched
// CHECK-LABEL: sil hidden @_T07dynamic3{{[_0-9a-zA-Z]*}}fC
@@ -81,35 +81,35 @@
// CHECK-LABEL: sil hidden [thunk] @_T07dynamic3{{[_0-9a-zA-Z]*}}fcTo
// CHECK-LABEL: sil hidden [thunk] @_T07dynamic3FooC0A6Method{{[_0-9a-zA-Z]*}}FTo
-// CHECK-LABEL: sil hidden [transparent] [thunk] @_T07dynamic3FooC0A4PropSifgTo
-// CHECK-LABEL: sil hidden [transparent] [thunk] @_T07dynamic3FooC0A4PropSifsTo
-// CHECK-LABEL: sil hidden [thunk] @_T07dynamic3FooC9subscriptS2iAA_tcfgTo
-// CHECK-LABEL: sil hidden [thunk] @_T07dynamic3FooC9subscriptS2iAA_tcfsTo
+// CHECK-LABEL: sil hidden [transparent] [thunk] @_T07dynamic3FooC0A4PropSivgTo
+// CHECK-LABEL: sil hidden [transparent] [thunk] @_T07dynamic3FooC0A4PropSivsTo
+// CHECK-LABEL: sil hidden [thunk] @_T07dynamic3FooCS2iAA_tcigTo
+// CHECK-LABEL: sil hidden [thunk] @_T07dynamic3FooCS2iAA_tcisTo
// Protocol witnesses use best appropriate dispatch
// Native witnesses use vtable dispatch:
// CHECK-LABEL: sil private [transparent] [thunk] @_T07dynamic3FooCAA5ProtoA2aDP12nativeMethod{{[_0-9a-zA-Z]*}}FTW
// CHECK: class_method {{%.*}} : $Foo, #Foo.nativeMethod!1 :
-// CHECK-LABEL: sil private [transparent] [thunk] @_T07dynamic3FooCAA5ProtoA2aDP10nativePropSifgTW
+// CHECK-LABEL: sil private [transparent] [thunk] @_T07dynamic3FooCAA5ProtoA2aDP10nativePropSivgTW
// CHECK: class_method {{%.*}} : $Foo, #Foo.nativeProp!getter.1 :
-// CHECK-LABEL: sil private [transparent] [thunk] @_T07dynamic3FooCAA5ProtoA2aDP10nativePropSifsTW
+// CHECK-LABEL: sil private [transparent] [thunk] @_T07dynamic3FooCAA5ProtoA2aDP10nativePropSivsTW
// CHECK: class_method {{%.*}} : $Foo, #Foo.nativeProp!setter.1 :
-// CHECK-LABEL: sil private [transparent] [thunk] @_T07dynamic3FooCAA5ProtoA2aDP9subscriptS2i6native_tcfgTW
+// CHECK-LABEL: sil private [transparent] [thunk] @_T07dynamic3FooCAA5ProtoA2aDPS2i6native_tcigTW
// CHECK: class_method {{%.*}} : $Foo, #Foo.subscript!getter.1 :
-// CHECK-LABEL: sil private [transparent] [thunk] @_T07dynamic3FooCAA5ProtoA2aDP9subscriptS2i6native_tcfsTW
+// CHECK-LABEL: sil private [transparent] [thunk] @_T07dynamic3FooCAA5ProtoA2aDPS2i6native_tcisTW
// CHECK: class_method {{%.*}} : $Foo, #Foo.subscript!setter.1 :
// @objc witnesses use vtable dispatch:
// CHECK-LABEL: sil private [transparent] [thunk] @_T07dynamic3FooCAA5ProtoA2aDP10objcMethod{{[_0-9a-zA-Z]*}}FTW
// CHECK: class_method {{%.*}} : $Foo, #Foo.objcMethod!1 :
-// CHECK-LABEL: sil private [transparent] [thunk] @_T07dynamic3FooCAA5ProtoA2aDP8objcPropSifgTW
+// CHECK-LABEL: sil private [transparent] [thunk] @_T07dynamic3FooCAA5ProtoA2aDP8objcPropSivgTW
// CHECK: class_method {{%.*}} : $Foo, #Foo.objcProp!getter.1 :
-// CHECK-LABEL: sil private [transparent] [thunk] @_T07dynamic3FooCAA5ProtoA2aDP8objcPropSifsTW
+// CHECK-LABEL: sil private [transparent] [thunk] @_T07dynamic3FooCAA5ProtoA2aDP8objcPropSivsTW
// CHECK: class_method {{%.*}} : $Foo, #Foo.objcProp!setter.1 :
-// CHECK-LABEL: sil private [transparent] [thunk] @_T07dynamic3FooCAA5ProtoA2aDP9subscriptSiyXl4objc_tcfgTW
+// CHECK-LABEL: sil private [transparent] [thunk] @_T07dynamic3FooCAA5ProtoA2aDPSiyXl4objc_tcigTW
// CHECK: class_method {{%.*}} : $Foo, #Foo.subscript!getter.1 :
-// CHECK-LABEL: sil private [transparent] [thunk] @_T07dynamic3FooCAA5ProtoA2aDP9subscriptSiyXl4objc_tcfsTW
+// CHECK-LABEL: sil private [transparent] [thunk] @_T07dynamic3FooCAA5ProtoA2aDPSiyXl4objc_tcisTW
// CHECK: class_method {{%.*}} : $Foo, #Foo.subscript!setter.1 :
// Dynamic witnesses use objc dispatch:
@@ -118,24 +118,24 @@
// CHECK-LABEL: sil shared [transparent] [serializable] [thunk] @_T07dynamic3FooC0A6Method{{[_0-9a-zA-Z]*}}FTD
// CHECK: class_method [volatile] {{%.*}} : $Foo, #Foo.dynamicMethod!1.foreign :
-// CHECK-LABEL: sil private [transparent] [thunk] @_T07dynamic3FooCAA5ProtoA2aDP0A4PropSifgTW
-// CHECK: function_ref @_T07dynamic3FooC0A4PropSifgTD
-// CHECK-LABEL: sil shared [transparent] [serializable] [thunk] @_T07dynamic3FooC0A4PropSifgTD
+// CHECK-LABEL: sil private [transparent] [thunk] @_T07dynamic3FooCAA5ProtoA2aDP0A4PropSivgTW
+// CHECK: function_ref @_T07dynamic3FooC0A4PropSivgTD
+// CHECK-LABEL: sil shared [transparent] [serializable] [thunk] @_T07dynamic3FooC0A4PropSivgTD
// CHECK: class_method [volatile] {{%.*}} : $Foo, #Foo.dynamicProp!getter.1.foreign :
-// CHECK-LABEL: sil private [transparent] [thunk] @_T07dynamic3FooCAA5ProtoA2aDP0A4PropSifsTW
-// CHECK: function_ref @_T07dynamic3FooC0A4PropSifsTD
-// CHECK-LABEL: sil shared [transparent] [serializable] [thunk] @_T07dynamic3FooC0A4PropSifsTD
+// CHECK-LABEL: sil private [transparent] [thunk] @_T07dynamic3FooCAA5ProtoA2aDP0A4PropSivsTW
+// CHECK: function_ref @_T07dynamic3FooC0A4PropSivsTD
+// CHECK-LABEL: sil shared [transparent] [serializable] [thunk] @_T07dynamic3FooC0A4PropSivsTD
// CHECK: class_method [volatile] {{%.*}} : $Foo, #Foo.dynamicProp!setter.1.foreign :
-// CHECK-LABEL: sil private [transparent] [thunk] @_T07dynamic3FooCAA5ProtoA2aDP9subscriptS2iAA_tcfgTW
-// CHECK: function_ref @_T07dynamic3FooC9subscriptS2iAA_tcfgTD
-// CHECK-LABEL: sil shared [transparent] [serializable] [thunk] @_T07dynamic3FooC9subscriptS2iAA_tcfgTD
+// CHECK-LABEL: sil private [transparent] [thunk] @_T07dynamic3FooCAA5ProtoA2aDPS2iAA_tcigTW
+// CHECK: function_ref @_T07dynamic3FooCS2iAA_tcigTD
+// CHECK-LABEL: sil shared [transparent] [serializable] [thunk] @_T07dynamic3FooCS2iAA_tcigTD
// CHECK: class_method [volatile] {{%.*}} : $Foo, #Foo.subscript!getter.1.foreign :
-// CHECK-LABEL: sil private [transparent] [thunk] @_T07dynamic3FooCAA5ProtoA2aDP9subscriptS2iAA_tcfsTW
-// CHECK: function_ref @_T07dynamic3FooC9subscriptS2iAA_tcfsTD
-// CHECK-LABEL: sil shared [transparent] [serializable] [thunk] @_T07dynamic3FooC9subscriptS2iAA_tcfsTD
+// CHECK-LABEL: sil private [transparent] [thunk] @_T07dynamic3FooCAA5ProtoA2aDPS2iAA_tcisTW
+// CHECK: function_ref @_T07dynamic3FooCS2iAA_tcisTD
+// CHECK-LABEL: sil shared [transparent] [serializable] [thunk] @_T07dynamic3FooCS2iAA_tcisTD
// CHECK: class_method [volatile] {{%.*}} : $Foo, #Foo.subscript!setter.1.foreign :
// Superclass dispatch
@@ -155,20 +155,20 @@
override var nativeProp: Int {
get { return super.nativeProp }
- // CHECK-LABEL: sil hidden @_T07dynamic8SubclassC10nativePropSifg
- // CHECK: function_ref @_T07dynamic3FooC10nativePropSifg : $@convention(method) (@guaranteed Foo) -> Int
+ // CHECK-LABEL: sil hidden @_T07dynamic8SubclassC10nativePropSivg
+ // CHECK: function_ref @_T07dynamic3FooC10nativePropSivg : $@convention(method) (@guaranteed Foo) -> Int
set { super.nativeProp = newValue }
- // CHECK-LABEL: sil hidden @_T07dynamic8SubclassC10nativePropSifs
- // CHECK: function_ref @_T07dynamic3FooC10nativePropSifs : $@convention(method) (Int, @guaranteed Foo) -> ()
+ // CHECK-LABEL: sil hidden @_T07dynamic8SubclassC10nativePropSivs
+ // CHECK: function_ref @_T07dynamic3FooC10nativePropSivs : $@convention(method) (Int, @guaranteed Foo) -> ()
}
override subscript(native native: Int) -> Int {
get { return super[native: native] }
- // CHECK-LABEL: sil hidden @_T07dynamic8SubclassC9subscriptS2i6native_tcfg
- // CHECK: function_ref @_T07dynamic3FooC9subscriptS2i6native_tcfg : $@convention(method) (Int, @guaranteed Foo) -> Int
+ // CHECK-LABEL: sil hidden @_T07dynamic8SubclassCS2i6native_tcig
+ // CHECK: function_ref @_T07dynamic3FooCS2i6native_tcig : $@convention(method) (Int, @guaranteed Foo) -> Int
set { super[native: native] = newValue }
- // CHECK-LABEL: sil hidden @_T07dynamic8SubclassC9subscriptS2i6native_tcfs
- // CHECK: function_ref @_T07dynamic3FooC9subscriptS2i6native_tcfs : $@convention(method) (Int, Int, @guaranteed Foo) -> ()
+ // CHECK-LABEL: sil hidden @_T07dynamic8SubclassCS2i6native_tcis
+ // CHECK: function_ref @_T07dynamic3FooCS2i6native_tcis : $@convention(method) (Int, Int, @guaranteed Foo) -> ()
}
override init(objc: Int) {
@@ -185,20 +185,20 @@
override var objcProp: Int {
get { return super.objcProp }
- // CHECK-LABEL: sil hidden @_T07dynamic8SubclassC8objcPropSifg
- // CHECK: function_ref @_T07dynamic3FooC8objcPropSifg : $@convention(method) (@guaranteed Foo) -> Int
+ // CHECK-LABEL: sil hidden @_T07dynamic8SubclassC8objcPropSivg
+ // CHECK: function_ref @_T07dynamic3FooC8objcPropSivg : $@convention(method) (@guaranteed Foo) -> Int
set { super.objcProp = newValue }
- // CHECK-LABEL: sil hidden @_T07dynamic8SubclassC8objcPropSifs
- // CHECK: function_ref @_T07dynamic3FooC8objcPropSifs : $@convention(method) (Int, @guaranteed Foo) -> ()
+ // CHECK-LABEL: sil hidden @_T07dynamic8SubclassC8objcPropSivs
+ // CHECK: function_ref @_T07dynamic3FooC8objcPropSivs : $@convention(method) (Int, @guaranteed Foo) -> ()
}
override subscript(objc objc: AnyObject) -> Int {
get { return super[objc: objc] }
- // CHECK-LABEL: sil hidden @_T07dynamic8SubclassC9subscriptSiyXl4objc_tcfg
- // CHECK: function_ref @_T07dynamic3FooC9subscriptSiyXl4objc_tcfg : $@convention(method) (@owned AnyObject, @guaranteed Foo) -> Int
+ // CHECK-LABEL: sil hidden @_T07dynamic8SubclassCSiyXl4objc_tcig
+ // CHECK: function_ref @_T07dynamic3FooCSiyXl4objc_tcig : $@convention(method) (@owned AnyObject, @guaranteed Foo) -> Int
set { super[objc: objc] = newValue }
- // CHECK-LABEL: sil hidden @_T07dynamic8SubclassC9subscriptSiyXl4objc_tcfs
- // CHECK: function_ref @_T07dynamic3FooC9subscriptSiyXl4objc_tcfs : $@convention(method) (Int, @owned AnyObject, @guaranteed Foo) -> ()
+ // CHECK-LABEL: sil hidden @_T07dynamic8SubclassCSiyXl4objc_tcis
+ // CHECK: function_ref @_T07dynamic3FooCSiyXl4objc_tcis : $@convention(method) (Int, @owned AnyObject, @guaranteed Foo) -> ()
}
// Dynamic methods are super-dispatched by objc_msgSend
@@ -216,19 +216,19 @@
override var dynamicProp: Int {
get { return super.dynamicProp }
- // CHECK-LABEL: sil hidden @_T07dynamic8SubclassC0A4PropSifg
+ // CHECK-LABEL: sil hidden @_T07dynamic8SubclassC0A4PropSivg
// CHECK: super_method [volatile] {{%.*}} : $Subclass, #Foo.dynamicProp!getter.1.foreign :
set { super.dynamicProp = newValue }
- // CHECK-LABEL: sil hidden @_T07dynamic8SubclassC0A4PropSifs
+ // CHECK-LABEL: sil hidden @_T07dynamic8SubclassC0A4PropSivs
// CHECK: super_method [volatile] {{%.*}} : $Subclass, #Foo.dynamicProp!setter.1.foreign :
}
override subscript(dynamic dynamic: Int) -> Int {
get { return super[dynamic: dynamic] }
- // CHECK-LABEL: sil hidden @_T07dynamic8SubclassC9subscriptS2iAA_tcfg
+ // CHECK-LABEL: sil hidden @_T07dynamic8SubclassCS2iAA_tcig
// CHECK: super_method [volatile] {{%.*}} : $Subclass, #Foo.subscript!getter.1.foreign :
set { super[dynamic: dynamic] = newValue }
- // CHECK-LABEL: sil hidden @_T07dynamic8SubclassC9subscriptS2iAA_tcfs
+ // CHECK-LABEL: sil hidden @_T07dynamic8SubclassCS2iAA_tcis
// CHECK: super_method [volatile] {{%.*}} : $Subclass, #Foo.subscript!setter.1.foreign :
}
@@ -443,15 +443,15 @@
}
public class Sub : Base {
- // CHECK-LABEL: sil hidden @_T07dynamic3SubC1xSbfg : $@convention(method) (@guaranteed Sub) -> Bool {
+ // CHECK-LABEL: sil hidden @_T07dynamic3SubC1xSbvg : $@convention(method) (@guaranteed Sub) -> Bool {
// CHECK: bb0([[SELF:%.*]] : $Sub):
- // CHECK: [[AUTOCLOSURE:%.*]] = function_ref @_T07dynamic3SubC1xSbfgSbyKXKfu_ : $@convention(thin) (@owned Sub) -> (Bool, @error Error)
+ // CHECK: [[AUTOCLOSURE:%.*]] = function_ref @_T07dynamic3SubC1xSbvgSbyKXKfu_ : $@convention(thin) (@owned Sub) -> (Bool, @error Error)
// CHECK: [[SELF_COPY:%.*]] = copy_value [[SELF]]
// CHECK: = partial_apply [[AUTOCLOSURE]]([[SELF_COPY]])
// CHECK: return {{%.*}} : $Bool
- // CHECK: } // end sil function '_T07dynamic3SubC1xSbfg'
+ // CHECK: } // end sil function '_T07dynamic3SubC1xSbvg'
- // CHECK-LABEL: sil private [transparent] @_T07dynamic3SubC1xSbfgSbyKXKfu_ : $@convention(thin) (@owned Sub) -> (Bool, @error Error) {
+ // CHECK-LABEL: sil private [transparent] @_T07dynamic3SubC1xSbvgSbyKXKfu_ : $@convention(thin) (@owned Sub) -> (Bool, @error Error) {
// CHECK: bb0([[VALUE:%.*]] : $Sub):
// CHECK: [[BORROWED_VALUE:%.*]] = begin_borrow [[VALUE]]
// CHECK: [[VALUE_COPY:%.*]] = copy_value [[BORROWED_VALUE]]
@@ -461,10 +461,10 @@
// CHECK: [[SUPER:%.*]] = super_method [volatile] [[DOWNCAST_FOR_SUPERMETHOD]] : $Sub, #Base.x!getter.1.foreign : (Base) -> () -> Bool, $@convention(objc_method) (Base) -> ObjCBool
// CHECK: end_borrow [[BORROWED_CASTED_VALUE_COPY]]
// CHECK: = apply [[SUPER]]([[CASTED_VALUE_COPY]])
- // CHECK: destroy_value [[VALUE_COPY]]
+ // CHECK: destroy_value [[CASTED_VALUE_COPY]]
// CHECK: end_borrow [[BORROWED_VALUE]] from [[VALUE]]
// CHECK: destroy_value [[VALUE]]
- // CHECK: } // end sil function '_T07dynamic3SubC1xSbfgSbyKXKfu_'
+ // CHECK: } // end sil function '_T07dynamic3SubC1xSbvgSbyKXKfu_'
override var x: Bool { return false || super.x }
}
@@ -505,19 +505,19 @@
// CHECK-LABEL: sil_vtable Foo {
// CHECK-NEXT: #Foo.init!initializer.1: {{.*}} : _T07dynamic3FooCACSi6native_tcfc
// CHECK-NEXT: #Foo.nativeMethod!1: {{.*}} : _T07dynamic3FooC12nativeMethodyyF
-// CHECK-NEXT: #Foo.nativeProp!getter.1: {{.*}} : _T07dynamic3FooC10nativePropSifg // dynamic.Foo.nativeProp.getter : Swift.Int
-// CHECK-NEXT: #Foo.nativeProp!setter.1: {{.*}} : _T07dynamic3FooC10nativePropSifs // dynamic.Foo.nativeProp.setter : Swift.Int
+// CHECK-NEXT: #Foo.nativeProp!getter.1: {{.*}} : _T07dynamic3FooC10nativePropSivg // dynamic.Foo.nativeProp.getter : Swift.Int
+// CHECK-NEXT: #Foo.nativeProp!setter.1: {{.*}} : _T07dynamic3FooC10nativePropSivs // dynamic.Foo.nativeProp.setter : Swift.Int
// CHECK-NEXT: #Foo.nativeProp!materializeForSet.1
-// CHECK-NEXT: #Foo.subscript!getter.1: {{.*}} : _T07dynamic3FooC9subscriptS2i6native_tcfg // dynamic.Foo.subscript.getter : (native: Swift.Int) -> Swift.Int
-// CHECK-NEXT: #Foo.subscript!setter.1: {{.*}} : _T07dynamic3FooC9subscriptS2i6native_tcfs // dynamic.Foo.subscript.setter : (native: Swift.Int) -> Swift.Int
+// CHECK-NEXT: #Foo.subscript!getter.1: {{.*}} : _T07dynamic3FooCS2i6native_tcig // dynamic.Foo.subscript.getter : (native: Swift.Int) -> Swift.Int
+// CHECK-NEXT: #Foo.subscript!setter.1: {{.*}} : _T07dynamic3FooCS2i6native_tcis // dynamic.Foo.subscript.setter : (native: Swift.Int) -> Swift.Int
// CHECK-NEXT: #Foo.subscript!materializeForSet.1
// CHECK-NEXT: #Foo.init!initializer.1: {{.*}} : _T07dynamic3FooCACSi4objc_tcfc
// CHECK-NEXT: #Foo.objcMethod!1: {{.*}} : _T07dynamic3FooC10objcMethodyyF
-// CHECK-NEXT: #Foo.objcProp!getter.1: {{.*}} : _T07dynamic3FooC8objcPropSifg // dynamic.Foo.objcProp.getter : Swift.Int
-// CHECK-NEXT: #Foo.objcProp!setter.1: {{.*}} : _T07dynamic3FooC8objcPropSifs // dynamic.Foo.objcProp.setter : Swift.Int
+// CHECK-NEXT: #Foo.objcProp!getter.1: {{.*}} : _T07dynamic3FooC8objcPropSivg // dynamic.Foo.objcProp.getter : Swift.Int
+// CHECK-NEXT: #Foo.objcProp!setter.1: {{.*}} : _T07dynamic3FooC8objcPropSivs // dynamic.Foo.objcProp.setter : Swift.Int
// CHECK-NEXT: #Foo.objcProp!materializeForSet.1
-// CHECK-NEXT: #Foo.subscript!getter.1: {{.*}} : _T07dynamic3FooC9subscriptSiyXl4objc_tcfg // dynamic.Foo.subscript.getter : (objc: Swift.AnyObject) -> Swift.Int
-// CHECK-NEXT: #Foo.subscript!setter.1: {{.*}} : _T07dynamic3FooC9subscriptSiyXl4objc_tcfs // dynamic.Foo.subscript.setter : (objc: Swift.AnyObject) -> Swift.Int
+// CHECK-NEXT: #Foo.subscript!getter.1: {{.*}} : _T07dynamic3FooCSiyXl4objc_tcig // dynamic.Foo.subscript.getter : (objc: Swift.AnyObject) -> Swift.Int
+// CHECK-NEXT: #Foo.subscript!setter.1: {{.*}} : _T07dynamic3FooCSiyXl4objc_tcis // dynamic.Foo.subscript.setter : (objc: Swift.AnyObject) -> Swift.Int
// CHECK-NEXT: #Foo.subscript!materializeForSet
// CHECK-NEXT: #Foo.overriddenByDynamic!1: {{.*}} : _T07dynamic3FooC19overriddenByDynamic{{[_0-9a-zA-Z]*}}
// CHECK-NEXT: #Foo.deinit!deallocator: {{.*}}
diff --git a/test/SILGen/errors.swift b/test/SILGen/errors.swift
index c1dc053..14478ba 100644
--- a/test/SILGen/errors.swift
+++ b/test/SILGen/errors.swift
@@ -633,7 +633,7 @@
// CHECK-NEXT: [[TEMP:%.*]] = alloc_stack $Pylon
// CHECK-NEXT: [[BASE:%.*]] = load_borrow [[WRITE]] : $*Bridge
// CHECK-NEXT: // function_ref
-// CHECK-NEXT: [[GETTER:%.*]] = function_ref @_T06errors6BridgeV9subscriptAA5PylonVSScfg :
+// CHECK-NEXT: [[GETTER:%.*]] = function_ref @_T06errors6BridgeVAA5PylonVSScig :
// CHECK-NEXT: [[T0:%.*]] = apply [[GETTER]]([[INDEX_COPY_1]], [[BASE]])
// CHECK-NEXT: store [[T0]] to [init] [[TEMP]]
// CHECK-NEXT: end_borrow [[BASE]] from [[WRITE]]
@@ -642,7 +642,7 @@
// CHECK: [[BB_NORMAL]]
// CHECK-NEXT: [[T0:%.*]] = load [take] [[TEMP]]
// CHECK-NEXT: // function_ref
-// CHECK-NEXT: [[SETTER:%.*]] = function_ref @_T06errors6BridgeV9subscriptAA5PylonVSScfs :
+// CHECK-NEXT: [[SETTER:%.*]] = function_ref @_T06errors6BridgeVAA5PylonVSScis :
// CHECK-NEXT: apply [[SETTER]]([[T0]], [[INDEX_COPY_2]], [[WRITE]])
// CHECK-NEXT: end_access [[WRITE]]
// CHECK-NEXT: dealloc_stack [[TEMP]]
@@ -657,7 +657,7 @@
// CHECK-NEXT: [[T0:%.*]] = load [copy] [[TEMP]]
// CHECK-NEXT: [[INDEX_COPY_2_COPY:%.*]] = copy_value [[INDEX_COPY_2]]
// CHECK-NEXT: // function_ref
-// CHECK-NEXT: [[SETTER:%.*]] = function_ref @_T06errors6BridgeV9subscriptAA5PylonVSScfs :
+// CHECK-NEXT: [[SETTER:%.*]] = function_ref @_T06errors6BridgeVAA5PylonVSScis :
// CHECK-NEXT: apply [[SETTER]]([[T0]], [[INDEX_COPY_2_COPY]], [[WRITE]])
// CHECK-NEXT: destroy_addr [[TEMP]]
// CHECK-NEXT: dealloc_stack [[TEMP]]
@@ -686,7 +686,7 @@
// CHECK: [[ARG2_COPY:%.*]] = copy_value [[BORROWED_ARG2]] : $String
// CHECK: [[WRITE:%.*]] = begin_access [modify] [unknown] %0 : $*OwnedBridge
// CHECK-NEXT: // function_ref
-// CHECK-NEXT: [[ADDRESSOR:%.*]] = function_ref @_T06errors11OwnedBridgeV9subscriptAA5PylonVSScfaO :
+// CHECK-NEXT: [[ADDRESSOR:%.*]] = function_ref @_T06errors11OwnedBridgeVAA5PylonVSSciaO :
// CHECK-NEXT: [[T0:%.*]] = apply [[ADDRESSOR]]([[ARG2_COPY]], [[WRITE]])
// CHECK-NEXT: [[BORROWED_T0:%.*]] = begin_borrow [[T0]]
// CHECK-NEXT: [[T1:%.*]] = tuple_extract [[BORROWED_T0]] : {{.*}}, 0
@@ -730,7 +730,7 @@
// CHECK: [[ARG2_COPY:%.*]] = copy_value [[BORROWED_ARG2]] : $String
// CHECK-NEXT: [[WRITE:%.*]] = begin_access [modify] [unknown] [[ARG1]] : $*PinnedBridge
// CHECK-NEXT: // function_ref
-// CHECK-NEXT: [[ADDRESSOR:%.*]] = function_ref @_T06errors12PinnedBridgeV9subscriptAA5PylonVSScfaP :
+// CHECK-NEXT: [[ADDRESSOR:%.*]] = function_ref @_T06errors12PinnedBridgeVAA5PylonVSSciaP :
// CHECK-NEXT: [[T0:%.*]] = apply [[ADDRESSOR]]([[ARG2_COPY]], [[WRITE]])
// CHECK-NEXT: [[BORROWED_T0:%.*]] = begin_borrow [[T0]]
// CHECK-NEXT: [[T1:%.*]] = tuple_extract [[BORROWED_T0]] : {{.*}}, 0
diff --git a/test/SILGen/expressions.swift b/test/SILGen/expressions.swift
index 24189db..a6934c6 100644
--- a/test/SILGen/expressions.swift
+++ b/test/SILGen/expressions.swift
@@ -197,7 +197,7 @@
// CHECK-LABEL: sil hidden @_T011expressions11module_path{{[_0-9a-zA-Z]*}}F
func module_path() -> Int {
return FooBar.x
- // CHECK: [[x_GET:%[0-9]+]] = function_ref @_T06FooBar1xSifau
+ // CHECK: [[x_GET:%[0-9]+]] = function_ref @_T06FooBar1xSivau
// CHECK-NEXT: apply [[x_GET]]()
}
diff --git a/test/SILGen/extensions.swift b/test/SILGen/extensions.swift
index 1e854f0..190c8eb 100644
--- a/test/SILGen/extensions.swift
+++ b/test/SILGen/extensions.swift
@@ -9,7 +9,7 @@
// CHECK-LABEL: sil hidden @_T010extensions3FooC4zang{{[_0-9a-zA-Z]*}}F
func zang() {}
- // CHECK-LABEL: sil hidden @_T010extensions3FooC7zippitySifg
+ // CHECK-LABEL: sil hidden @_T010extensions3FooC7zippitySivg
var zippity: Int { return 0 }
}
@@ -28,7 +28,7 @@
// Non-objc extension methods are statically dispatched.
// CHECK: function_ref @_T010extensions3FooC4zang{{[_0-9a-zA-Z]*}}F
x.zang()
- // CHECK: function_ref @_T010extensions3FooC7zippitySifg
+ // CHECK: function_ref @_T010extensions3FooC7zippitySivg
_ = x.zippity
}
@@ -42,7 +42,7 @@
// Extensions of generic types with stored property initializers
-// CHECK-LABEL: sil hidden [transparent] @_T010extensions3BoxV1txSgvfi : $@convention(thin) <T> () -> @out Optional<T>
+// CHECK-LABEL: sil hidden [transparent] @_T010extensions3BoxV1txSgvpfi : $@convention(thin) <T> () -> @out Optional<T>
// CHECK: bb0(%0 : @trivial $*Optional<T>):
// CHECK: [[FN:%.*]] = function_ref @_T0SqxSgyt10nilLiteral_tcfC : $@convention(method) <τ_0_0> (@thin Optional<τ_0_0>.Type) -> @out Optional<τ_0_0>
// CHECK-NEXT: [[METATYPE:%.*]] = metatype $@thin Optional<T>.Type
@@ -58,7 +58,7 @@
// CHECK: [[SELF_BOX:%.*]] = alloc_box $<τ_0_0> { var Box<τ_0_0> } <T>
// CHECK-NEXT: [[UNINIT_SELF_BOX:%.*]] = mark_uninitialized [rootself] [[SELF_BOX]]
// CHECK-NEXT: [[SELF_ADDR:%.*]] = project_box [[UNINIT_SELF_BOX]] : $<τ_0_0> { var Box<τ_0_0> } <T>
-// CHECK: [[INIT:%.*]] = function_ref @_T010extensions3BoxV1txSgvfi : $@convention(thin) <τ_0_0> () -> @out Optional<τ_0_0>
+// CHECK: [[INIT:%.*]] = function_ref @_T010extensions3BoxV1txSgvpfi : $@convention(thin) <τ_0_0> () -> @out Optional<τ_0_0>
// CHECK-NEXT: [[RESULT:%.*]] = alloc_stack $Optional<T>
// CHECK-NEXT: apply [[INIT]]<T>([[RESULT]]) : $@convention(thin) <τ_0_0> () -> @out Optional<τ_0_0>
// CHECK-NEXT: [[T_ADDR:%.*]] = struct_element_addr [[SELF_ADDR]] : $*Box<T>, #Box.t
diff --git a/test/SILGen/extensions_multifile.swift b/test/SILGen/extensions_multifile.swift
index 18b4094..3c63079 100644
--- a/test/SILGen/extensions_multifile.swift
+++ b/test/SILGen/extensions_multifile.swift
@@ -1,21 +1,21 @@
// RUN: %target-swift-frontend -emit-silgen -primary-file %s %S/Inputs/struct_with_initializer.swift -module-name extensions_multifile -enable-sil-ownership | %FileCheck %s
// CHECK-LABEL: sil hidden @_T020extensions_multifile12HasInitValueVACSi1z_tcfC : $@convention(method) (Int, @thin HasInitValue.Type) -> @owned HasInitValue {
-// CHECK: function_ref @_T020extensions_multifile12HasInitValueV1xSivfi : $@convention(thin) () -> Int
+// CHECK: function_ref @_T020extensions_multifile12HasInitValueV1xSivpfi : $@convention(thin) () -> Int
-// CHECK-LABEL: sil hidden_external [transparent] @_T020extensions_multifile12HasInitValueV1xSivfi : $@convention(thin) () -> Int
+// CHECK-LABEL: sil hidden_external [transparent] @_T020extensions_multifile12HasInitValueV1xSivpfi : $@convention(thin) () -> Int
extension HasInitValue {
init(z: Int) {}
}
-// CHECK-LABEL: sil hidden_external [transparent] @_T020extensions_multifile19HasPrivateInitValueV1x33_0A683B047698EED319CF48214D7F519DLLSivfi : $@convention(thin) () -> Int
+// CHECK-LABEL: sil hidden_external [transparent] @_T020extensions_multifile19HasPrivateInitValueV1x33_0A683B047698EED319CF48214D7F519DLLSivpfi : $@convention(thin) () -> Int
extension HasPrivateInitValue {
init(z: Int) {}
}
-// CHECK-LABEL: sil hidden_external [transparent] @_T020extensions_multifile24PublicStructHasInitValueV1xSivfi : $@convention(thin) () -> Int
+// CHECK-LABEL: sil hidden_external [transparent] @_T020extensions_multifile24PublicStructHasInitValueV1xSivpfi : $@convention(thin) () -> Int
extension PublicStructHasInitValue {
init(z: Int) {}
diff --git a/test/SILGen/final.swift b/test/SILGen/final.swift
index fc103a5..a6c6618 100644
--- a/test/SILGen/final.swift
+++ b/test/SILGen/final.swift
@@ -25,7 +25,7 @@
// CHECK: apply [[FINALMETH]]([[BORROWED_ARG]])
// CHECK: end_borrow [[BORROWED_ARG]] from [[ARG]]
// CHECK: [[BORROWED_ARG:%.*]] = begin_borrow [[ARG]]
-// CHECK: [[FINALPROP:%[0-9]+]] = function_ref @_T05final9TestClassC0A8PropertySifg
+// CHECK: [[FINALPROP:%[0-9]+]] = function_ref @_T05final9TestClassC0A8PropertySivg
// CHECK: apply [[FINALPROP]]([[BORROWED_ARG]])
// CHECK: end_borrow [[BORROWED_ARG]] from [[ARG]]
func testDirectDispatch(c : TestClass) -> Int {
diff --git a/test/SILGen/foreign_errors.swift b/test/SILGen/foreign_errors.swift
index e2039f5..a9f75d1 100644
--- a/test/SILGen/foreign_errors.swift
+++ b/test/SILGen/foreign_errors.swift
@@ -73,7 +73,7 @@
// CHECK: [[T0:%.*]] = function_ref @swift_convertErrorToNSError : $@convention(thin) (@owned Error) -> @owned NSError
// CHECK: [[T1:%.*]] = apply [[T0]]([[ERR]])
// CHECK: [[OBJCERR:%.*]] = enum $Optional<NSError>, #Optional.some!enumelt.1, [[T1]] : $NSError
-// CHECK: [[SETTER:%.*]] = function_ref @_T0s33AutoreleasingUnsafeMutablePointerV7pointeexfs :
+// CHECK: [[SETTER:%.*]] = function_ref @_T0s33AutoreleasingUnsafeMutablePointerV7pointeexvs :
// CHECK: [[TEMP:%.*]] = alloc_stack $Optional<NSError>
// CHECK: store [[OBJCERR]] to [init] [[TEMP]]
// CHECK: apply [[SETTER]]<Optional<NSError>>([[TEMP]], [[UNWRAPPED_OUT]])
@@ -116,7 +116,7 @@
// CHECK: [[T0:%.*]] = function_ref @swift_convertErrorToNSError : $@convention(thin) (@owned Error) -> @owned NSError
// CHECK: [[T1:%.*]] = apply [[T0]]([[ERR]])
// CHECK: [[OBJCERR:%.*]] = enum $Optional<NSError>, #Optional.some!enumelt.1, [[T1]] : $NSError
-// CHECK: [[SETTER:%.*]] = function_ref @_T0s33AutoreleasingUnsafeMutablePointerV7pointeexfs :
+// CHECK: [[SETTER:%.*]] = function_ref @_T0s33AutoreleasingUnsafeMutablePointerV7pointeexvs :
// CHECK: [[TEMP:%.*]] = alloc_stack $Optional<NSError>
// CHECK: store [[OBJCERR]] to [init] [[TEMP]]
// CHECK: apply [[SETTER]]<Optional<NSError>>([[TEMP]], [[UNWRAPPED_OUT]])
diff --git a/test/SILGen/global_init_attribute.swift b/test/SILGen/global_init_attribute.swift
index adeb894..3c33a9d 100644
--- a/test/SILGen/global_init_attribute.swift
+++ b/test/SILGen/global_init_attribute.swift
@@ -10,7 +10,7 @@
let InternalConst = 42
// CHECK-NOT: [global_init]
// CHECK: // global_init_attribute.InternalConst.unsafeMutableAddressor : Swift.Int
-// CHECK-NEXT: sil hidden [global_init] @_T021global_init_attribute13InternalConstSifau
+// CHECK-NEXT: sil hidden [global_init] @_T021global_init_attribute13InternalConstSivau
func foo() -> Int {
return ExportedVar
@@ -22,10 +22,10 @@
// CHECK-NOT: [global_init]
// CHECK: // def_global.ExportedVar.unsafeMutableAddressor : Swift.Int
-// CHECK-NEXT: sil [global_init] @_T010def_global11ExportedVarSifau
+// CHECK-NEXT: sil [global_init] @_T010def_global11ExportedVarSivau
var InternalFoo = foo()
// CHECK-NOT: [global_init]
// CHECK: // global_init_attribute.InternalFoo.unsafeMutableAddressor : Swift.Int
-// CHECK-NEXT: sil hidden [global_init] @_T021global_init_attribute11InternalFooSifau
+// CHECK-NEXT: sil hidden [global_init] @_T021global_init_attribute11InternalFooSivau
diff --git a/test/SILGen/global_resilience.swift b/test/SILGen/global_resilience.swift
index b113a62..114f65e 100644
--- a/test/SILGen/global_resilience.swift
+++ b/test/SILGen/global_resilience.swift
@@ -7,33 +7,33 @@
public struct MyEmptyStruct {}
-// CHECK-LABEL: sil_global @_T017global_resilience13myEmptyGlobalAA02MyD6StructVv : $MyEmptyStruct
+// CHECK-LABEL: sil_global @_T017global_resilience13myEmptyGlobalAA02MyD6StructVvp : $MyEmptyStruct
public var myEmptyGlobal = MyEmptyStruct()
-// CHECK-LABEL: sil_global @_T017global_resilience19myFixedLayoutGlobalAA13MyEmptyStructVv : $MyEmptyStruct
+// CHECK-LABEL: sil_global @_T017global_resilience19myFixedLayoutGlobalAA13MyEmptyStructVvp : $MyEmptyStruct
@_fixed_layout public var myFixedLayoutGlobal = MyEmptyStruct()
// Mutable addressor for resilient global (should not be public?)
-// CHECK-LABEL: sil [global_init] @_T017global_resilience13myEmptyGlobalAA02MyD6StructVfau : $@convention(thin) () -> Builtin.RawPointer
+// CHECK-LABEL: sil [global_init] @_T017global_resilience13myEmptyGlobalAA02MyD6StructVvau : $@convention(thin) () -> Builtin.RawPointer
// CHECK: global_addr @_T017global_resilience13myEmptyGlobalAA02MyD6StructVv
// CHECK: return
// Synthesized getter and setter for our resilient global variable
-// CHECK-LABEL: sil @_T017global_resilience13myEmptyGlobalAA02MyD6StructVfg
-// CHECK: function_ref @_T017global_resilience13myEmptyGlobalAA02MyD6StructVfau
+// CHECK-LABEL: sil @_T017global_resilience13myEmptyGlobalAA02MyD6StructVvg
+// CHECK: function_ref @_T017global_resilience13myEmptyGlobalAA02MyD6StructVvau
// CHECK: return
-// CHECK-LABEL: sil @_T017global_resilience13myEmptyGlobalAA02MyD6StructVfs
-// CHECK: function_ref @_T017global_resilience13myEmptyGlobalAA02MyD6StructVfau
+// CHECK-LABEL: sil @_T017global_resilience13myEmptyGlobalAA02MyD6StructVvs
+// CHECK: function_ref @_T017global_resilience13myEmptyGlobalAA02MyD6StructVvau
// CHECK: return
// Mutable addressor for fixed-layout global
-// CHECK-LABEL: sil [global_init] @_T017global_resilience19myFixedLayoutGlobalAA13MyEmptyStructVfau
+// CHECK-LABEL: sil [global_init] @_T017global_resilience19myFixedLayoutGlobalAA13MyEmptyStructVvau
// CHECK: global_addr @_T017global_resilience19myFixedLayoutGlobalAA13MyEmptyStructVv
// CHECK: return
@@ -41,8 +41,8 @@
// CHECK-OPT: alloc_global @_T017global_resilience19myFixedLayoutGlobalAA13MyEmptyStructVv
// CHECK-OPT: return
-// CHECK-OPT-LABEL: sil [global_init] @_T017global_resilience19myFixedLayoutGlobalAA13MyEmptyStructVfau
-// CHECK-OPT: global_addr @_T017global_resilience19myFixedLayoutGlobalAA13MyEmptyStructVv
+// CHECK-OPT-LABEL: sil [global_init] @_T017global_resilience19myFixedLayoutGlobalAA13MyEmptyStructVvau
+// CHECK-OPT: global_addr @_T017global_resilience19myFixedLayoutGlobalAA13MyEmptyStructVvp
// CHECK-OPT: function_ref @globalinit_{{.*}}_func0
// CHECK-OPT: return
@@ -50,7 +50,7 @@
// call the addressor directly
// CHECK-LABEL: sil @_T017global_resilience16getMyEmptyGlobalAA0dE6StructVyF
-// CHECK: function_ref @_T017global_resilience13myEmptyGlobalAA02MyD6StructVfau
+// CHECK: function_ref @_T017global_resilience13myEmptyGlobalAA02MyD6StructVvau
// CHECK: return
public func getMyEmptyGlobal() -> MyEmptyStruct {
return myEmptyGlobal
@@ -60,7 +60,7 @@
// access it with accessors
// CHECK-LABEL: sil @_T017global_resilience14getEmptyGlobal010resilient_A00D15ResilientStructVyF
-// CHECK: function_ref @_T016resilient_global11emptyGlobalAA20EmptyResilientStructVfg
+// CHECK: function_ref @_T016resilient_global11emptyGlobalAA20EmptyResilientStructVvg
// CHECK: return
public func getEmptyGlobal() -> EmptyResilientStruct {
return emptyGlobal
@@ -70,7 +70,7 @@
// call the addressor directly
// CHECK-LABEL: sil @_T017global_resilience20getFixedLayoutGlobal010resilient_A020EmptyResilientStructVyF
-// CHECK: function_ref @_T016resilient_global17fixedLayoutGlobalAA20EmptyResilientStructVfau
+// CHECK: function_ref @_T016resilient_global17fixedLayoutGlobalAA20EmptyResilientStructVvau
// CHECK: return
public func getFixedLayoutGlobal() -> EmptyResilientStruct {
return fixedLayoutGlobal
diff --git a/test/SILGen/guaranteed_self.swift b/test/SILGen/guaranteed_self.swift
index 4291558..652a5ed 100644
--- a/test/SILGen/guaranteed_self.swift
+++ b/test/SILGen/guaranteed_self.swift
@@ -57,41 +57,41 @@
var prop1: Int = 0
// Getter for prop1
- // CHECK-LABEL: sil hidden [transparent] @_T015guaranteed_self1SV5prop1Sifg : $@convention(method) (@guaranteed S) -> Int
+ // CHECK-LABEL: sil hidden [transparent] @_T015guaranteed_self1SV5prop1Sivg : $@convention(method) (@guaranteed S) -> Int
// CHECK: bb0([[SELF:%.*]] : @guaranteed $S):
// CHECK-NOT: destroy_value [[SELF]]
// Setter for prop1
- // CHECK-LABEL: sil hidden [transparent] @_T015guaranteed_self1SV5prop1Sifs : $@convention(method) (Int, @inout S) -> ()
+ // CHECK-LABEL: sil hidden [transparent] @_T015guaranteed_self1SV5prop1Sivs : $@convention(method) (Int, @inout S) -> ()
// CHECK: bb0({{.*}} [[SELF_ADDR:%.*]] : @trivial $*S):
// CHECK-NOT: load [[SELF_ADDR]]
// CHECK-NOT: destroy_addr [[SELF_ADDR]]
// materializeForSet for prop1
- // CHECK-LABEL: sil hidden [transparent] @_T015guaranteed_self1SV5prop1Sifm : $@convention(method) (Builtin.RawPointer, @inout Builtin.UnsafeValueBuffer, @inout S) -> (Builtin.RawPointer, Optional<Builtin.RawPointer>)
+ // CHECK-LABEL: sil hidden [transparent] @_T015guaranteed_self1SV5prop1Sivm : $@convention(method) (Builtin.RawPointer, @inout Builtin.UnsafeValueBuffer, @inout S) -> (Builtin.RawPointer, Optional<Builtin.RawPointer>)
// CHECK: bb0({{.*}} [[SELF_ADDR:%.*]] : @trivial $*S):
// CHECK-NOT: load [[SELF_ADDR]]
// CHECK-NOT: destroy_addr [[SELF_ADDR]]
var prop2: Int {
- // CHECK-LABEL: sil hidden @_T015guaranteed_self1SV5prop2Sifg : $@convention(method) (@guaranteed S) -> Int
+ // CHECK-LABEL: sil hidden @_T015guaranteed_self1SV5prop2Sivg : $@convention(method) (@guaranteed S) -> Int
// CHECK: bb0([[SELF:%.*]] : @guaranteed $S):
// CHECK-NOT: destroy_value [[SELF]]
get { return 0 }
- // CHECK-LABEL: sil hidden @_T015guaranteed_self1SV5prop2Sifs : $@convention(method) (Int, @inout S) -> ()
- // CHECK-LABEL: sil hidden [transparent] @_T015guaranteed_self1SV5prop2Sifm : $@convention(method) (Builtin.RawPointer, @inout Builtin.UnsafeValueBuffer, @inout S) -> (Builtin.RawPointer, Optional<Builtin.RawPointer>)
+ // CHECK-LABEL: sil hidden @_T015guaranteed_self1SV5prop2Sivs : $@convention(method) (Int, @inout S) -> ()
+ // CHECK-LABEL: sil hidden [transparent] @_T015guaranteed_self1SV5prop2Sivm : $@convention(method) (Builtin.RawPointer, @inout Builtin.UnsafeValueBuffer, @inout S) -> (Builtin.RawPointer, Optional<Builtin.RawPointer>)
set { }
}
var prop3: Int {
- // CHECK-LABEL: sil hidden @_T015guaranteed_self1SV5prop3Sifg : $@convention(method) (@guaranteed S) -> Int
+ // CHECK-LABEL: sil hidden @_T015guaranteed_self1SV5prop3Sivg : $@convention(method) (@guaranteed S) -> Int
// CHECK: bb0([[SELF:%.*]] : @guaranteed $S):
// CHECK-NOT: destroy_value [[SELF]]
get { return 0 }
- // CHECK-LABEL: sil hidden @_T015guaranteed_self1SV5prop3Sifs : $@convention(method) (Int, @guaranteed S) -> ()
+ // CHECK-LABEL: sil hidden @_T015guaranteed_self1SV5prop3Sivs : $@convention(method) (Int, @guaranteed S) -> ()
// CHECK: bb0({{.*}} [[SELF:%.*]] : @guaranteed $S):
// CHECK-NOT: destroy_value [[SELF]]
- // CHECK-LABEL: sil hidden [transparent] @_T015guaranteed_self1SV5prop3Sifm : $@convention(method) (Builtin.RawPointer, @inout Builtin.UnsafeValueBuffer, @guaranteed S) -> (Builtin.RawPointer, Optional<Builtin.RawPointer>)
+ // CHECK-LABEL: sil hidden [transparent] @_T015guaranteed_self1SV5prop3Sivm : $@convention(method) (Builtin.RawPointer, @inout Builtin.UnsafeValueBuffer, @guaranteed S) -> (Builtin.RawPointer, Optional<Builtin.RawPointer>)
// CHECK: bb0({{.*}} [[SELF:%.*]] : @guaranteed $S):
// CHECK-NOT: destroy_value [[SELF]]
nonmutating set { }
@@ -124,7 +124,7 @@
// CHECK-NOT: destroy_value [[SELF]]
// Witness thunk for prop1 getter
-// CHECK-LABEL: sil private [transparent] [thunk] @_T015guaranteed_self1SVAA7FooableA2aDP5prop1SifgTW : $@convention(witness_method) (@in_guaranteed S) -> Int
+// CHECK-LABEL: sil private [transparent] [thunk] @_T015guaranteed_self1SVAA7FooableA2aDP5prop1SivgTW : $@convention(witness_method) (@in_guaranteed S) -> Int
// CHECK: bb0([[SELF_ADDR:%.*]] : @trivial $*S):
// CHECK: [[SELF_COPY:%.*]] = alloc_stack $S
// CHECK: copy_addr [[SELF_ADDR]] to [initialization] [[SELF_COPY]]
@@ -135,17 +135,17 @@
// CHECK-NOT: destroy_addr [[SELF_ADDR]]
// Witness thunk for prop1 setter
-// CHECK-LABEL: sil private [transparent] [thunk] @_T015guaranteed_self1SVAA7FooableA2aDP5prop1SifsTW : $@convention(witness_method) (Int, @inout S) -> () {
+// CHECK-LABEL: sil private [transparent] [thunk] @_T015guaranteed_self1SVAA7FooableA2aDP5prop1SivsTW : $@convention(witness_method) (Int, @inout S) -> () {
// CHECK: bb0({{.*}} [[SELF_ADDR:%.*]] : @trivial $*S):
// CHECK-NOT: destroy_addr [[SELF_ADDR]]
// Witness thunk for prop1 materializeForSet
-// CHECK-LABEL: sil private [transparent] [thunk] @_T015guaranteed_self1SVAA7FooableA2aDP5prop1SifmTW : $@convention(witness_method) (Builtin.RawPointer, @inout Builtin.UnsafeValueBuffer, @inout S) -> (Builtin.RawPointer, Optional<Builtin.RawPointer>) {
+// CHECK-LABEL: sil private [transparent] [thunk] @_T015guaranteed_self1SVAA7FooableA2aDP5prop1SivmTW : $@convention(witness_method) (Builtin.RawPointer, @inout Builtin.UnsafeValueBuffer, @inout S) -> (Builtin.RawPointer, Optional<Builtin.RawPointer>) {
// CHECK: bb0({{.*}} [[SELF_ADDR:%.*]] : @trivial $*S):
// CHECK-NOT: destroy_addr [[SELF_ADDR]]
// Witness thunk for prop2 getter
-// CHECK-LABEL: sil private [transparent] [thunk] @_T015guaranteed_self1SVAA7FooableA2aDP5prop2SifgTW : $@convention(witness_method) (@in_guaranteed S) -> Int
+// CHECK-LABEL: sil private [transparent] [thunk] @_T015guaranteed_self1SVAA7FooableA2aDP5prop2SivgTW : $@convention(witness_method) (@in_guaranteed S) -> Int
// CHECK: bb0([[SELF_ADDR:%.*]] : @trivial $*S):
// CHECK: [[SELF_COPY:%.*]] = alloc_stack $S
// CHECK: copy_addr [[SELF_ADDR]] to [initialization] [[SELF_COPY]]
@@ -156,17 +156,17 @@
// CHECK-NOT: destroy_addr [[SELF_ADDR]]
// Witness thunk for prop2 setter
-// CHECK-LABEL: sil private [transparent] [thunk] @_T015guaranteed_self1SVAA7FooableA2aDP5prop2SifsTW : $@convention(witness_method) (Int, @inout S) -> () {
+// CHECK-LABEL: sil private [transparent] [thunk] @_T015guaranteed_self1SVAA7FooableA2aDP5prop2SivsTW : $@convention(witness_method) (Int, @inout S) -> () {
// CHECK: bb0({{.*}} [[SELF_ADDR:%.*]] : @trivial $*S):
// CHECK-NOT: destroy_addr [[SELF_ADDR]]
// Witness thunk for prop2 materializeForSet
-// CHECK-LABEL: sil private [transparent] [thunk] @_T015guaranteed_self1SVAA7FooableA2aDP5prop2SifmTW : $@convention(witness_method) (Builtin.RawPointer, @inout Builtin.UnsafeValueBuffer, @inout S) -> (Builtin.RawPointer, Optional<Builtin.RawPointer>) {
+// CHECK-LABEL: sil private [transparent] [thunk] @_T015guaranteed_self1SVAA7FooableA2aDP5prop2SivmTW : $@convention(witness_method) (Builtin.RawPointer, @inout Builtin.UnsafeValueBuffer, @inout S) -> (Builtin.RawPointer, Optional<Builtin.RawPointer>) {
// CHECK: bb0({{.*}} [[SELF_ADDR:%.*]] : @trivial $*S):
// CHECK-NOT: destroy_addr [[SELF_ADDR]]
// Witness thunk for prop3 getter
-// CHECK-LABEL: sil private [transparent] [thunk] @_T015guaranteed_self1SVAA7FooableA2aDP5prop3SifgTW : $@convention(witness_method) (@in_guaranteed S) -> Int
+// CHECK-LABEL: sil private [transparent] [thunk] @_T015guaranteed_self1SVAA7FooableA2aDP5prop3SivgTW : $@convention(witness_method) (@in_guaranteed S) -> Int
// CHECK: bb0([[SELF_ADDR:%.*]] : @trivial $*S):
// CHECK: [[SELF_COPY:%.*]] = alloc_stack $S
// CHECK: copy_addr [[SELF_ADDR]] to [initialization] [[SELF_COPY]]
@@ -177,7 +177,7 @@
// CHECK-NOT: destroy_addr [[SELF_ADDR]]
// Witness thunk for prop3 nonmutating setter
-// CHECK-LABEL: sil private [transparent] [thunk] @_T015guaranteed_self1SVAA7FooableA2aDP5prop3SifsTW : $@convention(witness_method) (Int, @in_guaranteed S) -> ()
+// CHECK-LABEL: sil private [transparent] [thunk] @_T015guaranteed_self1SVAA7FooableA2aDP5prop3SivsTW : $@convention(witness_method) (Int, @in_guaranteed S) -> ()
// CHECK: bb0({{.*}} [[SELF_ADDR:%.*]] : @trivial $*S):
// CHECK: [[SELF_COPY:%.*]] = alloc_stack $S
// CHECK: copy_addr [[SELF_ADDR]] to [initialization] [[SELF_COPY]]
@@ -188,7 +188,7 @@
// CHECK-NOT: destroy_addr [[SELF_ADDR]]
// Witness thunk for prop3 nonmutating materializeForSet
-// CHECK-LABEL: sil private [transparent] [thunk] @_T015guaranteed_self1SVAA7FooableA2aDP5prop3SifmTW : $@convention(witness_method) (Builtin.RawPointer, @inout Builtin.UnsafeValueBuffer, @in_guaranteed S) -> (Builtin.RawPointer, Optional<Builtin.RawPointer>)
+// CHECK-LABEL: sil private [transparent] [thunk] @_T015guaranteed_self1SVAA7FooableA2aDP5prop3SivmTW : $@convention(witness_method) (Builtin.RawPointer, @inout Builtin.UnsafeValueBuffer, @in_guaranteed S) -> (Builtin.RawPointer, Optional<Builtin.RawPointer>)
// CHECK: bb0({{.*}} [[SELF_ADDR:%.*]] : @trivial $*S):
// CHECK: [[SELF_COPY:%.*]] = alloc_stack $S
// CHECK: copy_addr [[SELF_ADDR]] to [initialization] [[SELF_COPY]]
@@ -197,7 +197,7 @@
// CHECK-NOT: destroy_value [[SELF]]
// CHECK-NOT: destroy_addr [[SELF_COPY]]
// CHECK-NOT: destroy_addr [[SELF_ADDR]]
-// CHECK: } // end sil function '_T015guaranteed_self1SVAA7FooableA2aDP5prop3SifmTW'
+// CHECK: } // end sil function '_T015guaranteed_self1SVAA7FooableA2aDP5prop3SivmTW'
//
// TODO: Expected output for the other cases
@@ -229,21 +229,21 @@
var prop1: Int = 0
var prop2: Int {
- // CHECK-LABEL: sil hidden @_T015guaranteed_self2AOV5prop2Sifg : $@convention(method) <T> (@in_guaranteed AO<T>) -> Int {
+ // CHECK-LABEL: sil hidden @_T015guaranteed_self2AOV5prop2Sivg : $@convention(method) <T> (@in_guaranteed AO<T>) -> Int {
// CHECK: bb0([[SELF_ADDR:%.*]] : @trivial $*AO<T>):
// CHECK-NOT: destroy_addr [[SELF_ADDR]]
get { return 0 }
set { }
}
var prop3: Int {
- // CHECK-LABEL: sil hidden @_T015guaranteed_self2AOV5prop3Sifg : $@convention(method) <T> (@in_guaranteed AO<T>) -> Int
+ // CHECK-LABEL: sil hidden @_T015guaranteed_self2AOV5prop3Sivg : $@convention(method) <T> (@in_guaranteed AO<T>) -> Int
// CHECK: bb0([[SELF_ADDR:%.*]] : @trivial $*AO<T>):
// CHECK-NOT: destroy_addr [[SELF_ADDR]]
get { return 0 }
- // CHECK-LABEL: sil hidden @_T015guaranteed_self2AOV5prop3Sifs : $@convention(method) <T> (Int, @in_guaranteed AO<T>) -> ()
+ // CHECK-LABEL: sil hidden @_T015guaranteed_self2AOV5prop3Sivs : $@convention(method) <T> (Int, @in_guaranteed AO<T>) -> ()
// CHECK: bb0({{.*}} [[SELF_ADDR:%.*]] : @trivial $*AO<T>):
// CHECK-NOT: destroy_addr [[SELF_ADDR]]
- // CHECK-LABEL: sil hidden [transparent] @_T015guaranteed_self2AOV5prop3Sifm : $@convention(method) <T> (Builtin.RawPointer, @inout Builtin.UnsafeValueBuffer, @in_guaranteed AO<T>) -> (Builtin.RawPointer, Optional<Builtin.RawPointer>)
+ // CHECK-LABEL: sil hidden [transparent] @_T015guaranteed_self2AOV5prop3Sivm : $@convention(method) <T> (Builtin.RawPointer, @inout Builtin.UnsafeValueBuffer, @in_guaranteed AO<T>) -> (Builtin.RawPointer, Optional<Builtin.RawPointer>)
// CHECK: bb0({{.*}} [[SELF_ADDR:%.*]] : @trivial $*AO<T>):
// CHECK-NOT: destroy_addr [[SELF_ADDR]]
// CHECK: }
@@ -326,7 +326,7 @@
self.bas()
}
- // CHECK-LABEL: sil hidden [transparent] [thunk] @_T015guaranteed_self1CC5prop1SifgTo : $@convention(objc_method) (C) -> Int
+ // CHECK-LABEL: sil hidden [transparent] [thunk] @_T015guaranteed_self1CC5prop1SivgTo : $@convention(objc_method) (C) -> Int
// CHECK: bb0([[SELF:%.*]] : @unowned $C):
// CHECK: [[SELF_COPY:%.*]] = copy_value [[SELF]]
// CHECK: [[BORROWED_SELF_COPY:%.*]] = begin_borrow [[SELF_COPY]]
@@ -336,7 +336,7 @@
// CHECK-NOT: destroy_value [[SELF]]
// CHECK-NOT: destroy_value [[SELF_COPY]]
- // CHECK-LABEL: sil hidden [transparent] [thunk] @_T015guaranteed_self1CC5prop1SifsTo : $@convention(objc_method) (Int, C) -> ()
+ // CHECK-LABEL: sil hidden [transparent] [thunk] @_T015guaranteed_self1CC5prop1SivsTo : $@convention(objc_method) (Int, C) -> ()
// CHECK: bb0({{.*}} [[SELF:%.*]] : @unowned $C):
// CHECK: [[SELF_COPY:%.*]] = copy_value [[SELF]]
// CHECK: [[BORROWED_SELF_COPY:%.*]] = begin_borrow [[SELF_COPY]]
diff --git a/test/SILGen/inherited_protocol_conformance_multi_file_2.swift b/test/SILGen/inherited_protocol_conformance_multi_file_2.swift
index 25feea6..f3fd3fa 100644
--- a/test/SILGen/inherited_protocol_conformance_multi_file_2.swift
+++ b/test/SILGen/inherited_protocol_conformance_multi_file_2.swift
@@ -43,21 +43,21 @@
// RUN: %target-swift-frontend -emit-silgen -enable-sil-ownership %S/Inputs/inherited_protocol_conformance_other_file_2_c.swift %S/Inputs/inherited_protocol_conformance_other_file_2_b.swift -primary-file %s -module-name main | %FileCheck %s --check-prefix=FILE_A
// FILE_A-NOT: sil [transparent] [thunk] @_T04main5ThingVs9EquatableAAsADP2eeoi{{[_0-9a-zA-Z]*}}FZTW
-// FILE_A-NOT: sil [transparent] [thunk] @_T04main5ThingVs8HashableAAsADP9hashValueSifgTW
+// FILE_A-NOT: sil [transparent] [thunk] @_T04main5ThingVs8HashableAAsADP9hashValueSivgTW
// FILE_A-NOT: sil_witness_table Thing: Hashable module main
// FILE_A-NOT: sil_witness_table Thing: Equatable module main
// FILE_B-NOT: sil [transparent] [thunk] @_T04main5ThingVs9EquatableAAsADP2eeoi{{[_0-9a-zA-Z]*}}FZTW
-// FILE_B: sil private [transparent] [thunk] @_T04main5ThingVs8HashableAAsADP9hashValueSifgTW
+// FILE_B: sil private [transparent] [thunk] @_T04main5ThingVs8HashableAAsADP9hashValueSivgTW
// FILE_B-NOT: sil [transparent] [thunk] @_T04main5ThingVs9EquatableAAsADP2eeoi{{[_0-9a-zA-Z]*}}FZTW
// FILE_B-NOT: sil_witness_table hidden Thing: Equatable module main
// FILE_B: sil_witness_table hidden Thing: Hashable module main
// FILE_B-NOT: sil_witness_table hidden Thing: Equatable module main
-// FILE_C-NOT: sil [transparent] [thunk] @_T04main5ThingVs8HashableAAsADP9hashValueSifgTW
+// FILE_C-NOT: sil [transparent] [thunk] @_T04main5ThingVs8HashableAAsADP9hashValueSivgTW
// FILE_C: sil private [transparent] [thunk] @_T04main5ThingVs9EquatableAAsADP2eeoi{{[_0-9a-zA-Z]*}}FZTW
-// FILE_C-NOT: sil [transparent] [thunk] @_T04main5ThingVs8HashableAAsADP9hashValueSifgTW
+// FILE_C-NOT: sil [transparent] [thunk] @_T04main5ThingVs8HashableAAsADP9hashValueSivgTW
// FILE_C-NOT: sil_witness_table hidden Thing: Hashable module main
// FILE_C: sil_witness_table hidden Thing: Equatable module main
diff --git a/test/SILGen/initializers.swift b/test/SILGen/initializers.swift
index e897861..e438fc8 100644
--- a/test/SILGen/initializers.swift
+++ b/test/SILGen/initializers.swift
@@ -588,7 +588,7 @@
// CHECK: store {{%.*}} to [init] [[PROJ]]
//
// Then initialize the canary with nil. We are able to borrow the initialized self to avoid retain/release overhead.
- // CHECK: [[CANARY_FUNC:%.*]] = function_ref @_T021failable_initializers17ThrowDerivedClassC6canaryAA6CanaryCSgvfi :
+ // CHECK: [[CANARY_FUNC:%.*]] = function_ref @_T021failable_initializers17ThrowDerivedClassC6canaryAA6CanaryCSgvpfi :
// CHECK: [[OPT_CANARY:%.*]] = apply [[CANARY_FUNC]]()
// CHECK: [[SELF:%.*]] = load_borrow [[PROJ]]
// CHECK: [[CANARY_ADDR:%.*]] = ref_element_addr [[SELF]]
@@ -632,7 +632,7 @@
// CHECK: store {{%.*}} to [init] [[PROJ]]
//
// Then initialize the canary with nil. We are able to borrow the initialized self to avoid retain/release overhead.
- // CHECK: [[CANARY_FUNC:%.*]] = function_ref @_T021failable_initializers17ThrowDerivedClassC6canaryAA6CanaryCSgvfi :
+ // CHECK: [[CANARY_FUNC:%.*]] = function_ref @_T021failable_initializers17ThrowDerivedClassC6canaryAA6CanaryCSgvpfi :
// CHECK: [[OPT_CANARY:%.*]] = apply [[CANARY_FUNC]]()
// CHECK: [[SELF:%.*]] = load_borrow [[PROJ]]
// CHECK: [[CANARY_ADDR:%.*]] = ref_element_addr [[SELF]]
diff --git a/test/SILGen/inlineable_attribute.swift b/test/SILGen/inlineable_attribute.swift
index e99373a..e747462 100644
--- a/test/SILGen/inlineable_attribute.swift
+++ b/test/SILGen/inlineable_attribute.swift
@@ -9,12 +9,12 @@
// CHECK-LABEL: sil [serialized] @_T020inlineable_attribute4MyStV6methodyyF : $@convention(method) (MySt) -> ()
@_inlineable public func method() {}
- // CHECK-LABEL: sil [serialized] @_T020inlineable_attribute4MyStV8propertySifg : $@convention(method) (MySt) -> Int
+ // CHECK-LABEL: sil [serialized] @_T020inlineable_attribute4MyStV8propertySivg : $@convention(method) (MySt) -> Int
@_inlineable public var property: Int {
return 5
}
- // CHECK-LABEL: sil [serialized] @_T020inlineable_attribute4MyStV9subscriptS2icfg : $@convention(method) (Int, MySt) -> Int
+ // CHECK-LABEL: sil [serialized] @_T020inlineable_attribute4MyStVS2icig : $@convention(method) (Int, MySt) -> Int
@_inlineable public subscript(x: Int) -> Int {
return x
}
@@ -49,7 +49,7 @@
_ = MyEnum.c
}
-// CHECK-LABEL: sil [transparent] @_T020inlineable_attribute15HasInitializersV1xSivfi : $@convention(thin) () -> Int
+// CHECK-LABEL: sil [transparent] @_T020inlineable_attribute15HasInitializersV1xSivpfi : $@convention(thin) () -> Int
public struct HasInitializers {
public let x = 1234
diff --git a/test/SILGen/interface_type_mangling.swift b/test/SILGen/interface_type_mangling.swift
index b99d271..d483dc0 100644
--- a/test/SILGen/interface_type_mangling.swift
+++ b/test/SILGen/interface_type_mangling.swift
@@ -201,7 +201,7 @@
foo(a, b)
}
- // CHECK-LABEL: sil private @_T023interface_type_mangling18GenericTypeContextV09closureInd8PropertyF0xfg3fooL_xylF
+ // CHECK-LABEL: sil private @_T023interface_type_mangling18GenericTypeContextV09closureInd8PropertyF0xvg3fooL_xylF
var closureInGenericPropertyContext: T {
func foo() -> T { }
@@ -218,7 +218,7 @@
// CHECK-LABEL: @_T023interface_type_mangling18GenericTypeContextVyxGAA0D11WitnessTestAAlAaEP09closureIndF0yqd__lFTW
// CHECK-LABEL: protocol witness for interface_type_mangling.GenericWitnessTest.closureInGenericPropertyContext.getter : A.Tee in conformance <A> interface_type_mangling.GenericTypeContext<A> : interface_type_mangling.GenericWitnessTest in interface_type_mangling
-// CHECK-LABEL: @_T023interface_type_mangling18GenericTypeContextVyxGAA0D11WitnessTestAAlAaEP09closureInd8PropertyF03TeeQzfgTW
+// CHECK-LABEL: @_T023interface_type_mangling18GenericTypeContextVyxGAA0D11WitnessTestAAlAaEP09closureInd8PropertyF03TeeQzvgTW
// CHECK-LABEL: protocol witness for interface_type_mangling.GenericWitnessTest.twoParamsAtDepth<A, B>(A1, y: B1) -> () in conformance <A> interface_type_mangling.GenericTypeContext<A> : interface_type_mangling.GenericWitnessTest in interface_type_mangling
// CHECK-LABEL: @_T023interface_type_mangling18GenericTypeContextVyxGAA0D11WitnessTestAAlAaEP16twoParamsAtDepthyqd___qd_0_1ytr0_lFTW
diff --git a/test/SILGen/keypaths.swift b/test/SILGen/keypaths.swift
index c131970..8ba3f4f 100644
--- a/test/SILGen/keypaths.swift
+++ b/test/SILGen/keypaths.swift
@@ -61,8 +61,8 @@
// CHECK-SAME: root $C<τ_0_0>;
// CHECK-SAME: settable_property $S<τ_0_0>,
// CHECK-SAME: id #C.nonfinal!getter.1 : <T> (C<T>) -> () -> S<T>,
- // CHECK-SAME: getter @_T08keypaths1CC8nonfinalAA1SVyxGvAA1PRzlACyxGTK : $@convention(thin) <τ_0_0 where τ_0_0 : P> (@in C<τ_0_0>) -> @out S<τ_0_0>,
- // CHECK-SAME: setter @_T08keypaths1CC8nonfinalAA1SVyxGvAA1PRzlACyxGTk : $@convention(thin) <τ_0_0 where τ_0_0 : P> (@in S<τ_0_0>, @in C<τ_0_0>) -> ()
+ // CHECK-SAME: getter @_T08keypaths1CC8nonfinalAA1SVyxGvpAA1PRzlACyxGTK : $@convention(thin) <τ_0_0 where τ_0_0 : P> (@in C<τ_0_0>) -> @out S<τ_0_0>,
+ // CHECK-SAME: setter @_T08keypaths1CC8nonfinalAA1SVyxGvpAA1PRzlACyxGTk : $@convention(thin) <τ_0_0 where τ_0_0 : P> (@in S<τ_0_0>, @in C<τ_0_0>) -> ()
// CHECK-SAME: ) <T>
_ = \C<T>.nonfinal
@@ -70,7 +70,7 @@
// CHECK-SAME: root $C<τ_0_0>;
// CHECK-SAME: gettable_property $S<τ_0_0>,
// CHECK-SAME: id #C.computed!getter.1 : <T> (C<T>) -> () -> S<T>,
- // CHECK-SAME: getter @_T08keypaths1CC8computedAA1SVyxGvAA1PRzlACyxGTK : $@convention(thin) <τ_0_0 where τ_0_0 : P> (@in C<τ_0_0>) -> @out S<τ_0_0>
+ // CHECK-SAME: getter @_T08keypaths1CC8computedAA1SVyxGvpAA1PRzlACyxGTK : $@convention(thin) <τ_0_0 where τ_0_0 : P> (@in C<τ_0_0>) -> @out S<τ_0_0>
// CHECK-SAME: ) <T>
_ = \C<T>.computed
@@ -78,8 +78,8 @@
// CHECK-SAME: root $C<τ_0_0>;
// CHECK-SAME: settable_property $S<τ_0_0>,
// CHECK-SAME: id #C.observed!getter.1 : <T> (C<T>) -> () -> S<T>,
- // CHECK-SAME: getter @_T08keypaths1CC8observedAA1SVyxGvAA1PRzlACyxGTK : $@convention(thin) <τ_0_0 where τ_0_0 : P> (@in C<τ_0_0>) -> @out S<τ_0_0>,
- // CHECK-SAME: setter @_T08keypaths1CC8observedAA1SVyxGvAA1PRzlACyxGTk : $@convention(thin) <τ_0_0 where τ_0_0 : P> (@in S<τ_0_0>, @in C<τ_0_0>) -> ()
+ // CHECK-SAME: getter @_T08keypaths1CC8observedAA1SVyxGvpAA1PRzlACyxGTK : $@convention(thin) <τ_0_0 where τ_0_0 : P> (@in C<τ_0_0>) -> @out S<τ_0_0>,
+ // CHECK-SAME: setter @_T08keypaths1CC8observedAA1SVyxGvpAA1PRzlACyxGTk : $@convention(thin) <τ_0_0 where τ_0_0 : P> (@in S<τ_0_0>, @in C<τ_0_0>) -> ()
// CHECK-SAME: ) <T>
_ = \C<T>.observed
@@ -94,24 +94,24 @@
// CHECK-SAME: root $C<τ_0_0>;
// CHECK-SAME: settable_property $() -> (),
// CHECK-SAME: id ##C.reabstracted,
- // CHECK-SAME: getter @_T08keypaths1CC12reabstractedyycvAA1PRzlACyxGTK : $@convention(thin) <τ_0_0 where τ_0_0 : P> (@in C<τ_0_0>) -> @out @callee_owned (@in ()) -> @out (),
- // CHECK-SAME: setter @_T08keypaths1CC12reabstractedyycvAA1PRzlACyxGTk : $@convention(thin) <τ_0_0 where τ_0_0 : P> (@in @callee_owned (@in ()) -> @out (), @in C<τ_0_0>) -> ()
+ // CHECK-SAME: getter @_T08keypaths1CC12reabstractedyycvpAA1PRzlACyxGTK : $@convention(thin) <τ_0_0 where τ_0_0 : P> (@in C<τ_0_0>) -> @out @callee_owned (@in ()) -> @out (),
+ // CHECK-SAME: setter @_T08keypaths1CC12reabstractedyycvpAA1PRzlACyxGTk : $@convention(thin) <τ_0_0 where τ_0_0 : P> (@in @callee_owned (@in ()) -> @out (), @in C<τ_0_0>) -> ()
// CHECK-SAME: ) <T>
_ = \C<T>.reabstracted
// CHECK: keypath $KeyPath<S<T>, C<T>>, <τ_0_0 where τ_0_0 : P> (
// CHECK-SAME: root $S<τ_0_0>; gettable_property $C<τ_0_0>,
- // CHECK-SAME: id @_T08keypaths1SV8computedAA1CCyxGfg : $@convention(method) <τ_0_0> (@in_guaranteed S<τ_0_0>) -> @owned C<τ_0_0>,
- // CHECK-SAME: getter @_T08keypaths1SV8computedAA1CCyxGvAA1PRzlACyxGTK : $@convention(thin) <τ_0_0 where τ_0_0 : P> (@in S<τ_0_0>) -> @out C<τ_0_0>
+ // CHECK-SAME: id @_T08keypaths1SV8computedAA1CCyxGvg : $@convention(method) <τ_0_0> (@in_guaranteed S<τ_0_0>) -> @owned C<τ_0_0>,
+ // CHECK-SAME: getter @_T08keypaths1SV8computedAA1CCyxGvpAA1PRzlACyxGTK : $@convention(thin) <τ_0_0 where τ_0_0 : P> (@in S<τ_0_0>) -> @out C<τ_0_0>
// CHECK-SAME: ) <T>
_ = \S<T>.computed
// CHECK: keypath $WritableKeyPath<S<T>, C<T>>, <τ_0_0 where τ_0_0 : P> (
// CHECK-SAME: root $S<τ_0_0>;
// CHECK-SAME: settable_property $C<τ_0_0>,
- // CHECK-SAME: id @_T08keypaths1SV8observedAA1CCyxGfg : $@convention(method) <τ_0_0> (@in_guaranteed S<τ_0_0>) -> @owned C<τ_0_0>,
- // CHECK-SAME: getter @_T08keypaths1SV8observedAA1CCyxGvAA1PRzlACyxGTK : $@convention(thin) <τ_0_0 where τ_0_0 : P> (@in S<τ_0_0>) -> @out C<τ_0_0>,
- // CHECK-SAME: setter @_T08keypaths1SV8observedAA1CCyxGvAA1PRzlACyxGTk : $@convention(thin) <τ_0_0 where τ_0_0 : P> (@in C<τ_0_0>, @inout S<τ_0_0>) -> ()
+ // CHECK-SAME: id @_T08keypaths1SV8observedAA1CCyxGvg : $@convention(method) <τ_0_0> (@in_guaranteed S<τ_0_0>) -> @owned C<τ_0_0>,
+ // CHECK-SAME: getter @_T08keypaths1SV8observedAA1CCyxGvpAA1PRzlACyxGTK : $@convention(thin) <τ_0_0 where τ_0_0 : P> (@in S<τ_0_0>) -> @out C<τ_0_0>,
+ // CHECK-SAME: setter @_T08keypaths1SV8observedAA1CCyxGvpAA1PRzlACyxGTk : $@convention(thin) <τ_0_0 where τ_0_0 : P> (@in C<τ_0_0>, @inout S<τ_0_0>) -> ()
// CHECK-SAME: ) <T>
_ = \S<T>.observed
_ = \S<T>.z.nonfinal
@@ -123,8 +123,8 @@
// CHECK-SAME: root $S<τ_0_0>;
// CHECK-SAME: settable_property $() -> (),
// CHECK-SAME: id ##S.reabstracted,
- // CHECK-SAME: getter @_T08keypaths1SV12reabstractedyycvAA1PRzlACyxGTK : $@convention(thin) <τ_0_0 where τ_0_0 : P> (@in S<τ_0_0>) -> @out @callee_owned (@in ()) -> @out (),
- // CHECK-SAME: setter @_T08keypaths1SV12reabstractedyycvAA1PRzlACyxGTk : $@convention(thin) <τ_0_0 where τ_0_0 : P> (@in @callee_owned (@in ()) -> @out (), @inout S<τ_0_0>) -> ()
+ // CHECK-SAME: getter @_T08keypaths1SV12reabstractedyycvpAA1PRzlACyxGTK : $@convention(thin) <τ_0_0 where τ_0_0 : P> (@in S<τ_0_0>) -> @out @callee_owned (@in ()) -> @out (),
+ // CHECK-SAME: setter @_T08keypaths1SV12reabstractedyycvpAA1PRzlACyxGTk : $@convention(thin) <τ_0_0 where τ_0_0 : P> (@in @callee_owned (@in ()) -> @out (), @inout S<τ_0_0>) -> ()
// CHECK-SAME: ) <T>
_ = \S<T>.reabstracted
@@ -132,22 +132,22 @@
// CHECK-SAME: root $τ_0_0;
// CHECK-SAME: gettable_property $Int,
// CHECK-SAME: id #P.x!getter.1 : <Self where Self : P> (Self) -> () -> Int,
- // CHECK-SAME: getter @_T08keypaths1PP1xSivAaBRzlxTK : $@convention(thin) <τ_0_0 where τ_0_0 : P> (@in τ_0_0) -> @out Int
+ // CHECK-SAME: getter @_T08keypaths1PP1xSivpAaBRzlxTK : $@convention(thin) <τ_0_0 where τ_0_0 : P> (@in τ_0_0) -> @out Int
// CHECK-SAME: ) <T>
_ = \T.x
// CHECK: keypath $WritableKeyPath<T, String>, <τ_0_0 where τ_0_0 : P> (
// CHECK-SAME: root $τ_0_0;
// CHECK-SAME: settable_property $String,
// CHECK-SAME: id #P.y!getter.1 : <Self where Self : P> (Self) -> () -> String,
- // CHECK-SAME: getter @_T08keypaths1PP1ySSvAaBRzlxTK : $@convention(thin) <τ_0_0 where τ_0_0 : P> (@in τ_0_0) -> @out String,
- // CHECK-SAME: setter @_T08keypaths1PP1ySSvAaBRzlxTk : $@convention(thin) <τ_0_0 where τ_0_0 : P> (@in String, @inout τ_0_0) -> ()
+ // CHECK-SAME: getter @_T08keypaths1PP1ySSvpAaBRzlxTK : $@convention(thin) <τ_0_0 where τ_0_0 : P> (@in τ_0_0) -> @out String,
+ // CHECK-SAME: setter @_T08keypaths1PP1ySSvpAaBRzlxTk : $@convention(thin) <τ_0_0 where τ_0_0 : P> (@in String, @inout τ_0_0) -> ()
// CHECK-SAME: ) <T>
_ = \T.y
// CHECK: keypath $KeyPath<T, String>, <τ_0_0 where τ_0_0 : P> (
// CHECK-SAME: root $τ_0_0;
// CHECK-SAME: gettable_property $String,
- // CHECK-SAME: id @_T08keypaths1PPAAE1zSSfg
+ // CHECK-SAME: id @_T08keypaths1PPAAE1zSSvg
_ = \T.z
}
@@ -160,8 +160,8 @@
func keyPathsWithSpecificGenericInstance() {
// CHECK: keypath $KeyPath<Concrete, String>, (
// CHECK-SAME: gettable_property $String,
- // CHECK-SAME: id @_T08keypaths1PPAAE1zSSfg
- // CHECK-SAME: getter @_T08keypaths1PPAAE1zSSvAA8ConcreteVTK : $@convention(thin) (@in Concrete) -> @out String
+ // CHECK-SAME: id @_T08keypaths1PPAAE1zSSvg
+ // CHECK-SAME: getter @_T08keypaths1PPAAE1zSSvpAA8ConcreteVTK : $@convention(thin) (@in Concrete) -> @out String
_ = \Concrete.z
_ = \S<Concrete>.computed
}
diff --git a/test/SILGen/lazy_global_access.swift b/test/SILGen/lazy_global_access.swift
index b73ab28..2edb883 100644
--- a/test/SILGen/lazy_global_access.swift
+++ b/test/SILGen/lazy_global_access.swift
@@ -13,11 +13,11 @@
}
// MAIN: sil hidden @_T018lazy_global_access8usePropsSi_SityF : $@convention(thin) () -> (Int, Int) {
-// MAIN: global_addr @_T018lazy_global_access0B4PropSiv : $*Int
-// MAIN: function_ref @_T018lazy_global_access4FoooV10staticPropSifau : $@convention(thin) () -> Builtin.RawPointer
+// MAIN: global_addr @_T018lazy_global_access0B4PropSivp : $*Int
+// MAIN: function_ref @_T018lazy_global_access4FoooV10staticPropSivau : $@convention(thin) () -> Builtin.RawPointer
// LIBRARY: sil hidden @_T018lazy_global_access8usePropsSi_SityF : $@convention(thin) () -> (Int, Int) {
-// LIBRARY: function_ref @_T018lazy_global_access0B4PropSifau : $@convention(thin) () -> Builtin.RawPointer
-// LIBRARY: function_ref @_T018lazy_global_access4FoooV10staticPropSifau : $@convention(thin) () -> Builtin.RawPointer
+// LIBRARY: function_ref @_T018lazy_global_access0B4PropSivau : $@convention(thin) () -> Builtin.RawPointer
+// LIBRARY: function_ref @_T018lazy_global_access4FoooV10staticPropSivau : $@convention(thin) () -> Builtin.RawPointer
func useProps() -> (Int, Int) {
return (globalProp, Fooo.staticProp)
}
diff --git a/test/SILGen/lazy_globals.swift b/test/SILGen/lazy_globals.swift
index d9267d7..4b184fb 100644
--- a/test/SILGen/lazy_globals.swift
+++ b/test/SILGen/lazy_globals.swift
@@ -2,33 +2,33 @@
// CHECK: sil private @globalinit_[[T:.*]]_func0 : $@convention(thin) () -> () {
// CHECK: alloc_global @_T012lazy_globals1xSiv
-// CHECK: [[XADDR:%.*]] = global_addr @_T012lazy_globals1xSiv : $*Int
+// CHECK: [[XADDR:%.*]] = global_addr @_T012lazy_globals1xSivp : $*Int
// CHECK: store {{%.*}} to [trivial] [[XADDR]] : $*Int
-// CHECK: sil hidden [global_init] @_T012lazy_globals1xSifau : $@convention(thin) () -> Builtin.RawPointer {
+// CHECK: sil hidden [global_init] @_T012lazy_globals1xSivau : $@convention(thin) () -> Builtin.RawPointer {
// CHECK: [[TOKEN_ADDR:%.*]] = global_addr @globalinit_[[T]]_token0 : $*Builtin.Word
// CHECK: [[TOKEN_PTR:%.*]] = address_to_pointer [[TOKEN_ADDR]] : $*Builtin.Word to $Builtin.RawPointer
// CHECK: [[INIT_FUNC:%.*]] = function_ref @globalinit_[[T]]_func0 : $@convention(thin) () -> ()
// CHECK: builtin "once"([[TOKEN_PTR]] : $Builtin.RawPointer, [[INIT_FUNC]] : $@convention(thin) () -> ()) : $()
-// CHECK: [[GLOBAL_ADDR:%.*]] = global_addr @_T012lazy_globals1xSiv : $*Int
+// CHECK: [[GLOBAL_ADDR:%.*]] = global_addr @_T012lazy_globals1xSivp : $*Int
// CHECK: [[GLOBAL_PTR:%.*]] = address_to_pointer [[GLOBAL_ADDR]] : $*Int to $Builtin.RawPointer
// CHECK: return [[GLOBAL_PTR]] : $Builtin.RawPointer
// CHECK: }
var x: Int = 0
// CHECK: sil private @globalinit_[[T:.*]]_func1 : $@convention(thin) () -> () {
-// CHECK: alloc_global @_T012lazy_globals3FooV3fooSivZ
-// CHECK: [[XADDR:%.*]] = global_addr @_T012lazy_globals3FooV3fooSivZ : $*Int
+// CHECK: alloc_global @_T012lazy_globals3FooV3fooSivpZ
+// CHECK: [[XADDR:%.*]] = global_addr @_T012lazy_globals3FooV3fooSivpZ : $*Int
// CHECK: store {{.*}} to [trivial] [[XADDR]] : $*Int
// CHECK: return
struct Foo {
-// CHECK: sil hidden [global_init] @_T012lazy_globals3FooV3fooSifau : $@convention(thin) () -> Builtin.RawPointer {
+// CHECK: sil hidden [global_init] @_T012lazy_globals3FooV3fooSivau : $@convention(thin) () -> Builtin.RawPointer {
// CHECK: [[TOKEN_ADDR:%.*]] = global_addr @globalinit_[[T]]_token1 : $*Builtin.Word
// CHECK: [[TOKEN_PTR:%.*]] = address_to_pointer [[TOKEN_ADDR]] : $*Builtin.Word to $Builtin.RawPointer
// CHECK: [[INIT_FUNC:%.*]] = function_ref @globalinit_[[T]]_func1 : $@convention(thin) () -> ()
// CHECK: builtin "once"([[TOKEN_PTR]] : $Builtin.RawPointer, [[INIT_FUNC]] : $@convention(thin) () -> ()) : $()
-// CHECK: [[GLOBAL_ADDR:%.*]] = global_addr @_T012lazy_globals3FooV3fooSivZ : $*Int
+// CHECK: [[GLOBAL_ADDR:%.*]] = global_addr @_T012lazy_globals3FooV3fooSivpZ : $*Int
// CHECK: [[GLOBAL_PTR:%.*]] = address_to_pointer [[GLOBAL_ADDR]] : $*Int to $Builtin.RawPointer
// CHECK: return [[GLOBAL_PTR]] : $Builtin.RawPointer
static var foo: Int = 22
@@ -41,18 +41,18 @@
}
// CHECK: sil private @globalinit_[[T:.*]]_func3 : $@convention(thin) () -> () {
-// CHECK: alloc_global @_T012lazy_globals3BarO3barSivZ
-// CHECK: [[XADDR:%.*]] = global_addr @_T012lazy_globals3BarO3barSivZ : $*Int
+// CHECK: alloc_global @_T012lazy_globals3BarO3barSivpZ
+// CHECK: [[XADDR:%.*]] = global_addr @_T012lazy_globals3BarO3barSivpZ : $*Int
// CHECK: store {{.*}} to [trivial] [[XADDR]] : $*Int
// CHECK: return
enum Bar {
-// CHECK: sil hidden [global_init] @_T012lazy_globals3BarO3barSifau : $@convention(thin) () -> Builtin.RawPointer {
+// CHECK: sil hidden [global_init] @_T012lazy_globals3BarO3barSivau : $@convention(thin) () -> Builtin.RawPointer {
// CHECK: [[TOKEN_ADDR:%.*]] = global_addr @globalinit_[[T]]_token3 : $*Builtin.Word
// CHECK: [[TOKEN_PTR:%.*]] = address_to_pointer [[TOKEN_ADDR]] : $*Builtin.Word to $Builtin.RawPointer
// CHECK: [[INIT_FUNC:%.*]] = function_ref @globalinit_[[T]]_func3 : $@convention(thin) () -> ()
// CHECK: builtin "once"([[TOKEN_PTR]] : $Builtin.RawPointer, [[INIT_FUNC]] : $@convention(thin) () -> ()) : $()
-// CHECK: [[GLOBAL_ADDR:%.*]] = global_addr @_T012lazy_globals3BarO3barSivZ : $*Int
+// CHECK: [[GLOBAL_ADDR:%.*]] = global_addr @_T012lazy_globals3BarO3barSivpZ : $*Int
// CHECK: [[GLOBAL_PTR:%.*]] = address_to_pointer [[GLOBAL_ADDR]] : $*Int to $Builtin.RawPointer
// CHECK: return [[GLOBAL_PTR]] : $Builtin.RawPointer
static var bar: Int = 33
@@ -65,12 +65,12 @@
// CHECK: sil private @globalinit_[[T]]_func4 : $@convention(thin) () -> () {
// CHECK: function_ref @_T012lazy_globals1fSi_SityF : $@convention(thin) () -> (Int, Int)
-// CHECK: sil hidden [global_init] @_T012lazy_globals2a1Sifau : $@convention(thin) () -> Builtin.RawPointer
+// CHECK: sil hidden [global_init] @_T012lazy_globals2a1Sivau : $@convention(thin) () -> Builtin.RawPointer
// CHECK: function_ref @globalinit_[[T]]_func4 : $@convention(thin) () -> ()
-// CHECK: global_addr @_T012lazy_globals2a1Siv : $*Int
-// CHECK: sil hidden [global_init] @_T012lazy_globals2b1Sifau : $@convention(thin) () -> Builtin.RawPointer {
+// CHECK: global_addr @_T012lazy_globals2a1Sivp : $*Int
+// CHECK: sil hidden [global_init] @_T012lazy_globals2b1Sivau : $@convention(thin) () -> Builtin.RawPointer {
// CHECK: function_ref @globalinit_[[T]]_func4 : $@convention(thin) () -> ()
-// CHECK: global_addr @_T012lazy_globals2b1Siv : $*Int
+// CHECK: global_addr @_T012lazy_globals2b1Sivp : $*Int
var (a1, b1) = f()
var computed: Int {
diff --git a/test/SILGen/lazy_globals_multiple_vars.swift b/test/SILGen/lazy_globals_multiple_vars.swift
index 35e1be2..cdbf4da 100644
--- a/test/SILGen/lazy_globals_multiple_vars.swift
+++ b/test/SILGen/lazy_globals_multiple_vars.swift
@@ -5,10 +5,10 @@
// CHECK: global_addr @_T026lazy_globals_multiple_vars1aSiv
// CHECK: alloc_global @_T026lazy_globals_multiple_vars1bSiv
// CHECK: global_addr @_T026lazy_globals_multiple_vars1bSiv
-// CHECK: sil hidden [global_init] @_T026lazy_globals_multiple_vars1aSifau
+// CHECK: sil hidden [global_init] @_T026lazy_globals_multiple_vars1aSivau
// CHECK: global_addr [[TOKEN_A_B:@globalinit_.*]] :
// CHECK: function_ref [[INIT_A_B]]
-// CHECK: sil hidden [global_init] @_T026lazy_globals_multiple_vars1bSifau
+// CHECK: sil hidden [global_init] @_T026lazy_globals_multiple_vars1bSivau
// CHECK: global_addr [[TOKEN_A_B]]
// CHECK: function_ref [[INIT_A_B]]
var (a, b) = (1, 2)
@@ -18,7 +18,7 @@
// CHECK: alloc_global @_T026lazy_globals_multiple_vars1cSiv
// CHECK: global_addr @_T026lazy_globals_multiple_vars1cSiv
// CHECK-NOT: global_addr @_T026lazy_globals_multiple_vars1dSiv
-// CHECK: sil hidden [global_init] @_T026lazy_globals_multiple_vars1cSifau
+// CHECK: sil hidden [global_init] @_T026lazy_globals_multiple_vars1cSivau
// CHECK: global_addr [[TOKEN_C:@globalinit_.*]] :
// CHECK: function_ref [[INIT_C]]
// CHECK: sil private [[INIT_D:@globalinit_.*]] :
@@ -26,7 +26,7 @@
// CHECK: alloc_global @_T026lazy_globals_multiple_vars1dSiv
// CHECK: global_addr @_T026lazy_globals_multiple_vars1dSiv
// CHECK-NOT: global_addr @_T026lazy_globals_multiple_vars1cSiv
-// CHECK: sil hidden [global_init] @_T026lazy_globals_multiple_vars1dSifau
+// CHECK: sil hidden [global_init] @_T026lazy_globals_multiple_vars1dSivau
// CHECK-NOT: global_addr [[TOKEN_C]]
// CHECK: global_addr [[TOKEN_D:@globalinit_.*]] :
// CHECK-NOT: global_addr [[TOKEN_C]]
diff --git a/test/SILGen/lazy_properties.swift b/test/SILGen/lazy_properties.swift
index e15c347..f6b362b 100644
--- a/test/SILGen/lazy_properties.swift
+++ b/test/SILGen/lazy_properties.swift
@@ -2,11 +2,11 @@
// <rdar://problem/17405715> lazy property crashes silgen of implicit memberwise initializer
-// CHECK-LABEL: sil hidden @_T015lazy_properties19StructWithLazyFieldV4onceSifg : $@convention(method) (@inout StructWithLazyField) -> Int
+// CHECK-LABEL: sil hidden @_T015lazy_properties19StructWithLazyFieldV4onceSivg : $@convention(method) (@inout StructWithLazyField) -> Int
-// CHECK-LABEL: sil hidden @_T015lazy_properties19StructWithLazyFieldV4onceSifs : $@convention(method) (Int, @inout StructWithLazyField) -> ()
+// CHECK-LABEL: sil hidden @_T015lazy_properties19StructWithLazyFieldV4onceSivs : $@convention(method) (Int, @inout StructWithLazyField) -> ()
-// CHECK-LABEL: sil hidden [transparent] @_T015lazy_properties19StructWithLazyFieldV4onceSifm : $@convention(method) (Builtin.RawPointer, @inout Builtin.UnsafeValueBuffer, @inout StructWithLazyField) -> (Builtin.RawPointer, Optional<Builtin.RawPointer>)
+// CHECK-LABEL: sil hidden [transparent] @_T015lazy_properties19StructWithLazyFieldV4onceSivm : $@convention(method) (Builtin.RawPointer, @inout Builtin.UnsafeValueBuffer, @inout StructWithLazyField) -> (Builtin.RawPointer, Optional<Builtin.RawPointer>)
// CHECK-LABEL: sil hidden @_T015lazy_properties19StructWithLazyFieldVACSiSg4once_tcfC : $@convention(method) (Optional<Int>, @thin StructWithLazyField.Type) -> @owned StructWithLazyField
@@ -23,13 +23,13 @@
// Anonymous closure parameters in lazy initializer crash SILGen
-// CHECK-LABEL: sil hidden @_T015lazy_properties22HasAnonymousParametersV1xSifg : $@convention(method) (@inout HasAnonymousParameters) -> Int
+// CHECK-LABEL: sil hidden @_T015lazy_properties22HasAnonymousParametersV1xSivg : $@convention(method) (@inout HasAnonymousParameters) -> Int
-// CHECK-LABEL: sil private @_T015lazy_properties22HasAnonymousParametersV1xSifgS2icfU_ : $@convention(thin) (Int) -> Int
+// CHECK-LABEL: sil private @_T015lazy_properties22HasAnonymousParametersV1xSivgS2icfU_ : $@convention(thin) (Int) -> Int
-// CHECK-LABEL: sil hidden @_T015lazy_properties22HasAnonymousParametersV1xSifs : $@convention(method) (Int, @inout HasAnonymousParameters) -> ()
+// CHECK-LABEL: sil hidden @_T015lazy_properties22HasAnonymousParametersV1xSivs : $@convention(method) (Int, @inout HasAnonymousParameters) -> ()
-// CHECK-LABEL: sil hidden [transparent] @_T015lazy_properties22HasAnonymousParametersV1xSifm : $@convention(method) (Builtin.RawPointer, @inout Builtin.UnsafeValueBuffer, @inout HasAnonymousParameters) -> (Builtin.RawPointer, Optional<Builtin.RawPointer>)
+// CHECK-LABEL: sil hidden [transparent] @_T015lazy_properties22HasAnonymousParametersV1xSivm : $@convention(method) (Builtin.RawPointer, @inout Builtin.UnsafeValueBuffer, @inout HasAnonymousParameters) -> (Builtin.RawPointer, Optional<Builtin.RawPointer>)
struct HasAnonymousParameters {
lazy var x = { $0 }(0)
diff --git a/test/SILGen/let_decls.swift b/test/SILGen/let_decls.swift
index d228564..947f269 100644
--- a/test/SILGen/let_decls.swift
+++ b/test/SILGen/let_decls.swift
@@ -153,7 +153,7 @@
func testGetOnlySubscript(_ x : GetOnlySubscriptStruct, idx : Int) -> Int {
return x[idx]
- // CHECK: [[SUBFN:%[0-9]+]] = function_ref @{{.*}}9subscript
+ // CHECK: [[SUBFN:%[0-9]+]] = function_ref @{{.*}}i
// CHECK-NEXT: [[CALL:%[0-9]+]] = apply [[SUBFN]](
// CHECK: return [[CALL]]
}
@@ -192,7 +192,7 @@
// CHECK-LABEL: sil hidden @{{.*}}pass_address_only_rvalue_result
// CHECK: bb0(%0 : @trivial $*T,
-// CHECK: [[FN:%[0-9]+]] = function_ref @{{.*}}GenericTestStructV9subscript{{.*}}fg
+// CHECK: [[FN:%[0-9]+]] = function_ref @{{.*}}GenericTestStructV{{.*}}ig
// CHECK: apply [[FN]]<T>(%0,
@@ -211,7 +211,7 @@
// CHECK: bb0(%0 : @trivial $Int):
// CHECK: [[FR1:%[0-9]+]] = function_ref @{{.*}}produceNMSubscriptableRValue
// CHECK-NEXT: [[RES:%[0-9]+]] = apply [[FR1]]()
-// CHECK: [[GETFN:%[0-9]+]] = function_ref @_T09let_decls23NonMutableSubscriptableV9subscript{{[_0-9a-zA-Z]*}}fg
+// CHECK: [[GETFN:%[0-9]+]] = function_ref @_T09let_decls23NonMutableSubscriptableV{{[_0-9a-zA-Z]*}}ig
// CHECK-NEXT: [[RES2:%[0-9]+]] = apply [[GETFN]](%0, [[RES]])
// CHECK-NEXT: return [[RES2]]
func test_nm_subscript_get(_ a : Int) -> Int {
@@ -222,7 +222,7 @@
// CHECK: bb0(%0 : @trivial $Int):
// CHECK: [[FR1:%[0-9]+]] = function_ref @{{.*}}produceNMSubscriptableRValue
// CHECK-NEXT: [[RES:%[0-9]+]] = apply [[FR1]]()
-// CHECK: [[SETFN:%[0-9]+]] = function_ref @_T09let_decls23NonMutableSubscriptableV9subscript{{[_0-9a-zA-Z]*}}fs
+// CHECK: [[SETFN:%[0-9]+]] = function_ref @_T09let_decls23NonMutableSubscriptableV{{[_0-9a-zA-Z]*}}is
// CHECK-NEXT: [[RES2:%[0-9]+]] = apply [[SETFN]](%0, %0, [[RES]])
func test_nm_subscript_set(_ a : Int) {
produceNMSubscriptableRValue()[a] = a
@@ -248,13 +248,13 @@
// The setter isn't mutating, so we need to load the box.
// CHECK: [[READ:%.*]] = begin_access [read] [unknown] [[PB]]
// CHECK: [[VVAL:%[0-9]+]] = load [trivial] [[READ]]
- // CHECK: [[SETFN:%[0-9]+]] = function_ref @_T09let_decls17WeirdPropertyTestV1pSifs
+ // CHECK: [[SETFN:%[0-9]+]] = function_ref @_T09let_decls17WeirdPropertyTestV1pSivs
// CHECK: apply [[SETFN]](%1, [[VVAL]])
v.p = i
// The getter is mutating, so it takes the box address.
// CHECK: [[WRITE:%.*]] = begin_access [modify] [unknown] [[PB]]
- // CHECK: [[GETFN:%[0-9]+]] = function_ref @_T09let_decls17WeirdPropertyTestV1pSifg
+ // CHECK: [[GETFN:%[0-9]+]] = function_ref @_T09let_decls17WeirdPropertyTestV1pSivg
// CHECK-NEXT: [[RES:%[0-9]+]] = apply [[GETFN]]([[WRITE]])
// CHECK: return [[RES]]
return v.p
@@ -496,7 +496,7 @@
// CHECK-LABEL: sil hidden @_T09let_decls018testAddressOnlyGetE14GlobalPropertyAA14SimpleProtocol_pyF
// CHECK: bb0(%0 : @trivial $*SimpleProtocol):
// CHECK-NEXT: // function_ref
-// CHECK-NEXT: %1 = function_ref @_T09let_decls014addressOnlyGetD14GlobalPropertyAA14SimpleProtocol_pfg
+// CHECK-NEXT: %1 = function_ref @_T09let_decls014addressOnlyGetD14GlobalPropertyAA14SimpleProtocol_pvg
// CHECK-NEXT: %2 = apply %1(%0) : $@convention(thin) () -> @out SimpleProtocol
// CHECK-NEXT: %3 = tuple ()
// CHECK-NEXT: return %3 : $()
diff --git a/test/SILGen/lifetime.swift b/test/SILGen/lifetime.swift
index f7cddab..dfe57aa 100644
--- a/test/SILGen/lifetime.swift
+++ b/test/SILGen/lifetime.swift
@@ -421,7 +421,7 @@
// CHECK: [[THIS:%[0-9]+]] = mark_uninitialized
// -- initialization for y
- // CHECK: [[Y_INIT:%[0-9]+]] = function_ref @_T08lifetime3FooC1ySi_AA3RefCtvfi : $@convention(thin) <τ_0_0> () -> (Int, @owned Ref)
+ // CHECK: [[Y_INIT:%[0-9]+]] = function_ref @_T08lifetime3FooC1ySi_AA3RefCtvpfi : $@convention(thin) <τ_0_0> () -> (Int, @owned Ref)
// CHECK: [[Y_VALUE:%[0-9]+]] = apply [[Y_INIT]]<T>()
// CHECK: [[BORROWED_Y_VALUE:%.*]] = begin_borrow [[Y_VALUE]]
// CHECK: [[Y_EXTRACTED_0:%.*]] = tuple_extract [[BORROWED_Y_VALUE]] : $(Int, Ref), 0
@@ -440,7 +440,7 @@
// CHECK: end_borrow [[BORROWED_THIS]] from [[THIS]]
// -- Initialization for w
- // CHECK: [[Z_FUNC:%.*]] = function_ref @_T{{.*}}8lifetime3FooC1wAA3RefCvfi : $@convention(thin) <τ_0_0> () -> @owned Ref
+ // CHECK: [[Z_FUNC:%.*]] = function_ref @_T{{.*}}8lifetime3FooC1wAA3RefCvpfi : $@convention(thin) <τ_0_0> () -> @owned Ref
// CHECK: [[Z_RESULT:%.*]] = apply [[Z_FUNC]]<T>()
// CHECK: [[BORROWED_THIS:%.*]] = begin_borrow [[THIS]]
// CHECK: [[THIS_Z:%.*]] = ref_element_addr [[BORROWED_THIS]]
diff --git a/test/SILGen/magic_identifiers_inside_property_initializers.swift b/test/SILGen/magic_identifiers_inside_property_initializers.swift
index bd89692..a91665b 100644
--- a/test/SILGen/magic_identifiers_inside_property_initializers.swift
+++ b/test/SILGen/magic_identifiers_inside_property_initializers.swift
@@ -1,7 +1,7 @@
// RUN: %target-swift-frontend -emit-silgen -enable-sil-ownership %s | %FileCheck %s
class Test {
- // CHECK-LABEL: sil hidden [transparent] @_T046magic_identifiers_inside_property_initializers4TestC4fileSSvfi
+ // CHECK-LABEL: sil hidden [transparent] @_T046magic_identifiers_inside_property_initializers4TestC4fileSSvpfi
// CHECK: string_literal utf16 "{{.*}}.swift"
let file = #file
}
diff --git a/test/SILGen/mangling.swift b/test/SILGen/mangling.swift
index 36e9f92..21a3aad 100644
--- a/test/SILGen/mangling.swift
+++ b/test/SILGen/mangling.swift
@@ -102,7 +102,7 @@
static var state = true && false
}
// CHECK-LABEL: // function_ref implicit closure #1 : @autoclosure () throws -> Swift.Bool in variable initialization expression of static mangling.HasVarInit.state : Swift.Bool
-// CHECK-NEXT: function_ref @_T08mangling10HasVarInitV5stateSbvZfiSbyKXKfu_
+// CHECK-NEXT: function_ref @_T08mangling10HasVarInitV5stateSbvpZfiSbyKXKfu_
// auto_closures should not collide with the equivalent non-auto_closure
// function type.
@@ -139,15 +139,15 @@
struct InstanceAndClassProperty {
var property: Int {
- // CHECK-LABEL: sil hidden @_T08mangling24InstanceAndClassPropertyV8propertySifg
+ // CHECK-LABEL: sil hidden @_T08mangling24InstanceAndClassPropertyV8propertySivg
get { return 0 }
- // CHECK-LABEL: sil hidden @_T08mangling24InstanceAndClassPropertyV8propertySifs
+ // CHECK-LABEL: sil hidden @_T08mangling24InstanceAndClassPropertyV8propertySivs
set {}
}
static var property: Int {
- // CHECK-LABEL: sil hidden @_T08mangling24InstanceAndClassPropertyV8propertySifgZ
+ // CHECK-LABEL: sil hidden @_T08mangling24InstanceAndClassPropertyV8propertySivgZ
get { return 0 }
- // CHECK-LABEL: sil hidden @_T08mangling24InstanceAndClassPropertyV8propertySifsZ
+ // CHECK-LABEL: sil hidden @_T08mangling24InstanceAndClassPropertyV8propertySivsZ
set {}
}
}
diff --git a/test/SILGen/mangling_generic_extensions.swift b/test/SILGen/mangling_generic_extensions.swift
index 78e1f9f..085893c 100644
--- a/test/SILGen/mangling_generic_extensions.swift
+++ b/test/SILGen/mangling_generic_extensions.swift
@@ -12,8 +12,8 @@
// An unconstrained extension in the same module doesn't use the extension
// mangling, since the implementation can be resiliently moved into the
// definition.
- // CHECK-LABEL: sil hidden @_T027mangling_generic_extensions3FooV1aSifg
- // NO-SELF-LABEL: sil hidden @_T027mangling_generic_extensions3FooV1aSifg
+ // CHECK-LABEL: sil hidden @_T027mangling_generic_extensions3FooV1aSivg
+ // NO-SELF-LABEL: sil hidden @_T027mangling_generic_extensions3FooV1aSivg
var a: Int { return 0 }
// NO-SELF-LABEL: sil hidden @_T027mangling_generic_extensions3FooV3zimyyF
@@ -26,18 +26,18 @@
extension Foo where T: Runcible {
// A constrained extension always uses the extension mangling.
- // CHECK-LABEL: sil hidden @_T027mangling_generic_extensions3FooVA2A8RuncibleRzlE1aSifg
+ // CHECK-LABEL: sil hidden @_T027mangling_generic_extensions3FooVA2A8RuncibleRzlE1aSivg
var a: Int { return 0 }
- // CHECK-LABEL: sil hidden @_T027mangling_generic_extensions3FooVA2A8RuncibleRzlE1bxfg
+ // CHECK-LABEL: sil hidden @_T027mangling_generic_extensions3FooVA2A8RuncibleRzlE1bxvg
var b: T { get { } }
}
extension Foo where T: Runcible, T.Spoon: Runcible {
- // CHECK-LABEL: sil hidden @_T027mangling_generic_extensions3FooVA2A8RuncibleRzAaD5SpoonRpzlE1aSifg
+ // CHECK-LABEL: sil hidden @_T027mangling_generic_extensions3FooVA2A8RuncibleRzAaD5SpoonRpzlE1aSivg
var a: Int { return 0 }
- // CHECK-LABEL: sil hidden @_T027mangling_generic_extensions3FooVA2A8RuncibleRzAaD5SpoonRpzlE1bxfg
+ // CHECK-LABEL: sil hidden @_T027mangling_generic_extensions3FooVA2A8RuncibleRzAaD5SpoonRpzlE1bxvg
var b: T { get { } }
}
diff --git a/test/SILGen/materializeForSet.swift b/test/SILGen/materializeForSet.swift
index a76c6e1..e4cf3b2 100644
--- a/test/SILGen/materializeForSet.swift
+++ b/test/SILGen/materializeForSet.swift
@@ -4,7 +4,7 @@
class Base {
var stored: Int = 0
-// CHECK-LABEL: sil hidden [transparent] @_T017materializeForSet4BaseC6storedSifm : $@convention(method) (Builtin.RawPointer, @inout Builtin.UnsafeValueBuffer, @guaranteed Base) -> (Builtin.RawPointer, Optional<Builtin.RawPointer>) {
+// CHECK-LABEL: sil hidden [transparent] @_T017materializeForSet4BaseC6storedSivm : $@convention(method) (Builtin.RawPointer, @inout Builtin.UnsafeValueBuffer, @guaranteed Base) -> (Builtin.RawPointer, Optional<Builtin.RawPointer>) {
// CHECK: bb0([[BUFFER:%.*]] : $Builtin.RawPointer, [[STORAGE:%.*]] : $*Builtin.UnsafeValueBuffer, [[SELF:%.*]] : $Base):
// CHECK: [[T0:%.*]] = ref_element_addr [[SELF]] : $Base, #Base.stored
// CHECK: [[T1:%.*]] = address_to_pointer [[T0]] : $*Int to $Builtin.RawPointer
@@ -13,7 +13,7 @@
// CHECK: return [[T3]] : $(Builtin.RawPointer, Optional<Builtin.RawPointer>)
// CHECK: }
-// UNCHECKED-LABEL: sil hidden [transparent] @_T017materializeForSet4BaseC6storedSifm : $@convention(method) (Builtin.RawPointer, @inout Builtin.UnsafeValueBuffer, @guaranteed Base) -> (Builtin.RawPointer, Optional<Builtin.RawPointer>) {
+// UNCHECKED-LABEL: sil hidden [transparent] @_T017materializeForSet4BaseC6storedSivm : $@convention(method) (Builtin.RawPointer, @inout Builtin.UnsafeValueBuffer, @guaranteed Base) -> (Builtin.RawPointer, Optional<Builtin.RawPointer>) {
// UNCHECKED: bb0([[BUFFER:%.*]] : $Builtin.RawPointer, [[STORAGE:%.*]] : $*Builtin.UnsafeValueBuffer, [[SELF:%.*]] : $Base):
// UNCHECKED: [[T0:%.*]] = ref_element_addr [[SELF]] : $Base, #Base.stored
// UNCHECKED: [[T1:%.*]] = address_to_pointer [[T0]] : $*Int to $Builtin.RawPointer
@@ -22,22 +22,22 @@
// UNCHECKED: return [[T3]] : $(Builtin.RawPointer, Optional<Builtin.RawPointer>)
// UNCHECKED: }
-// CHECK-LABEL: sil private [transparent] @_T017materializeForSet4BaseC8computedSifmytfU_ : $@convention(method) (Builtin.RawPointer, @inout Builtin.UnsafeValueBuffer, @inout Base, @thick Base.Type) -> () {
+// CHECK-LABEL: sil private [transparent] @_T017materializeForSet4BaseC8computedSivmytfU_ : $@convention(method) (Builtin.RawPointer, @inout Builtin.UnsafeValueBuffer, @inout Base, @thick Base.Type) -> () {
// CHECK: bb0([[BUFFER:%.*]] : $Builtin.RawPointer, [[STORAGE:%.*]] : $*Builtin.UnsafeValueBuffer, [[SELF:%.*]] : $*Base, [[SELFTYPE:%.*]] : $@thick Base.Type):
// CHECK: [[T0:%.*]] = load_borrow [[SELF]]
// CHECK: [[T1:%.*]] = pointer_to_address [[BUFFER]] : $Builtin.RawPointer to [strict] $*Int
// CHECK: [[T2:%.*]] = load [trivial] [[T1]] : $*Int
-// CHECK: [[SETTER:%.*]] = function_ref @_T017materializeForSet4BaseC8computedSifs
+// CHECK: [[SETTER:%.*]] = function_ref @_T017materializeForSet4BaseC8computedSivs
// CHECK: apply [[SETTER]]([[T2]], [[T0]])
-// CHECK-LABEL: sil hidden [transparent] @_T017materializeForSet4BaseC8computedSifm : $@convention(method) (Builtin.RawPointer, @inout Builtin.UnsafeValueBuffer, @guaranteed Base) -> (Builtin.RawPointer, Optional<Builtin.RawPointer>) {
+// CHECK-LABEL: sil hidden [transparent] @_T017materializeForSet4BaseC8computedSivm : $@convention(method) (Builtin.RawPointer, @inout Builtin.UnsafeValueBuffer, @guaranteed Base) -> (Builtin.RawPointer, Optional<Builtin.RawPointer>) {
// CHECK: bb0([[BUFFER:%.*]] : $Builtin.RawPointer, [[STORAGE:%.*]] : $*Builtin.UnsafeValueBuffer, [[SELF:%.*]] : $Base):
// CHECK: [[ADDR:%.*]] = pointer_to_address [[BUFFER]] : $Builtin.RawPointer to [strict] $*Int
-// CHECK: [[T0:%.*]] = function_ref @_T017materializeForSet4BaseC8computedSifg
+// CHECK: [[T0:%.*]] = function_ref @_T017materializeForSet4BaseC8computedSivg
// CHECK: [[T1:%.*]] = apply [[T0]]([[SELF]])
// CHECK: store [[T1]] to [trivial] [[ADDR]] : $*Int
// CHECK: [[BUFFER:%.*]] = address_to_pointer [[ADDR]]
-// CHECK: [[T0:%.*]] = function_ref @_T017materializeForSet4BaseC8computedSifmytfU_ : $@convention(method) (Builtin.RawPointer, @inout Builtin.UnsafeValueBuffer, @inout Base, @thick Base.Type) -> ()
+// CHECK: [[T0:%.*]] = function_ref @_T017materializeForSet4BaseC8computedSivmytfU_ : $@convention(method) (Builtin.RawPointer, @inout Builtin.UnsafeValueBuffer, @inout Base, @thick Base.Type) -> ()
// CHECK: [[T2:%.*]] = thin_function_to_pointer [[T0]]
// CHECK: [[T3:%.*]] = enum $Optional<Builtin.RawPointer>, #Optional.some!enumelt.1, [[T2]] : $Builtin.RawPointer
// CHECK: [[T4:%.*]] = tuple ([[BUFFER]] : $Builtin.RawPointer, [[T3]] : $Optional<Builtin.RawPointer>)
@@ -76,7 +76,7 @@
extension Derived : Abstractable {}
-// CHECK-LABEL: sil private [transparent] @_T017materializeForSet7DerivedCAA12AbstractableA2aDP14storedFunction6ResultQzycfmytfU_TW : $@convention(witness_method) (Builtin.RawPointer, @inout Builtin.UnsafeValueBuffer, @inout Derived, @thick Derived.Type) -> ()
+// CHECK-LABEL: sil private [transparent] @_T017materializeForSet7DerivedCAA12AbstractableA2aDP14storedFunction6ResultQzycvmytfU_TW : $@convention(witness_method) (Builtin.RawPointer, @inout Builtin.UnsafeValueBuffer, @inout Derived, @thick Derived.Type) -> ()
// CHECK: bb0(%0 : $Builtin.RawPointer, %1 : $*Builtin.UnsafeValueBuffer, %2 : $*Derived, %3 : $@thick Derived.Type):
// CHECK-NEXT: [[T0:%.*]] = load_borrow %2 : $*Derived
// CHECK-NEXT: [[SELF:%.*]] = upcast [[T0]] : $Derived to $Base
@@ -91,7 +91,7 @@
// CHECK-NEXT: tuple ()
// CHECK-NEXT: return
-// CHECK-LABEL: sil private [transparent] [thunk] @_T017materializeForSet7DerivedCAA12AbstractableA2aDP14storedFunction{{[_0-9a-zA-Z]*}}fmTW
+// CHECK-LABEL: sil private [transparent] [thunk] @_T017materializeForSet7DerivedCAA12AbstractableA2aDP14storedFunction{{[_0-9a-zA-Z]*}}vmTW
// CHECK: bb0(%0 : $Builtin.RawPointer, %1 : $*Builtin.UnsafeValueBuffer, %2 : $*Derived):
// CHECK-NEXT: [[RESULT_ADDR:%.*]] = pointer_to_address %0 : $Builtin.RawPointer to [strict] $*@callee_owned () -> @out Int
// CHECK-NEXT: [[T0:%.*]] = load_borrow %2 : $*Derived
@@ -108,7 +108,7 @@
// CHECK-NEXT: store [[T1]] to [init] [[RESULT_ADDR]]
// CHECK-NEXT: [[RESULT_PTR:%.*]] = address_to_pointer [[RESULT_ADDR]] : $*@callee_owned () -> @out Int to $Builtin.RawPointer
// CHECK-NEXT: function_ref
-// CHECK-NEXT: [[T2:%.*]] = function_ref @_T017materializeForSet7DerivedCAA12AbstractableA2aDP14storedFunction6ResultQzycfmytfU_TW
+// CHECK-NEXT: [[T2:%.*]] = function_ref @_T017materializeForSet7DerivedCAA12AbstractableA2aDP14storedFunction6ResultQzycvmytfU_TW
// CHECK-NEXT: [[T3:%.*]] = thin_function_to_pointer [[T2]]
// CHECK-NEXT: [[CALLBACK:%.*]] = enum $Optional<Builtin.RawPointer>, #Optional.some!enumelt.1, [[T3]]
// CHECK-NEXT: [[T4:%.*]] = tuple ([[RESULT_PTR]] : $Builtin.RawPointer, [[CALLBACK]] : $Optional<Builtin.RawPointer>)
@@ -116,7 +116,7 @@
// CHECK-NEXT: end_borrow [[T0]] from %2
// CHECK-NEXT: return [[T4]]
-// CHECK-LABEL: sil private [transparent] @_T017materializeForSet7DerivedCAA12AbstractableA2aDP19finalStoredFunction6ResultQzycfmytfU_TW :
+// CHECK-LABEL: sil private [transparent] @_T017materializeForSet7DerivedCAA12AbstractableA2aDP19finalStoredFunction6ResultQzycvmytfU_TW :
// CHECK: bb0(%0 : $Builtin.RawPointer, %1 : $*Builtin.UnsafeValueBuffer, %2 : $*Derived, %3 : $@thick Derived.Type):
// CHECK-NEXT: [[T0:%.*]] = load_borrow %2 : $*Derived
// CHECK-NEXT: [[SELF:%.*]] = upcast [[T0]] : $Derived to $Base
@@ -133,7 +133,7 @@
// CHECK-NEXT: tuple ()
// CHECK-NEXT: return
-// UNCHECKED-LABEL: sil private [transparent] @_T017materializeForSet7DerivedCAA12AbstractableA2aDP19finalStoredFunction6ResultQzycfmytfU_TW :
+// UNCHECKED-LABEL: sil private [transparent] @_T017materializeForSet7DerivedCAA12AbstractableA2aDP19finalStoredFunction6ResultQzycvmytfU_TW :
// UNCHECKED: bb0(%0 : $Builtin.RawPointer, %1 : $*Builtin.UnsafeValueBuffer, %2 : $*Derived, %3 : $@thick Derived.Type):
// UNCHECKED-NEXT: [[T0:%.*]] = load_borrow %2 : $*Derived
// UNCHECKED-NEXT: [[SELF:%.*]] = upcast [[T0]] : $Derived to $Base
@@ -148,7 +148,7 @@
// UNCHECKED-NEXT: tuple ()
// UNCHECKED-NEXT: return
-// CHECK-LABEL: sil private [transparent] [thunk] @_T017materializeForSet7DerivedCAA12AbstractableA2aDP19finalStoredFunction{{[_0-9a-zA-Z]*}}fmTW
+// CHECK-LABEL: sil private [transparent] [thunk] @_T017materializeForSet7DerivedCAA12AbstractableA2aDP19finalStoredFunction{{[_0-9a-zA-Z]*}}vmTW
// CHECK: bb0(%0 : $Builtin.RawPointer, %1 : $*Builtin.UnsafeValueBuffer, %2 : $*Derived):
// CHECK-NEXT: [[RESULT_ADDR:%.*]] = pointer_to_address %0 : $Builtin.RawPointer to [strict] $*@callee_owned () -> @out Int
// CHECK-NEXT: [[T0:%.*]] = load_borrow %2 : $*Derived
@@ -163,14 +163,14 @@
// CHECK-NEXT: store [[T1]] to [init] [[RESULT_ADDR]]
// CHECK-NEXT: [[RESULT_PTR:%.*]] = address_to_pointer [[RESULT_ADDR]] : $*@callee_owned () -> @out Int to $Builtin.RawPointer
// CHECK-NEXT: function_ref
-// CHECK-NEXT: [[T2:%.*]] = function_ref @_T017materializeForSet7DerivedCAA12AbstractableA2aDP19finalStoredFunction6ResultQzycfmytfU_TW
+// CHECK-NEXT: [[T2:%.*]] = function_ref @_T017materializeForSet7DerivedCAA12AbstractableA2aDP19finalStoredFunction6ResultQzycvmytfU_TW
// CHECK-NEXT: [[T3:%.*]] = thin_function_to_pointer [[T2]]
// CHECK-NEXT: [[CALLBACK:%.*]] = enum $Optional<Builtin.RawPointer>, #Optional.some!enumelt.1, [[T3]]
// CHECK-NEXT: [[T4:%.*]] = tuple ([[RESULT_PTR]] : $Builtin.RawPointer, [[CALLBACK]] : $Optional<Builtin.RawPointer>)
// CHECK-NEXT: end_borrow [[T0]] from %2
// CHECK-NEXT: return [[T4]]
-// UNCHECKED-LABEL: sil private [transparent] [thunk] @_T017materializeForSet7DerivedCAA12AbstractableA2aDP19finalStoredFunction{{[_0-9a-zA-Z]*}}fmTW
+// UNCHECKED-LABEL: sil private [transparent] [thunk] @_T017materializeForSet7DerivedCAA12AbstractableA2aDP19finalStoredFunction{{[_0-9a-zA-Z]*}}vmTW
// UNCHECKED: bb0(%0 : $Builtin.RawPointer, %1 : $*Builtin.UnsafeValueBuffer, %2 : $*Derived):
// UNCHECKED-NEXT: [[RESULT_ADDR:%.*]] = pointer_to_address %0 : $Builtin.RawPointer to [strict] $*@callee_owned () -> @out Int
// UNCHECKED-NEXT: [[T0:%.*]] = load_borrow %2 : $*Derived
@@ -183,14 +183,14 @@
// UNCHECKED-NEXT: store [[T1]] to [init] [[RESULT_ADDR]]
// UNCHECKED-NEXT: [[RESULT_PTR:%.*]] = address_to_pointer [[RESULT_ADDR]] : $*@callee_owned () -> @out Int to $Builtin.RawPointer
// UNCHECKED-NEXT: function_ref
-// UNCHECKED-NEXT: [[T2:%.*]] = function_ref @_T017materializeForSet7DerivedCAA12AbstractableA2aDP19finalStoredFunction6ResultQzycfmytfU_TW
+// UNCHECKED-NEXT: [[T2:%.*]] = function_ref @_T017materializeForSet7DerivedCAA12AbstractableA2aDP19finalStoredFunction6ResultQzycvmytfU_TW
// UNCHECKED-NEXT: [[T3:%.*]] = thin_function_to_pointer [[T2]]
// UNCHECKED-NEXT: [[CALLBACK:%.*]] = enum $Optional<Builtin.RawPointer>, #Optional.some!enumelt.1, [[T3]]
// UNCHECKED-NEXT: [[T4:%.*]] = tuple ([[RESULT_PTR]] : $Builtin.RawPointer, [[CALLBACK]] : $Optional<Builtin.RawPointer>)
// UNCHECKED-NEXT: end_borrow [[T0]] from %2
// UNCHECKED-NEXT: return [[T4]]
-// CHECK-LABEL: sil private [transparent] @_T017materializeForSet7DerivedCAA12AbstractableA2aDP14staticFunction6ResultQzycfmZytfU_TW
+// CHECK-LABEL: sil private [transparent] @_T017materializeForSet7DerivedCAA12AbstractableA2aDP14staticFunction6ResultQzycvmZytfU_TW
// CHECK: bb0([[ARG1:%.*]] : $Builtin.RawPointer, [[ARG2:%.*]] : $*Builtin.UnsafeValueBuffer, [[ARG3:%.*]] : $*@thick Derived.Type, [[ARG4:%.*]] : $@thick Derived.Type.Type):
// CHECK-NEXT: [[SELF:%.*]] = load [trivial] [[ARG3]] : $*@thick Derived.Type
// CHECK-NEXT: [[BASE_SELF:%.*]] = upcast [[SELF]] : $@thick Derived.Type to $@thick Base.Type
@@ -198,17 +198,17 @@
// CHECK-NEXT: [[VALUE:%.*]] = load [take] [[BUFFER]] : $*@callee_owned () -> @out Int
// CHECK: [[REABSTRACTOR:%.*]] = function_ref @_T0SiIxr_SiIxd_TR : $@convention(thin) (@owned @callee_owned () -> @out Int) -> Int
// CHECK-NEXT: [[NEWVALUE:%.*]] = partial_apply [[REABSTRACTOR]]([[VALUE]]) : $@convention(thin) (@owned @callee_owned () -> @out Int) -> Int
-// CHECK: [[SETTER_FN:%.*]] = function_ref @_T017materializeForSet4BaseC14staticFunctionSiycfsZ : $@convention(method) (@owned @callee_owned () -> Int, @thick Base.Type) -> ()
+// CHECK: [[SETTER_FN:%.*]] = function_ref @_T017materializeForSet4BaseC14staticFunctionSiycvsZ : $@convention(method) (@owned @callee_owned () -> Int, @thick Base.Type) -> ()
// CHECK-NEXT: apply [[SETTER_FN]]([[NEWVALUE]], [[BASE_SELF]]) : $@convention(method) (@owned @callee_owned () -> Int, @thick Base.Type) -> ()
// CHECK-NEXT: [[RESULT:%.*]] = tuple ()
// CHECK-NEXT: return [[RESULT]] : $()
-// CHECK-LABEL: sil private [transparent] [thunk] @_T017materializeForSet7DerivedCAA12AbstractableA2aDP14staticFunction6ResultQzycfmZTW
+// CHECK-LABEL: sil private [transparent] [thunk] @_T017materializeForSet7DerivedCAA12AbstractableA2aDP14staticFunction6ResultQzycvmZTW
// CHECK: bb0(%0 : $Builtin.RawPointer, %1 : $*Builtin.UnsafeValueBuffer, %2 : $@thick Derived.Type):
// CHECK-NEXT: [[RESULT_ADDR:%.*]] = pointer_to_address %0 : $Builtin.RawPointer to [strict] $*@callee_owned () -> @out Int
// CHECK-NEXT: [[SELF:%.*]] = upcast %2 : $@thick Derived.Type to $@thick Base.Type
// CHECK-NEXT: [[OUT:%.*]] = alloc_stack $@callee_owned () -> Int
-// CHECK: [[GETTER:%.*]] = function_ref @_T017materializeForSet4BaseC14staticFunctionSiycfgZ : $@convention(method) (@thick Base.Type) -> @owned @callee_owned () -> Int
+// CHECK: [[GETTER:%.*]] = function_ref @_T017materializeForSet4BaseC14staticFunctionSiycvgZ : $@convention(method) (@thick Base.Type) -> @owned @callee_owned () -> Int
// CHECK-NEXT: [[VALUE:%.*]] = apply [[GETTER]]([[SELF]]) : $@convention(method) (@thick Base.Type) -> @owned @callee_owned () -> Int
// CHECK-NEXT: store [[VALUE]] to [init] [[OUT]] : $*@callee_owned () -> Int
// CHECK-NEXT: [[VALUE:%.*]] = load [copy] [[OUT]] : $*@callee_owned () -> Int
@@ -217,7 +217,7 @@
// CHECK-NEXT: destroy_addr [[OUT]] : $*@callee_owned () -> Int
// CHECK-NEXT: store [[NEWVALUE]] to [init] [[RESULT_ADDR]] : $*@callee_owned () -> @out Int
// CHECK-NEXT: [[ADDR:%.*]] = address_to_pointer [[RESULT_ADDR]] : $*@callee_owned () -> @out Int to $Builtin.RawPointer
-// CHECK: [[CALLBACK_FN:%.*]] = function_ref @_T017materializeForSet7DerivedCAA12AbstractableA2aDP14staticFunction6ResultQzycfmZytfU_TW : $@convention(witness_method) (Builtin.RawPointer, @inout Builtin.UnsafeValueBuffer, @inout @thick Derived.Type, @thick Derived.Type.Type) -> ()
+// CHECK: [[CALLBACK_FN:%.*]] = function_ref @_T017materializeForSet7DerivedCAA12AbstractableA2aDP14staticFunction6ResultQzycvmZytfU_TW : $@convention(witness_method) (Builtin.RawPointer, @inout Builtin.UnsafeValueBuffer, @inout @thick Derived.Type, @thick Derived.Type.Type) -> ()
// CHECK-NEXT: [[CALLBACK_ADDR:%.*]] = thin_function_to_pointer [[CALLBACK_FN]] : $@convention(witness_method) (Builtin.RawPointer, @inout Builtin.UnsafeValueBuffer, @inout @thick Derived.Type, @thick Derived.Type.Type) -> () to $Builtin.RawPointer
// CHECK-NEXT: [[CALLBACK:%.*]] = enum $Optional<Builtin.RawPointer>, #Optional.some!enumelt.1, [[CALLBACK_ADDR]] : $Builtin.RawPointer
// CHECK-NEXT: [[RESULT:%.*]] = tuple ([[ADDR]] : $Builtin.RawPointer, [[CALLBACK]] : $Optional<Builtin.RawPointer>)
@@ -256,14 +256,14 @@
didSet {}
}
-// CHECK-LABEL: sil hidden [transparent] @_T017materializeForSet06HasDidC0C6storedSifm : $@convention(method) (Builtin.RawPointer, @inout Builtin.UnsafeValueBuffer, @guaranteed HasDidSet) -> (Builtin.RawPointer, Optional<Builtin.RawPointer>) {
+// CHECK-LABEL: sil hidden [transparent] @_T017materializeForSet06HasDidC0C6storedSivm : $@convention(method) (Builtin.RawPointer, @inout Builtin.UnsafeValueBuffer, @guaranteed HasDidSet) -> (Builtin.RawPointer, Optional<Builtin.RawPointer>) {
// CHECK: bb0([[BUFFER:%.*]] : $Builtin.RawPointer, [[STORAGE:%.*]] : $*Builtin.UnsafeValueBuffer, [[SELF:%.*]] : $HasDidSet):
// CHECK: [[T2:%.*]] = pointer_to_address [[BUFFER]] : $Builtin.RawPointer to [strict] $*Int
-// CHECK: [[T0:%.*]] = function_ref @_T017materializeForSet06HasDidC0C6storedSifg
+// CHECK: [[T0:%.*]] = function_ref @_T017materializeForSet06HasDidC0C6storedSivg
// CHECK: [[T1:%.*]] = apply [[T0]]([[SELF]])
// CHECK: store [[T1]] to [trivial] [[T2]] : $*Int
// CHECK: [[BUFFER:%.*]] = address_to_pointer [[T2]]
-// CHECK: [[CALLBACK_FN:%.*]] = function_ref @_T017materializeForSet06HasDidC0C6storedSifmytfU_ : $@convention(method) (Builtin.RawPointer, @inout Builtin.UnsafeValueBuffer, @inout HasDidSet, @thick HasDidSet.Type) -> ()
+// CHECK: [[CALLBACK_FN:%.*]] = function_ref @_T017materializeForSet06HasDidC0C6storedSivmytfU_ : $@convention(method) (Builtin.RawPointer, @inout Builtin.UnsafeValueBuffer, @inout HasDidSet, @thick HasDidSet.Type) -> ()
// CHECK: [[CALLBACK_ADDR:%.*]] = thin_function_to_pointer [[CALLBACK_FN]]
// CHECK: [[CALLBACK:%.*]] = enum $Optional<Builtin.RawPointer>, #Optional.some!enumelt.1, [[CALLBACK_ADDR]]
// CHECK: [[T4:%.*]] = tuple ([[BUFFER]] : $Builtin.RawPointer, [[CALLBACK]] : $Optional<Builtin.RawPointer>)
@@ -275,14 +275,14 @@
set(value) {}
}
-// CHECK-LABEL: sil hidden [transparent] @_T017materializeForSet06HasDidC0C8computedSifm : $@convention(method) (Builtin.RawPointer, @inout Builtin.UnsafeValueBuffer, @guaranteed HasDidSet) -> (Builtin.RawPointer, Optional<Builtin.RawPointer>) {
+// CHECK-LABEL: sil hidden [transparent] @_T017materializeForSet06HasDidC0C8computedSivm : $@convention(method) (Builtin.RawPointer, @inout Builtin.UnsafeValueBuffer, @guaranteed HasDidSet) -> (Builtin.RawPointer, Optional<Builtin.RawPointer>) {
// CHECK: bb0([[BUFFER:%.*]] : $Builtin.RawPointer, [[STORAGE:%.*]] : $*Builtin.UnsafeValueBuffer, [[SELF:%.*]] : $HasDidSet):
// CHECK: [[T2:%.*]] = pointer_to_address [[BUFFER]] : $Builtin.RawPointer to [strict] $*Int
-// CHECK: [[T0:%.*]] = function_ref @_T017materializeForSet06HasDidC0C8computedSifg
+// CHECK: [[T0:%.*]] = function_ref @_T017materializeForSet06HasDidC0C8computedSivg
// CHECK: [[T1:%.*]] = apply [[T0]]([[SELF]])
// CHECK: store [[T1]] to [trivial] [[T2]] : $*Int
// CHECK: [[BUFFER:%.*]] = address_to_pointer [[T2]]
-// CHECK: [[CALLBACK_FN:%.*]] = function_ref @_T017materializeForSet06HasDidC0C8computedSifmytfU_ : $@convention(method) (Builtin.RawPointer, @inout Builtin.UnsafeValueBuffer, @inout HasDidSet, @thick HasDidSet.Type) -> ()
+// CHECK: [[CALLBACK_FN:%.*]] = function_ref @_T017materializeForSet06HasDidC0C8computedSivmytfU_ : $@convention(method) (Builtin.RawPointer, @inout Builtin.UnsafeValueBuffer, @inout HasDidSet, @thick HasDidSet.Type) -> ()
// CHECK: [[CALLBACK_ADDR:%.*]] = thin_function_to_pointer [[CALLBACK_FN]]
// CHECK: [[CALLBACK:%.*]] = enum $Optional<Builtin.RawPointer>, #Optional.some!enumelt.1, [[CALLBACK_ADDR]]
// CHECK: [[T4:%.*]] = tuple ([[BUFFER]] : $Builtin.RawPointer, [[CALLBACK]] : $Optional<Builtin.RawPointer>)
@@ -295,24 +295,24 @@
didSet {}
}
-// CHECK-LABEL: sil private [transparent] @_T017materializeForSet012HasStoredDidC0C6storedSifmytfU_ : $@convention(method) (Builtin.RawPointer, @inout Builtin.UnsafeValueBuffer, @inout HasStoredDidSet, @thick HasStoredDidSet.Type) -> () {
+// CHECK-LABEL: sil private [transparent] @_T017materializeForSet012HasStoredDidC0C6storedSivmytfU_ : $@convention(method) (Builtin.RawPointer, @inout Builtin.UnsafeValueBuffer, @inout HasStoredDidSet, @thick HasStoredDidSet.Type) -> () {
// CHECK: bb0([[BUFFER:%.*]] : $Builtin.RawPointer, [[STORAGE:%.*]] : $*Builtin.UnsafeValueBuffer, [[SELF:%.*]] : $*HasStoredDidSet, [[METATYPE:%.*]] : $@thick HasStoredDidSet.Type):
// CHECK: [[SELF_VALUE:%.*]] = load_borrow [[SELF]] : $*HasStoredDidSet
// CHECK: [[BUFFER_ADDR:%.*]] = pointer_to_address [[BUFFER]] : $Builtin.RawPointer to [strict] $*Int
// CHECK: [[VALUE:%.*]] = load [trivial] [[BUFFER_ADDR]] : $*Int
-// CHECK: [[SETTER_FN:%.*]] = function_ref @_T017materializeForSet012HasStoredDidC0C6storedSifs : $@convention(method) (Int, @guaranteed HasStoredDidSet) -> ()
+// CHECK: [[SETTER_FN:%.*]] = function_ref @_T017materializeForSet012HasStoredDidC0C6storedSivs : $@convention(method) (Int, @guaranteed HasStoredDidSet) -> ()
// CHECK: apply [[SETTER_FN]]([[VALUE]], [[SELF_VALUE]]) : $@convention(method) (Int, @guaranteed HasStoredDidSet) -> ()
// CHECK: return
// CHECK: }
-// CHECK-LABEL: sil hidden [transparent] @_T017materializeForSet012HasStoredDidC0C6storedSifm : $@convention(method) (Builtin.RawPointer, @inout Builtin.UnsafeValueBuffer, @guaranteed HasStoredDidSet) -> (Builtin.RawPointer, Optional<Builtin.RawPointer>) {
+// CHECK-LABEL: sil hidden [transparent] @_T017materializeForSet012HasStoredDidC0C6storedSivm : $@convention(method) (Builtin.RawPointer, @inout Builtin.UnsafeValueBuffer, @guaranteed HasStoredDidSet) -> (Builtin.RawPointer, Optional<Builtin.RawPointer>) {
// CHECK: bb0([[BUFFER:%.*]] : $Builtin.RawPointer, [[STORAGE:%.*]] : $*Builtin.UnsafeValueBuffer, [[SELF:%.*]] : $HasStoredDidSet):
// CHECK: [[T2:%.*]] = pointer_to_address [[BUFFER]] : $Builtin.RawPointer to [strict] $*Int
-// CHECK: [[T0:%.*]] = function_ref @_T017materializeForSet012HasStoredDidC0C6storedSifg
+// CHECK: [[T0:%.*]] = function_ref @_T017materializeForSet012HasStoredDidC0C6storedSivg
// CHECK: [[T1:%.*]] = apply [[T0]]([[SELF]])
// CHECK: store [[T1]] to [trivial] [[T2]] : $*Int
// CHECK: [[BUFFER:%.*]] = address_to_pointer [[T2]]
-// CHECK: [[CALLBACK_FN:%.*]] = function_ref @_T017materializeForSet012HasStoredDidC0C6storedSifmytfU_ : $@convention(method) (Builtin.RawPointer, @inout Builtin.UnsafeValueBuffer, @inout HasStoredDidSet, @thick HasStoredDidSet.Type) -> ()
+// CHECK: [[CALLBACK_FN:%.*]] = function_ref @_T017materializeForSet012HasStoredDidC0C6storedSivmytfU_ : $@convention(method) (Builtin.RawPointer, @inout Builtin.UnsafeValueBuffer, @inout HasStoredDidSet, @thick HasStoredDidSet.Type) -> ()
// CHECK: [[CALLBACK_ADDR:%.*]] = thin_function_to_pointer [[CALLBACK_FN]]
// CHECK: [[CALLBACK:%.*]] = enum $Optional<Builtin.RawPointer>, #Optional.some!enumelt.1, [[CALLBACK_ADDR]]
// CHECK: [[T4:%.*]] = tuple ([[BUFFER]] : $Builtin.RawPointer, [[CALLBACK]] : $Optional<Builtin.RawPointer>)
@@ -323,7 +323,7 @@
class HasWeak {
weak var weakvar: HasWeak?
}
-// CHECK-LABEL: sil hidden [transparent] @_T017materializeForSet7HasWeakC7weakvarACSgXwfm : $@convention(method) (Builtin.RawPointer, @inout Builtin.UnsafeValueBuffer, @guaranteed HasWeak) -> (Builtin.RawPointer, Optional<Builtin.RawPointer>) {
+// CHECK-LABEL: sil hidden [transparent] @_T017materializeForSet7HasWeakC7weakvarACSgXwvm : $@convention(method) (Builtin.RawPointer, @inout Builtin.UnsafeValueBuffer, @guaranteed HasWeak) -> (Builtin.RawPointer, Optional<Builtin.RawPointer>) {
// CHECK: bb0([[BUFFER:%.*]] : $Builtin.RawPointer, [[STORAGE:%.*]] : $*Builtin.UnsafeValueBuffer, [[SELF:%.*]] : $HasWeak):
// CHECK: [[T2:%.*]] = pointer_to_address [[BUFFER]] : $Builtin.RawPointer to [strict] $*Optional<HasWeak>
// CHECK: [[T0:%.*]] = ref_element_addr [[SELF]] : $HasWeak, #HasWeak.weakvar
@@ -332,19 +332,19 @@
// CHECK: end_access [[READ]] : $*@sil_weak Optional<HasWeak>
// CHECK: store [[T1]] to [init] [[T2]] : $*Optional<HasWeak>
// CHECK: [[BUFFER:%.*]] = address_to_pointer [[T2]]
-// CHECK: [[T0:%.*]] = function_ref @_T017materializeForSet7HasWeakC7weakvarACSgXwfmytfU_ : $@convention(method) (Builtin.RawPointer, @inout Builtin.UnsafeValueBuffer, @inout HasWeak, @thick HasWeak.Type) -> ()
+// CHECK: [[T0:%.*]] = function_ref @_T017materializeForSet7HasWeakC7weakvarACSgXwvmytfU_ : $@convention(method) (Builtin.RawPointer, @inout Builtin.UnsafeValueBuffer, @inout HasWeak, @thick HasWeak.Type) -> ()
// CHECK: [[T4:%.*]] = tuple ([[BUFFER]] : $Builtin.RawPointer, {{.*}} : $Optional<Builtin.RawPointer>)
// CHECK: return [[T4]] : $(Builtin.RawPointer, Optional<Builtin.RawPointer>)
// CHECK: }
-// UNCHECKED-LABEL: sil hidden [transparent] @_T017materializeForSet7HasWeakC7weakvarACSgXwfm : $@convention(method) (Builtin.RawPointer, @inout Builtin.UnsafeValueBuffer, @guaranteed HasWeak) -> (Builtin.RawPointer, Optional<Builtin.RawPointer>) {
+// UNCHECKED-LABEL: sil hidden [transparent] @_T017materializeForSet7HasWeakC7weakvarACSgXwvm : $@convention(method) (Builtin.RawPointer, @inout Builtin.UnsafeValueBuffer, @guaranteed HasWeak) -> (Builtin.RawPointer, Optional<Builtin.RawPointer>) {
// UNCHECKED: bb0([[BUFFER:%.*]] : $Builtin.RawPointer, [[STORAGE:%.*]] : $*Builtin.UnsafeValueBuffer, [[SELF:%.*]] : $HasWeak):
// UNCHECKED: [[T2:%.*]] = pointer_to_address [[BUFFER]] : $Builtin.RawPointer to [strict] $*Optional<HasWeak>
// UNCHECKED: [[T0:%.*]] = ref_element_addr [[SELF]] : $HasWeak, #HasWeak.weakvar
// UNCHECKED: [[T1:%.*]] = load_weak [[T0]] : $*@sil_weak Optional<HasWeak>
// UNCHECKED: store [[T1]] to [init] [[T2]] : $*Optional<HasWeak>
// UNCHECKED: [[BUFFER:%.*]] = address_to_pointer [[T2]]
-// UNCHECKED: [[T0:%.*]] = function_ref @_T017materializeForSet7HasWeakC7weakvarACSgXwfmytfU_ : $@convention(method) (Builtin.RawPointer, @inout Builtin.UnsafeValueBuffer, @inout HasWeak, @thick HasWeak.Type) -> ()
+// UNCHECKED: [[T0:%.*]] = function_ref @_T017materializeForSet7HasWeakC7weakvarACSgXwvmytfU_ : $@convention(method) (Builtin.RawPointer, @inout Builtin.UnsafeValueBuffer, @inout HasWeak, @thick HasWeak.Type) -> ()
// UNCHECKED: [[T4:%.*]] = tuple ([[BUFFER]] : $Builtin.RawPointer, {{.*}} : $Optional<Builtin.RawPointer>)
// UNCHECKED: return [[T4]] : $(Builtin.RawPointer, Optional<Builtin.RawPointer>)
// UNCHECKED: }
@@ -370,7 +370,7 @@
// Call the getter and materialize the result in the temporary.
// CHECK-NEXT: [[T0:%.*]] = load [trivial] [[WRITE:.*]] : $*Wizard
// CHECK-NEXT: function_ref
-// CHECK-NEXT: [[GETTER:%.*]] = function_ref @_T017materializeForSet5MagicPAAE5hocusSifg
+// CHECK-NEXT: [[GETTER:%.*]] = function_ref @_T017materializeForSet5MagicPAAE5hocusSivg
// CHECK-NEXT: [[WTEMP:%.*]] = alloc_stack $Wizard
// CHECK-NEXT: store [[T0]] to [trivial] [[WTEMP]]
// CHECK-NEXT: [[T0:%.*]] = apply [[GETTER]]<Wizard>([[WTEMP]])
@@ -380,7 +380,7 @@
// CHECK-NEXT: apply [[IMPROVE]]([[TEMP]])
// CHECK-NEXT: [[T0:%.*]] = load [trivial] [[TEMP]]
// CHECK-NEXT: function_ref
-// CHECK-NEXT: [[SETTER:%.*]] = function_ref @_T017materializeForSet5MagicPAAE5hocusSifs
+// CHECK-NEXT: [[SETTER:%.*]] = function_ref @_T017materializeForSet5MagicPAAE5hocusSivs
// CHECK-NEXT: apply [[SETTER]]<Wizard>([[T0]], [[WRITE]])
// CHECK-NEXT: end_access [[WRITE]] : $*Wizard
// CHECK-NEXT: dealloc_stack [[TEMP]]
@@ -393,7 +393,7 @@
var total: Int
}
-// CHECK-LABEL: sil hidden [transparent] @_T017materializeForSet4BillV5totalSifm : $@convention(method) (Builtin.RawPointer, @inout Builtin.UnsafeValueBuffer, @inout Bill) -> (Builtin.RawPointer, Optional<Builtin.RawPointer>) {
+// CHECK-LABEL: sil hidden [transparent] @_T017materializeForSet4BillV5totalSivm : $@convention(method) (Builtin.RawPointer, @inout Builtin.UnsafeValueBuffer, @inout Bill) -> (Builtin.RawPointer, Optional<Builtin.RawPointer>) {
// CHECK: bb0([[BUFFER:%.*]] : $Builtin.RawPointer, [[STORAGE:%.*]] : $*Builtin.UnsafeValueBuffer, [[SELF:%.*]] : $*Bill):
// CHECK: [[T0:%.*]] = struct_element_addr [[SELF]] : $*Bill, #Bill.total
// CHECK: [[T1:%.*]] = address_to_pointer [[T0]] : $*Int to $Builtin.RawPointer
@@ -402,9 +402,9 @@
// CHECK: return [[T4]] : $(Builtin.RawPointer, Optional<Builtin.RawPointer>)
// CHECK: }
-// CHECK-LABEL: sil private [transparent] [thunk] @_T017materializeForSet4BillVAA8TotalledA2aDP5totalSifmTW : $@convention(witness_method) (Builtin.RawPointer, @inout Builtin.UnsafeValueBuffer, @inout Bill) -> (Builtin.RawPointer, Optional<Builtin.RawPointer>) {
+// CHECK-LABEL: sil private [transparent] [thunk] @_T017materializeForSet4BillVAA8TotalledA2aDP5totalSivmTW : $@convention(witness_method) (Builtin.RawPointer, @inout Builtin.UnsafeValueBuffer, @inout Bill) -> (Builtin.RawPointer, Optional<Builtin.RawPointer>) {
// CHECK: bb0([[BUFFER:%.*]] : $Builtin.RawPointer, [[STORAGE:%.*]] : $*Builtin.UnsafeValueBuffer, [[SELF:%.*]] : $*Bill):
-// CHECK: [[T0:%.*]] = function_ref @_T017materializeForSet4BillV5totalSifm
+// CHECK: [[T0:%.*]] = function_ref @_T017materializeForSet4BillV5totalSivm
// CHECK-NEXT: [[T1:%.*]] = apply [[T0]]([[BUFFER]], [[STORAGE]], [[SELF]])
// CHECK-NEXT: [[LEFT:%.*]] = tuple_extract [[T1]]
// CHECK-NEXT: [[RIGHT:%.*]] = tuple_extract [[T1]]
@@ -435,26 +435,26 @@
subscript<T>(_: T) -> T { get { } set { } }
}
-// CHECK-LABEL: sil private [transparent] @_T017materializeForSet23GenericSubscriptWitnessV9subscriptxxclufmytfU_ : $@convention(method) <T> (Builtin.RawPointer, @inout Builtin.UnsafeValueBuffer, @inout GenericSubscriptWitness, @thick GenericSubscriptWitness.Type) -> () {
+// CHECK-LABEL: sil private [transparent] @_T017materializeForSet23GenericSubscriptWitnessVxxcluimytfU_ : $@convention(method) <T> (Builtin.RawPointer, @inout Builtin.UnsafeValueBuffer, @inout GenericSubscriptWitness, @thick GenericSubscriptWitness.Type) -> () {
// CHECK: bb0(%0 : $Builtin.RawPointer, %1 : $*Builtin.UnsafeValueBuffer, %2 : $*GenericSubscriptWitness, %3 : $@thick GenericSubscriptWitness.Type):
// CHECK: [[BUFFER:%.*]] = project_value_buffer $T in %1 : $*Builtin.UnsafeValueBuffer
// CHECK-NEXT: [[INDICES:%.*]] = pointer_to_address %0 : $Builtin.RawPointer to [strict] $*T
-// CHECK: [[SETTER:%.*]] = function_ref @_T017materializeForSet23GenericSubscriptWitnessV9subscriptxxclufs : $@convention(method) <τ_0_0> (@in τ_0_0, @in τ_0_0, @inout GenericSubscriptWitness) -> ()
+// CHECK: [[SETTER:%.*]] = function_ref @_T017materializeForSet23GenericSubscriptWitnessVxxcluis : $@convention(method) <τ_0_0> (@in τ_0_0, @in τ_0_0, @inout GenericSubscriptWitness) -> ()
// CHECK-NEXT: apply [[SETTER]]<T>([[INDICES]], [[BUFFER]], %2) : $@convention(method) <τ_0_0> (@in τ_0_0, @in τ_0_0, @inout GenericSubscriptWitness) -> ()
// CHECK-NEXT: dealloc_value_buffer $*T in %1 : $*Builtin.UnsafeValueBuffer
// CHECK-NEXT: [[RESULT:%.*]] = tuple ()
// CHECK-NEXT: return [[RESULT]] : $()
-// CHECK-LABEL: sil hidden [transparent] @_T017materializeForSet23GenericSubscriptWitnessV9subscriptxxclufm : $@convention(method) <T> (Builtin.RawPointer, @inout Builtin.UnsafeValueBuffer, @in T, @inout GenericSubscriptWitness) -> (Builtin.RawPointer, Optional<Builtin.RawPointer>) {
+// CHECK-LABEL: sil hidden [transparent] @_T017materializeForSet23GenericSubscriptWitnessVxxcluim : $@convention(method) <T> (Builtin.RawPointer, @inout Builtin.UnsafeValueBuffer, @in T, @inout GenericSubscriptWitness) -> (Builtin.RawPointer, Optional<Builtin.RawPointer>) {
// CHECK: bb0(%0 : $Builtin.RawPointer, %1 : $*Builtin.UnsafeValueBuffer, %2 : $*T, %3 : $*GenericSubscriptWitness):
// CHECK-NEXT: [[BUFFER:%.*]] = alloc_value_buffer $T in %1 : $*Builtin.UnsafeValueBuffer
// CHECK-NEXT: copy_addr %2 to [initialization] [[BUFFER]] : $*T
// CHECK-NEXT: [[VALUE:%.*]] = pointer_to_address %0 : $Builtin.RawPointer to [strict] $*T
// CHECK-NEXT: [[SELF:%.*]] = load [trivial] %3 : $*GenericSubscriptWitness
-// CHECK: [[GETTER:%.*]] = function_ref @_T017materializeForSet23GenericSubscriptWitnessV9subscriptxxclufg : $@convention(method) <τ_0_0> (@in τ_0_0, GenericSubscriptWitness) -> @out τ_0_0
+// CHECK: [[GETTER:%.*]] = function_ref @_T017materializeForSet23GenericSubscriptWitnessVxxcluig : $@convention(method) <τ_0_0> (@in τ_0_0, GenericSubscriptWitness) -> @out τ_0_0
// CHECK-NEXT: apply [[GETTER]]<T>([[VALUE]], %2, [[SELF]]) : $@convention(method) <τ_0_0> (@in τ_0_0, GenericSubscriptWitness) -> @out τ_0_0
// CHECK-NEXT: [[VALUE_PTR:%.*]] = address_to_pointer [[VALUE]] : $*T to $Builtin.RawPointer
-// CHECK: [[CALLBACK:%.*]] = function_ref @_T017materializeForSet23GenericSubscriptWitnessV9subscriptxxclufmytfU_
+// CHECK: [[CALLBACK:%.*]] = function_ref @_T017materializeForSet23GenericSubscriptWitnessVxxcluimytfU_
// CHECK-NEXT: [[CALLBACK_PTR:%.*]] = thin_function_to_pointer [[CALLBACK]] : $@convention(method) <τ_0_0> (Builtin.RawPointer, @inout Builtin.UnsafeValueBuffer, @inout GenericSubscriptWitness, @thick GenericSubscriptWitness.Type) -> () to $Builtin.RawPointer
// CHECK-NEXT: [[CALLBACK_OPTIONAL:%.*]] = enum $Optional<Builtin.RawPointer>, #Optional.some!enumelt.1, [[CALLBACK_PTR]] : $Builtin.RawPointer
// CHECK-NEXT: [[RESULT:%.*]] = tuple ([[VALUE_PTR]] : $Builtin.RawPointer, [[CALLBACK_OPTIONAL]] : $Optional<Builtin.RawPointer>)
@@ -482,11 +482,11 @@
}
}
-// CHECK-LABEL: sil hidden @_T017materializeForSet30InferredRequirementOnSubscriptV9subscriptAA015GenericTypeWithE0VyxGSicAA5MagicRzlufg : $@convention(method) <T where T : Magic> (Int, InferredRequirementOnSubscript) -> GenericTypeWithRequirement<T>
+// CHECK-LABEL: sil hidden @_T017materializeForSet30InferredRequirementOnSubscriptVAA015GenericTypeWithE0VyxGSicAA5MagicRzluig : $@convention(method) <T where T : Magic> (Int, InferredRequirementOnSubscript) -> GenericTypeWithRequirement<T>
-// CHECK-LABEL: sil hidden @_T017materializeForSet30InferredRequirementOnSubscriptV9subscriptAA015GenericTypeWithE0VyxGSicAA5MagicRzlufs : $@convention(method) <T where T : Magic> (GenericTypeWithRequirement<T>, Int, @inout InferredRequirementOnSubscript) -> ()
+// CHECK-LABEL: sil hidden @_T017materializeForSet30InferredRequirementOnSubscriptVAA015GenericTypeWithE0VyxGSicAA5MagicRzluis : $@convention(method) <T where T : Magic> (GenericTypeWithRequirement<T>, Int, @inout InferredRequirementOnSubscript) -> ()
-// CHECK-LABEL: sil hidden [transparent] @_T017materializeForSet30InferredRequirementOnSubscriptV9subscriptAA015GenericTypeWithE0VyxGSicAA5MagicRzlufm : $@convention(method) <T where T : Magic> (Builtin.RawPointer, @inout Builtin.UnsafeValueBuffer, Int, @inout InferredRequirementOnSubscript) -> (Builtin.RawPointer, Optional<Builtin.RawPointer>)
+// CHECK-LABEL: sil hidden [transparent] @_T017materializeForSet30InferredRequirementOnSubscriptVAA015GenericTypeWithE0VyxGSicAA5MagicRzluim : $@convention(method) <T where T : Magic> (Builtin.RawPointer, @inout Builtin.UnsafeValueBuffer, Int, @inout InferredRequirementOnSubscript) -> (Builtin.RawPointer, Optional<Builtin.RawPointer>)
// Test for materializeForSet vs static properties of structs.
@@ -568,23 +568,23 @@
struct TuxedoPanda : Panda { }
-// CHECK-LABEL: sil private [transparent] @_T017materializeForSet11TuxedoPandaVAA0E0A2aDP1xxxcfmytfU_TW : $@convention(witness_method) (Builtin.RawPointer, @inout Builtin.UnsafeValueBuffer, @inout TuxedoPanda, @thick TuxedoPanda.Type) -> ()
+// CHECK-LABEL: sil private [transparent] @_T017materializeForSet11TuxedoPandaVAA0E0A2aDP1xxxcvmytfU_TW : $@convention(witness_method) (Builtin.RawPointer, @inout Builtin.UnsafeValueBuffer, @inout TuxedoPanda, @thick TuxedoPanda.Type) -> ()
// FIXME: Useless re-abstractions
// CHECK: function_ref @_T017materializeForSet11TuxedoPandaVACIxir_A2CIxyd_TR : $@convention(thin) (TuxedoPanda, @owned @callee_owned (@in TuxedoPanda) -> @out TuxedoPanda) -> TuxedoPanda
- // CHECK: function_ref @_T017materializeForSet5PandaPAAE1xxxcfs : $@convention(method) <τ_0_0 where τ_0_0 : Panda> (@owned @callee_owned (@in τ_0_0) -> @out τ_0_0, @inout τ_0_0) -> ()
+ // CHECK: function_ref @_T017materializeForSet5PandaPAAE1xxxcvs : $@convention(method) <τ_0_0 where τ_0_0 : Panda> (@owned @callee_owned (@in τ_0_0) -> @out τ_0_0, @inout τ_0_0) -> ()
// CHECK: function_ref @_T017materializeForSet11TuxedoPandaVACIxyd_A2CIxir_TR : $@convention(thin) (@in TuxedoPanda, @owned @callee_owned (TuxedoPanda) -> TuxedoPanda) -> @out TuxedoPanda
// CHECK: }
-// CHECK-LABEL: sil private [transparent] [thunk] @_T017materializeForSet11TuxedoPandaVAA0E0A2aDP1xxxcfmTW
+// CHECK-LABEL: sil private [transparent] [thunk] @_T017materializeForSet11TuxedoPandaVAA0E0A2aDP1xxxcvmTW
// Call the getter:
- // CHECK: function_ref @_T017materializeForSet5PandaPAAE1xxxcfg : $@convention(method) <τ_0_0 where τ_0_0 : Panda> (@in_guaranteed τ_0_0) -> @owned @callee_owned (@in τ_0_0) -> @out τ_0_0
+ // CHECK: function_ref @_T017materializeForSet5PandaPAAE1xxxcvg : $@convention(method) <τ_0_0 where τ_0_0 : Panda> (@in_guaranteed τ_0_0) -> @owned @callee_owned (@in τ_0_0) -> @out τ_0_0
// Result of calling the getter is re-abstracted to the maximally substituted type
// by SILGenFunction::emitApply():
@@ -599,7 +599,7 @@
// The callback:
- // CHECK: function_ref @_T017materializeForSet11TuxedoPandaVAA0E0A2aDP1xxxcfmytfU_TW : $@convention(witness_method) (Builtin.RawPointer, @inout Builtin.UnsafeValueBuffer, @inout TuxedoPanda, @thick TuxedoPanda.Type) -> ()
+ // CHECK: function_ref @_T017materializeForSet11TuxedoPandaVAA0E0A2aDP1xxxcvmytfU_TW : $@convention(witness_method) (Builtin.RawPointer, @inout Builtin.UnsafeValueBuffer, @inout TuxedoPanda, @thick TuxedoPanda.Type) -> ()
// CHECK: }
@@ -611,15 +611,15 @@
}
// CHECK-LABEL: sil hidden @_T017materializeForSet31inoutAccessOfLazyStructPropertyyAA0ghI0Vz1l_tF
-// CHECK: function_ref @_T017materializeForSet18LazyStructPropertyV3catSifg
-// CHECK: function_ref @_T017materializeForSet18LazyStructPropertyV3catSifs
+// CHECK: function_ref @_T017materializeForSet18LazyStructPropertyV3catSivg
+// CHECK: function_ref @_T017materializeForSet18LazyStructPropertyV3catSivs
func inoutAccessOfLazyStructProperty(l: inout LazyStructProperty) {
increment(&l.cat)
}
// Test for materializeForSet vs lazy properties of classes.
-// CHECK-LABEL: sil hidden [transparent] @_T017materializeForSet17LazyClassPropertyC3catSifm
+// CHECK-LABEL: sil hidden [transparent] @_T017materializeForSet17LazyClassPropertyC3catSivm
class LazyClassProperty {
lazy var cat: Int = 5
@@ -638,8 +638,8 @@
}
// CHECK-LABEL: sil hidden @_T017materializeForSet35inoutAccessOfLazyFinalClassPropertyyAA0ghiJ0Cz1l_tF
-// CHECK: function_ref @_T017materializeForSet22LazyFinalClassPropertyC3catSifg
-// CHECK: function_ref @_T017materializeForSet22LazyFinalClassPropertyC3catSifs
+// CHECK: function_ref @_T017materializeForSet22LazyFinalClassPropertyC3catSivg
+// CHECK: function_ref @_T017materializeForSet22LazyFinalClassPropertyC3catSivs
func inoutAccessOfLazyFinalClassProperty(l: inout LazyFinalClassProperty) {
increment(&l.cat)
}
@@ -657,22 +657,22 @@
func testMaterializedSetter() {
// CHECK: function_ref @_T017materializeForSet10FooClosureVACycfC
var f = FooClosure()
- // CHECK: function_ref @_T017materializeForSet10FooClosureV8computedS3iccSgfg
- // CHECK: function_ref @_T017materializeForSet10FooClosureV8computedS3iccSgfs
+ // CHECK: function_ref @_T017materializeForSet10FooClosureV8computedS3iccSgvg
+ // CHECK: function_ref @_T017materializeForSet10FooClosureV8computedS3iccSgvs
f.computed = f.computed
}
// CHECK-LABEL: sil_vtable DerivedForOverride {
-// CHECK: #BaseForOverride.valueStored!getter.1: (BaseForOverride) -> () -> Int : _T017materializeForSet07DerivedB8OverrideC11valueStoredSifg
-// CHECK: #BaseForOverride.valueStored!setter.1: (BaseForOverride) -> (Int) -> () : _T017materializeForSet07DerivedB8OverrideC11valueStoredSifs
-// CHECK: #BaseForOverride.valueStored!materializeForSet.1: (BaseForOverride) -> (Builtin.RawPointer, inout Builtin.UnsafeValueBuffer) -> (Builtin.RawPointer, Builtin.RawPointer?) : _T017materializeForSet07DerivedB8OverrideC11valueStoredSifm
-// CHECK: #BaseForOverride.valueComputed!getter.1: (BaseForOverride) -> () -> Int : _T017materializeForSet07DerivedB8OverrideC13valueComputedSifg
-// CHECK: #BaseForOverride.valueComputed!setter.1: (BaseForOverride) -> (Int) -> () : _T017materializeForSet07DerivedB8OverrideC13valueComputedSifs
-// CHECK: #BaseForOverride.valueComputed!materializeForSet.1: (BaseForOverride) -> (Builtin.RawPointer, inout Builtin.UnsafeValueBuffer) -> (Builtin.RawPointer, Builtin.RawPointer?) : _T017materializeForSet07DerivedB8OverrideC13valueComputedSifm
+// CHECK: #BaseForOverride.valueStored!getter.1: (BaseForOverride) -> () -> Int : _T017materializeForSet07DerivedB8OverrideC11valueStoredSivg
+// CHECK: #BaseForOverride.valueStored!setter.1: (BaseForOverride) -> (Int) -> () : _T017materializeForSet07DerivedB8OverrideC11valueStoredSivs
+// CHECK: #BaseForOverride.valueStored!materializeForSet.1: (BaseForOverride) -> (Builtin.RawPointer, inout Builtin.UnsafeValueBuffer) -> (Builtin.RawPointer, Builtin.RawPointer?) : _T017materializeForSet07DerivedB8OverrideC11valueStoredSivm
+// CHECK: #BaseForOverride.valueComputed!getter.1: (BaseForOverride) -> () -> Int : _T017materializeForSet07DerivedB8OverrideC13valueComputedSivg
+// CHECK: #BaseForOverride.valueComputed!setter.1: (BaseForOverride) -> (Int) -> () : _T017materializeForSet07DerivedB8OverrideC13valueComputedSivs
+// CHECK: #BaseForOverride.valueComputed!materializeForSet.1: (BaseForOverride) -> (Builtin.RawPointer, inout Builtin.UnsafeValueBuffer) -> (Builtin.RawPointer, Builtin.RawPointer?) : _T017materializeForSet07DerivedB8OverrideC13valueComputedSivm
// CHECK: }
// CHECK-LABEL: sil_witness_table hidden Bill: Totalled module materializeForSet {
-// CHECK: method #Totalled.total!getter.1: {{.*}} : @_T017materializeForSet4BillVAA8TotalledA2aDP5totalSifgTW
-// CHECK: method #Totalled.total!setter.1: {{.*}} : @_T017materializeForSet4BillVAA8TotalledA2aDP5totalSifsTW
-// CHECK: method #Totalled.total!materializeForSet.1: {{.*}} : @_T017materializeForSet4BillVAA8TotalledA2aDP5totalSifmTW
+// CHECK: method #Totalled.total!getter.1: {{.*}} : @_T017materializeForSet4BillVAA8TotalledA2aDP5totalSivgTW
+// CHECK: method #Totalled.total!setter.1: {{.*}} : @_T017materializeForSet4BillVAA8TotalledA2aDP5totalSivsTW
+// CHECK: method #Totalled.total!materializeForSet.1: {{.*}} : @_T017materializeForSet4BillVAA8TotalledA2aDP5totalSivmTW
// CHECK: }
diff --git a/test/SILGen/multi_file.swift b/test/SILGen/multi_file.swift
index e9418ef..4d726b1 100644
--- a/test/SILGen/multi_file.swift
+++ b/test/SILGen/multi_file.swift
@@ -4,7 +4,7 @@
// CHECK-LABEL: sil hidden @_T010multi_file12rdar16016713{{[_0-9a-zA-Z]*}}F
func rdar16016713(_ r: Range) {
- // CHECK: [[LIMIT:%[0-9]+]] = function_ref @_T010multi_file5RangeV5limitSifg : $@convention(method) (Range) -> Int
+ // CHECK: [[LIMIT:%[0-9]+]] = function_ref @_T010multi_file5RangeV5limitSivg : $@convention(method) (Range) -> Int
// CHECK: {{%[0-9]+}} = apply [[LIMIT]]({{%[0-9]+}}) : $@convention(method) (Range) -> Int
markUsed(r.limit)
}
@@ -12,7 +12,7 @@
// CHECK-LABEL: sil hidden @_T010multi_file26lazyPropertiesAreNotStored{{[_0-9a-zA-Z]*}}F
func lazyPropertiesAreNotStored(_ container: LazyContainer) {
var container = container
- // CHECK: {{%[0-9]+}} = function_ref @_T010multi_file13LazyContainerV7lazyVarSifg : $@convention(method) (@inout LazyContainer) -> Int
+ // CHECK: {{%[0-9]+}} = function_ref @_T010multi_file13LazyContainerV7lazyVarSivg : $@convention(method) (@inout LazyContainer) -> Int
markUsed(container.lazyVar)
}
@@ -40,8 +40,8 @@
// CHECK-LABEL: sil hidden @_T010multi_file34finalVarsDontNeedMaterializeForSetyAA27ObservingPropertyFinalClassCF
func finalVarsDontNeedMaterializeForSet(_ obj: ObservingPropertyFinalClass) {
obj.foo += 1
- // CHECK: function_ref @_T010multi_file27ObservingPropertyFinalClassC3fooSifg
- // CHECK: function_ref @_T010multi_file27ObservingPropertyFinalClassC3fooSifs
+ // CHECK: function_ref @_T010multi_file27ObservingPropertyFinalClassC3fooSivg
+ // CHECK: function_ref @_T010multi_file27ObservingPropertyFinalClassC3fooSivs
}
// rdar://18503960
@@ -52,5 +52,5 @@
set {}
}
}
-// CHECK-LABEL: sil hidden [transparent] @_T010multi_file19HasComputedPropertyC3fooSifm : $@convention(method) (Builtin.RawPointer, @inout Builtin.UnsafeValueBuffer, @guaranteed HasComputedProperty) -> (Builtin.RawPointer, Optional<Builtin.RawPointer>) {
-// CHECK-LABEL: sil private [transparent] [thunk] @_T010multi_file19HasComputedPropertyCAA012ProtocolWithE0A2aDP3fooSifmTW : $@convention(witness_method) (Builtin.RawPointer, @inout Builtin.UnsafeValueBuffer, @inout HasComputedProperty) -> (Builtin.RawPointer, Optional<Builtin.RawPointer>) {
+// CHECK-LABEL: sil hidden [transparent] @_T010multi_file19HasComputedPropertyC3fooSivm : $@convention(method) (Builtin.RawPointer, @inout Builtin.UnsafeValueBuffer, @guaranteed HasComputedProperty) -> (Builtin.RawPointer, Optional<Builtin.RawPointer>) {
+// CHECK-LABEL: sil private [transparent] [thunk] @_T010multi_file19HasComputedPropertyCAA012ProtocolWithE0A2aDP3fooSivmTW : $@convention(witness_method) (Builtin.RawPointer, @inout Builtin.UnsafeValueBuffer, @inout HasComputedProperty) -> (Builtin.RawPointer, Optional<Builtin.RawPointer>) {
diff --git a/test/SILGen/newtype.swift b/test/SILGen/newtype.swift
index e728a52..65b978e 100644
--- a/test/SILGen/newtype.swift
+++ b/test/SILGen/newtype.swift
@@ -35,7 +35,7 @@
return ed.rawValue
}
-// CHECK-RAW-LABEL: sil shared [serializable] @_T0SC11ErrorDomainV8rawValueSSfg
+// CHECK-RAW-LABEL: sil shared [serializable] @_T0SC11ErrorDomainV8rawValueSSvg
// CHECK-RAW: bb0([[SELF:%[0-9]+]] : $ErrorDomain):
// CHECK-RAW: [[STORED_VALUE:%[0-9]+]] = struct_extract [[SELF]] : $ErrorDomain, #ErrorDomain._rawValue
// CHECK-RAW: [[STORED_VALUE_COPY:%.*]] = copy_value [[STORED_VALUE]]
diff --git a/test/SILGen/nsmanaged-witness.swift b/test/SILGen/nsmanaged-witness.swift
index 3237cc5..033d50c 100644
--- a/test/SILGen/nsmanaged-witness.swift
+++ b/test/SILGen/nsmanaged-witness.swift
@@ -61,5 +61,5 @@
// TODO: We can't emit a vtable entry for materializeForSet for ObjC types.
// CHECK-NOT: class_method {{.*}}Foo{{.*}}intProperty{{.*}}materializeForSet
-// CHECK-LABEL: sil shared [serializable] @_T0So3FooC11intPropertys5Int32Vfm
+// CHECK-LABEL: sil shared [serializable] @_T0So3FooC11intPropertys5Int32Vvm
diff --git a/test/SILGen/objc_bridging.swift b/test/SILGen/objc_bridging.swift
index e3082de..e0ac6ac 100644
--- a/test/SILGen/objc_bridging.swift
+++ b/test/SILGen/objc_bridging.swift
@@ -277,11 +277,11 @@
get { return NSS }
set {}
}
- // CHECK-LABEL: sil hidden [thunk] @_T0So8NSStringC13objc_bridgingE13nsstrFakePropABfgTo
+ // CHECK-LABEL: sil hidden [thunk] @_T0So8NSStringC13objc_bridgingE13nsstrFakePropABvgTo
// CHECK-NOT: swift_StringToNSString
// CHECK-NOT: _T0SS10FoundationE36_unconditionallyBridgeFromObjectiveCSSSo8NSStringCSgFZ
// CHECK: }
- // CHECK-LABEL: sil hidden [thunk] @_T0So8NSStringC13objc_bridgingE13nsstrFakePropABfsTo
+ // CHECK-LABEL: sil hidden [thunk] @_T0So8NSStringC13objc_bridgingE13nsstrFakePropABvsTo
// CHECK-NOT: swift_StringToNSString
// CHECK-NOT: _T0SS10FoundationE36_unconditionallyBridgeFromObjectiveCSSSo8NSStringCSgFZ
// CHECK: }
@@ -303,12 +303,12 @@
class Bas : NSObject {
// -- Bridging thunks for String properties convert between NSString
var strRealProp: String = "Hello"
- // CHECK-LABEL: sil hidden [thunk] @_T013objc_bridging3BasC11strRealPropSSfgTo : $@convention(objc_method) (Bas) -> @autoreleased NSString {
+ // CHECK-LABEL: sil hidden [thunk] @_T013objc_bridging3BasC11strRealPropSSvgTo : $@convention(objc_method) (Bas) -> @autoreleased NSString {
// CHECK: bb0([[THIS:%.*]] : @unowned $Bas):
// CHECK: [[THIS_COPY:%.*]] = copy_value [[THIS]] : $Bas
// CHECK: [[BORROWED_THIS_COPY:%.*]] = begin_borrow [[THIS_COPY]]
// CHECK: // function_ref objc_bridging.Bas.strRealProp.getter
- // CHECK: [[PROPIMPL:%.*]] = function_ref @_T013objc_bridging3BasC11strRealPropSSfg
+ // CHECK: [[PROPIMPL:%.*]] = function_ref @_T013objc_bridging3BasC11strRealPropSSvg
// CHECK: [[PROP_COPY:%.*]] = apply [[PROPIMPL]]([[BORROWED_THIS_COPY]]) : $@convention(method) (@guaranteed Bas) -> @owned String
// CHECK: end_borrow [[BORROWED_THIS_COPY]] from [[THIS_COPY]]
// CHECK: destroy_value [[THIS_COPY]]
@@ -321,13 +321,13 @@
// CHECK: }
- // CHECK-LABEL: sil hidden @_T013objc_bridging3BasC11strRealPropSSfg
+ // CHECK-LABEL: sil hidden @_T013objc_bridging3BasC11strRealPropSSvg
// CHECK: [[PROP_ADDR:%.*]] = ref_element_addr %0 : {{.*}}, #Bas.strRealProp
// CHECK: [[READ:%.*]] = begin_access [read] [dynamic] [[PROP_ADDR]] : $*String
// CHECK: [[PROP:%.*]] = load [copy] [[READ]]
- // CHECK-LABEL: sil hidden [thunk] @_T013objc_bridging3BasC11strRealPropSSfsTo : $@convention(objc_method) (NSString, Bas) -> () {
+ // CHECK-LABEL: sil hidden [thunk] @_T013objc_bridging3BasC11strRealPropSSvsTo : $@convention(objc_method) (NSString, Bas) -> () {
// CHECK: bb0([[VALUE:%.*]] : @unowned $NSString, [[THIS:%.*]] : @unowned $Bas):
// CHECK: [[VALUE_COPY:%.*]] = copy_value [[VALUE]]
// CHECK: [[THIS_COPY:%.*]] = copy_value [[THIS]]
@@ -336,13 +336,13 @@
// CHECK: [[STR:%.*]] = apply [[NSSTRING_TO_STRING]]([[VALUE_BOX]]
// CHECK: [[BORROWED_THIS_COPY:%.*]] = begin_borrow [[THIS_COPY]]
- // CHECK: [[SETIMPL:%.*]] = function_ref @_T013objc_bridging3BasC11strRealPropSSfs
+ // CHECK: [[SETIMPL:%.*]] = function_ref @_T013objc_bridging3BasC11strRealPropSSvs
// CHECK: apply [[SETIMPL]]([[STR]], [[BORROWED_THIS_COPY]])
// CHECK: end_borrow [[BORROWED_THIS_COPY]] from [[THIS_COPY]]
// CHECK: destroy_value [[THIS_COPY]]
- // CHECK: } // end sil function '_T013objc_bridging3BasC11strRealPropSSfsTo'
+ // CHECK: } // end sil function '_T013objc_bridging3BasC11strRealPropSSvsTo'
- // CHECK-LABEL: sil hidden @_T013objc_bridging3BasC11strRealPropSSfs
+ // CHECK-LABEL: sil hidden @_T013objc_bridging3BasC11strRealPropSSvs
// CHECK: bb0(%0 : @owned $String, %1 : @guaranteed $Bas):
// CHECK: [[STR_ADDR:%.*]] = ref_element_addr %1 : {{.*}}, #Bas.strRealProp
@@ -354,11 +354,11 @@
get { return "" }
set {}
}
- // CHECK-LABEL: sil hidden [thunk] @_T013objc_bridging3BasC11strFakePropSSfgTo : $@convention(objc_method) (Bas) -> @autoreleased NSString {
+ // CHECK-LABEL: sil hidden [thunk] @_T013objc_bridging3BasC11strFakePropSSvgTo : $@convention(objc_method) (Bas) -> @autoreleased NSString {
// CHECK: bb0([[THIS:%.*]] : @unowned $Bas):
// CHECK: [[THIS_COPY:%.*]] = copy_value [[THIS]]
// CHECK: [[BORROWED_THIS_COPY:%.*]] = begin_borrow [[THIS_COPY]]
- // CHECK: [[GETTER:%.*]] = function_ref @_T013objc_bridging3BasC11strFakePropSSfg
+ // CHECK: [[GETTER:%.*]] = function_ref @_T013objc_bridging3BasC11strFakePropSSvg
// CHECK: [[STR:%.*]] = apply [[GETTER]]([[BORROWED_THIS_COPY]])
// CHECK: end_borrow [[BORROWED_THIS_COPY]] from [[THIS_COPY]]
// CHECK: destroy_value [[THIS_COPY]]
@@ -370,7 +370,7 @@
// CHECK: return [[NSSTR]]
// CHECK: }
- // CHECK-LABEL: sil hidden [thunk] @_T013objc_bridging3BasC11strFakePropSSfsTo : $@convention(objc_method) (NSString, Bas) -> () {
+ // CHECK-LABEL: sil hidden [thunk] @_T013objc_bridging3BasC11strFakePropSSvsTo : $@convention(objc_method) (NSString, Bas) -> () {
// CHECK: bb0([[NSSTR:%.*]] : @unowned $NSString, [[THIS:%.*]] : @unowned $Bas):
// CHECK: [[NSSTR_COPY:%.*]] = copy_value [[NSSTR]]
// CHECK: [[THIS_COPY:%.*]] = copy_value [[THIS]]
@@ -378,11 +378,11 @@
// CHECK: [[NSSTR_BOX:%.*]] = enum $Optional<NSString>, #Optional.some!enumelt.1, [[NSSTR_COPY]]
// CHECK: [[STR:%.*]] = apply [[NSSTRING_TO_STRING]]([[NSSTR_BOX]]
// CHECK: [[BORROWED_THIS_COPY:%.*]] = begin_borrow [[THIS_COPY]]
- // CHECK: [[SETTER:%.*]] = function_ref @_T013objc_bridging3BasC11strFakePropSSfs
+ // CHECK: [[SETTER:%.*]] = function_ref @_T013objc_bridging3BasC11strFakePropSSvs
// CHECK: apply [[SETTER]]([[STR]], [[BORROWED_THIS_COPY]])
// CHECK: end_borrow [[BORROWED_THIS_COPY]] from [[THIS_COPY]]
// CHECK: destroy_value [[THIS_COPY]]
- // CHECK: } // end sil function '_T013objc_bridging3BasC11strFakePropSSfsTo'
+ // CHECK: } // end sil function '_T013objc_bridging3BasC11strFakePropSSvsTo'
// -- Bridging thunks for explicitly NSString properties don't convert
var nsstrRealProp: NSString
@@ -390,12 +390,12 @@
get { return NSS }
set {}
}
- // CHECK-LABEL: sil hidden [thunk] @_T013objc_bridging3BasC13nsstrRealPropSo8NSStringCfgTo : $@convention(objc_method) (Bas) -> @autoreleased NSString {
+ // CHECK-LABEL: sil hidden [thunk] @_T013objc_bridging3BasC13nsstrRealPropSo8NSStringCvgTo : $@convention(objc_method) (Bas) -> @autoreleased NSString {
// CHECK-NOT: swift_StringToNSString
// CHECK-NOT: _T0SS10FoundationE36_unconditionallyBridgeFromObjectiveCSSSo8NSStringCSgFZ
// CHECK: }
- // CHECK-LABEL: sil hidden [thunk] @_T013objc_bridging3BasC13nsstrRealPropSo8NSStringCfsTo : $@convention(objc_method) (NSString, Bas) ->
+ // CHECK-LABEL: sil hidden [thunk] @_T013objc_bridging3BasC13nsstrRealPropSo8NSStringCvsTo : $@convention(objc_method) (NSString, Bas) ->
// CHECK-NOT: swift_StringToNSString
// CHECK-NOT: _T0SS10FoundationE36_unconditionallyBridgeFromObjectiveCSSSo8NSStringCSgFZ
// CHECK: }
@@ -481,8 +481,8 @@
// CHECK: return [[NSARRAY]]
func arrayResult() -> [AnyObject] { return [] }
- // CHECK-LABEL: sil hidden [thunk] @_T013objc_bridging3BasC9arrayPropSaySSGfgTo : $@convention(objc_method) (Bas) -> @autoreleased NSArray
- // CHECK-LABEL: sil hidden [thunk] @_T013objc_bridging3BasC9arrayPropSaySSGfsTo : $@convention(objc_method) (NSArray, Bas) -> ()
+ // CHECK-LABEL: sil hidden [thunk] @_T013objc_bridging3BasC9arrayPropSaySSGvgTo : $@convention(objc_method) (Bas) -> @autoreleased NSArray
+ // CHECK-LABEL: sil hidden [thunk] @_T013objc_bridging3BasC9arrayPropSaySSGvsTo : $@convention(objc_method) (NSArray, Bas) -> ()
var arrayProp: [String] = []
}
diff --git a/test/SILGen/objc_bridging_any.swift b/test/SILGen/objc_bridging_any.swift
index bb1487e..b2fa0d2 100644
--- a/test/SILGen/objc_bridging_any.swift
+++ b/test/SILGen/objc_bridging_any.swift
@@ -736,5 +736,5 @@
// CHECK-LABEL: sil_witness_table shared [serialized] GenericOption: Hashable module objc_generics {
// CHECK-NEXT: base_protocol Equatable: GenericOption: Equatable module objc_generics
-// CHECK-NEXT: method #Hashable.hashValue!getter.1: {{.*}} : @_T0SC13GenericOptionVs8Hashable13objc_genericssACP9hashValueSifgTW
+// CHECK-NEXT: method #Hashable.hashValue!getter.1: {{.*}} : @_T0SC13GenericOptionVs8Hashable13objc_genericssACP9hashValueSivgTW
// CHECK-NEXT: }
diff --git a/test/SILGen/objc_dealloc.swift b/test/SILGen/objc_dealloc.swift
index fee18da..96ae3c9 100644
--- a/test/SILGen/objc_dealloc.swift
+++ b/test/SILGen/objc_dealloc.swift
@@ -11,7 +11,7 @@
class SwiftGizmo : Gizmo {
var x = X()
- // CHECK-LABEL: sil hidden [transparent] @_T012objc_dealloc10SwiftGizmoC1xAA1XCvfi : $@convention(thin) () -> @owned X
+ // CHECK-LABEL: sil hidden [transparent] @_T012objc_dealloc10SwiftGizmoC1xAA1XCvpfi : $@convention(thin) () -> @owned X
// CHECK: [[FN:%.*]] = function_ref @_T012objc_dealloc1XCACycfC : $@convention(method) (@thick X.Type) -> @owned X
// CHECK-NEXT: [[METATYPE:%.*]] = metatype $@thick X.Type
// CHECK-NEXT: [[RESULT:%.*]] = apply [[FN]]([[METATYPE]]) : $@convention(method) (@thick X.Type) -> @owned X
@@ -68,7 +68,7 @@
// CHECK: bb0([[SELF_PARAM:%[0-9]+]] : @owned $SwiftGizmo):
// CHECK-NEXT: debug_value [[SELF_PARAM]] : $SwiftGizmo, let, name "self"
// CHECK-NEXT: [[SELF:%[0-9]+]] = mark_uninitialized [rootself] [[SELF_PARAM]] : $SwiftGizmo
- // CHECK: [[XINIT:%[0-9]+]] = function_ref @_T012objc_dealloc10SwiftGizmoC1xAA1XCvfi
+ // CHECK: [[XINIT:%[0-9]+]] = function_ref @_T012objc_dealloc10SwiftGizmoC1xAA1XCvpfi
// CHECK-NEXT: [[XOBJ:%[0-9]+]] = apply [[XINIT]]() : $@convention(thin) () -> @owned X
// CHECK-NEXT: [[BORROWED_SELF:%.*]] = begin_borrow [[SELF]]
// CHECK-NEXT: [[X:%[0-9]+]] = ref_element_addr [[BORROWED_SELF]] : $SwiftGizmo, #SwiftGizmo.x
diff --git a/test/SILGen/objc_deprecated_objc_thunks.swift b/test/SILGen/objc_deprecated_objc_thunks.swift
index d00564c..6ba5b47 100644
--- a/test/SILGen/objc_deprecated_objc_thunks.swift
+++ b/test/SILGen/objc_deprecated_objc_thunks.swift
@@ -27,7 +27,7 @@
// CHECK-SWIFT4-NEXT: builtin "swift3ImplicitObjCEntrypoint"([[FILENAME]] : $Builtin.RawPointer, [[LENGTH]] : $Builtin.Word, [[LINE]] : $Builtin.Word, [[COLUMN]] : $Builtin.Word) : $()
func foo() { }
- // CHECK-SWIFT4-LABEL: sil hidden [thunk] @_T0016objc_deprecated_A7_thunks12ObjCSubclassC3barSo8NSObjectCSgfgTo : $@convention(objc_method) (ObjCSubclass) -> @autoreleased Optional<NSObject>
+ // CHECK-SWIFT4-LABEL: sil hidden [thunk] @_T0016objc_deprecated_A7_thunks12ObjCSubclassC3barSo8NSObjectCSgvgTo : $@convention(objc_method) (ObjCSubclass) -> @autoreleased Optional<NSObject>
// CHECK-SWIFT4: bb0(%0 : @unowned $ObjCSubclass):
// CHECK-SWIFT4-NEXT: [[FILENAME:%.*]] = [[FILENAME_LITERAL]]
// CHECK-SWIFT4-NEXT: [[LENGTH:%.*]] = integer_literal
@@ -36,7 +36,7 @@
// CHECK-SWIFT4-NEXT: [[COLUMN:%.*]] = integer_literal $Builtin.Word, 3
// CHECK-SWIFT4-NEXT: builtin "swift3ImplicitObjCEntrypoint"([[FILENAME]] : $Builtin.RawPointer, [[LENGTH]] : $Builtin.Word, [[LINE]] : $Builtin.Word, [[COLUMN]] : $Builtin.Word) : $()
- // CHECK-SWIFT4-LABEL: sil hidden [thunk] @_T0016objc_deprecated_A7_thunks12ObjCSubclassC3barSo8NSObjectCSgfsTo : $@convention(objc_method) (Optional<NSObject>, ObjCSubclass) -> () {
+ // CHECK-SWIFT4-LABEL: sil hidden [thunk] @_T0016objc_deprecated_A7_thunks12ObjCSubclassC3barSo8NSObjectCSgvsTo : $@convention(objc_method) (Optional<NSObject>, ObjCSubclass) -> () {
// CHECK-SWIFT4: %0 : @unowned $Optional<NSObject>, %1 : @unowned $ObjCSubclass
// CHECK-SWIFT4-NEXT: [[FILENAME:%.*]] = [[FILENAME_LITERAL]]
// CHECK-SWIFT4-NEXT: [[LENGTH:%.*]] = integer_literal
@@ -46,7 +46,7 @@
// CHECK-SWIFT4-NEXT: builtin "swift3ImplicitObjCEntrypoint"([[FILENAME]] : $Builtin.RawPointer, [[LENGTH]] : $Builtin.Word, [[LINE]] : $Builtin.Word, [[COLUMN]] : $Builtin.Word) : $()
var bar: NSObject? = nil
- // CHECK-SWIFT4-LABEL: sil hidden [thunk] @_T0016objc_deprecated_A7_thunks12ObjCSubclassC9subscriptyXlSicfgTo : $@convention(objc_method) (Int, ObjCSubclass) -> @autoreleased AnyObject
+ // CHECK-SWIFT4-LABEL: sil hidden [thunk] @_T0016objc_deprecated_A7_thunks12ObjCSubclassCyXlSicigTo : $@convention(objc_method) (Int, ObjCSubclass) -> @autoreleased AnyObject
// CHECK-SWIFT4: bb0(%0 : @trivial $Int, %1 : @unowned $ObjCSubclass):
// CHECK-SWIFT4-NEXT: [[FILENAME:%.*]] = [[FILENAME_LITERAL]]
// CHECK-SWIFT4-NEXT: [[LENGTH:%.*]] = integer_literal
@@ -55,7 +55,7 @@
// CHECK-SWIFT4-NEXT: [[COLUMN:%.*]] = integer_literal $Builtin.Word, 3
// CHECK-SWIFT4-NEXT: builtin "swift3ImplicitObjCEntrypoint"([[FILENAME]] : $Builtin.RawPointer, [[LENGTH]] : $Builtin.Word, [[LINE]] : $Builtin.Word, [[COLUMN]] : $Builtin.Word) : $()
- // CHECK-SWIFT4-LABEL: sil hidden [thunk] @_T0016objc_deprecated_A7_thunks12ObjCSubclassC9subscriptyXlSicfsTo : $@convention(objc_method) (AnyObject, Int, ObjCSubclass) ->
+ // CHECK-SWIFT4-LABEL: sil hidden [thunk] @_T0016objc_deprecated_A7_thunks12ObjCSubclassCyXlSicisTo : $@convention(objc_method) (AnyObject, Int, ObjCSubclass) ->
// CHECK-SWIFT4: bb0(%0 : @unowned $AnyObject, %1 : @trivial $Int, %2 : @unowned $ObjCSubclass):
// CHECK-SWIFT4-NEXT: [[FILENAME:%.*]] = [[FILENAME_LITERAL]]
// CHECK-SWIFT4-NEXT: [[LENGTH:%.*]] = integer_literal
diff --git a/test/SILGen/objc_dictionary_bridging.swift b/test/SILGen/objc_dictionary_bridging.swift
index 7d4af55..90bdcb9 100644
--- a/test/SILGen/objc_dictionary_bridging.swift
+++ b/test/SILGen/objc_dictionary_bridging.swift
@@ -51,11 +51,11 @@
var property: Dictionary<Foo, Foo> = [:]
// Property getter
- // CHECK-LABEL: sil hidden [thunk] @_T024objc_dictionary_bridging3FooC8propertys10DictionaryVyA2CGfgTo : $@convention(objc_method) (Foo) -> @autoreleased NSDictionary
+ // CHECK-LABEL: sil hidden [thunk] @_T024objc_dictionary_bridging3FooC8propertys10DictionaryVyA2CGvgTo : $@convention(objc_method) (Foo) -> @autoreleased NSDictionary
// CHECK: bb0([[SELF:%[0-9]+]] : @unowned $Foo):
// CHECK: [[SELF_COPY:%.*]] = copy_value [[SELF]]
// CHECK: [[BORROWED_SELF_COPY:%.*]] = begin_borrow [[SELF_COPY]]
- // CHECK: [[GETTER:%[0-9]+]] = function_ref @_T024objc_dictionary_bridging3FooC8propertys10DictionaryVyA2CGfg : $@convention(method) (@guaranteed Foo) -> @owned Dictionary<Foo, Foo>
+ // CHECK: [[GETTER:%[0-9]+]] = function_ref @_T024objc_dictionary_bridging3FooC8propertys10DictionaryVyA2CGvg : $@convention(method) (@guaranteed Foo) -> @owned Dictionary<Foo, Foo>
// CHECK: [[DICT:%[0-9]+]] = apply [[GETTER]]([[BORROWED_SELF_COPY]]) : $@convention(method) (@guaranteed Foo) -> @owned Dictionary<Foo, Foo>
// CHECK: end_borrow [[BORROWED_SELF_COPY]] from [[SELF_COPY]]
// CHECK: destroy_value [[SELF_COPY]]
@@ -65,10 +65,10 @@
// CHECK: end_borrow [[BORROWED_DICT]] from [[DICT]]
// CHECK: destroy_value [[DICT]]
// CHECK: return [[NSDICT]] : $NSDictionary
- // CHECK: } // end sil function '_T024objc_dictionary_bridging3FooC8propertys10DictionaryVyA2CGfgTo'
+ // CHECK: } // end sil function '_T024objc_dictionary_bridging3FooC8propertys10DictionaryVyA2CGvgTo'
// Property setter
- // CHECK-LABEL: sil hidden [thunk] @_T024objc_dictionary_bridging3FooC8propertys10DictionaryVyA2CGfsTo : $@convention(objc_method) (NSDictionary, Foo) -> ()
+ // CHECK-LABEL: sil hidden [thunk] @_T024objc_dictionary_bridging3FooC8propertys10DictionaryVyA2CGvsTo : $@convention(objc_method) (NSDictionary, Foo) -> ()
// CHECK: bb0([[NSDICT:%[0-9]+]] : @unowned $NSDictionary, [[SELF:%[0-9]+]] : @unowned $Foo):
// CHECK: [[NSDICT_COPY:%.*]] = copy_value [[NSDICT]]
// CHECK: [[SELF_COPY:%.*]] = copy_value [[SELF]]
@@ -78,15 +78,15 @@
// CHECK: [[DICT:%[0-9]+]] = apply [[CONVERTER]]<Foo, Foo>([[OPT_NSDICT]], [[DICT_META]])
// CHECK: [[BORROWED_SELF_COPY:%.*]] = begin_borrow [[SELF_COPY]]
- // CHECK: [[SETTER:%[0-9]+]] = function_ref @_T024objc_dictionary_bridging3FooC8propertys10DictionaryVyA2CGfs : $@convention(method) (@owned Dictionary<Foo, Foo>, @guaranteed Foo) -> ()
+ // CHECK: [[SETTER:%[0-9]+]] = function_ref @_T024objc_dictionary_bridging3FooC8propertys10DictionaryVyA2CGvs : $@convention(method) (@owned Dictionary<Foo, Foo>, @guaranteed Foo) -> ()
// CHECK: [[RESULT:%[0-9]+]] = apply [[SETTER]]([[DICT]], [[BORROWED_SELF_COPY]]) : $@convention(method) (@owned Dictionary<Foo, Foo>, @guaranteed Foo) -> ()
// CHECK: end_borrow [[BORROWED_SELF_COPY]] from [[SELF_COPY]]
// CHECK: destroy_value [[SELF_COPY]]
// CHECK: return [[RESULT]] : $()
- // CHECK-LABEL: sil hidden [thunk] @_T024objc_dictionary_bridging3FooC19nonVerbatimProperty{{[_0-9a-zA-Z]*}}fgTo : $@convention(objc_method) (Foo) -> @autoreleased NSDictionary
+ // CHECK-LABEL: sil hidden [thunk] @_T024objc_dictionary_bridging3FooC19nonVerbatimProperty{{[_0-9a-zA-Z]*}}vgTo : $@convention(objc_method) (Foo) -> @autoreleased NSDictionary
- // CHECK-LABEL: sil hidden [thunk] @_T024objc_dictionary_bridging3FooC19nonVerbatimProperty{{[_0-9a-zA-Z]*}}fsTo : $@convention(objc_method) (NSDictionary, Foo) -> ()
+ // CHECK-LABEL: sil hidden [thunk] @_T024objc_dictionary_bridging3FooC19nonVerbatimProperty{{[_0-9a-zA-Z]*}}vsTo : $@convention(objc_method) (NSDictionary, Foo) -> ()
@objc var nonVerbatimProperty: Dictionary<String, Int> = [:]
}
diff --git a/test/SILGen/objc_enum.swift b/test/SILGen/objc_enum.swift
index 7eaa083..d6e4076 100644
--- a/test/SILGen/objc_enum.swift
+++ b/test/SILGen/objc_enum.swift
@@ -8,8 +8,8 @@
// CHECK-DAG: sil shared [serializable] @_T0SC16NSRuncingOptionsO{{[_0-9a-zA-Z]*}}fC
-// CHECK-DAG: sil shared [serializable] @_T0SC16NSRuncingOptionsO8rawValueSifg
-// CHECK-DAG: sil shared [serializable] @_T0SC16NSRuncingOptionsO9hashValueSifg
+// CHECK-DAG: sil shared [serializable] @_T0SC16NSRuncingOptionsO8rawValueSivg
+// CHECK-DAG: sil shared [serializable] @_T0SC16NSRuncingOptionsO9hashValueSivg
// Non-payload enum ctors don't need to be instantiated at all.
// NEGATIVE-NOT: sil shared [transparent] @_T0SC16NSRuncingOptionsO5MinceAbBmF
diff --git a/test/SILGen/objc_extensions.swift b/test/SILGen/objc_extensions.swift
index 7c8aa13..a10d3aa 100644
--- a/test/SILGen/objc_extensions.swift
+++ b/test/SILGen/objc_extensions.swift
@@ -15,18 +15,18 @@
// Make sure that we are generating the @objc thunk and are calling the actual method.
//
- // CHECK-LABEL: sil hidden [thunk] @_T015objc_extensions3SubC4propSQySSGfgTo : $@convention(objc_method) (Sub) -> @autoreleased Optional<NSString> {
+ // CHECK-LABEL: sil hidden [thunk] @_T015objc_extensions3SubC4propSQySSGvgTo : $@convention(objc_method) (Sub) -> @autoreleased Optional<NSString> {
// CHECK: bb0([[SELF:%.*]] : $Sub):
// CHECK: [[SELF_COPY:%.*]] = copy_value [[SELF]]
// CHECK: [[BORROWED_SELF_COPY:%.*]] = begin_borrow [[SELF_COPY]]
- // CHECK: [[GETTER_FUNC:%.*]] = function_ref @_T015objc_extensions3SubC4propSQySSGfg : $@convention(method) (@guaranteed Sub) -> @owned Optional<String>
+ // CHECK: [[GETTER_FUNC:%.*]] = function_ref @_T015objc_extensions3SubC4propSQySSGvg : $@convention(method) (@guaranteed Sub) -> @owned Optional<String>
// CHECK: apply [[GETTER_FUNC]]([[BORROWED_SELF_COPY]])
// CHECK: end_borrow [[BORROWED_SELF_COPY]] from [[SELF_COPY]]
// CHECK: destroy_value [[SELF_COPY]]
- // CHECK: } // end sil function '_T015objc_extensions3SubC4propSQySSGfgTo'
+ // CHECK: } // end sil function '_T015objc_extensions3SubC4propSQySSGvgTo'
// Then check the body of the getter calls the super_method.
- // CHECK-LABEL: sil hidden @_T015objc_extensions3SubC4propSQySSGfg : $@convention(method) (@guaranteed Sub) -> @owned Optional<String> {
+ // CHECK-LABEL: sil hidden @_T015objc_extensions3SubC4propSQySSGvg : $@convention(method) (@guaranteed Sub) -> @owned Optional<String> {
// CHECK: bb0([[SELF:%.*]] : $Sub):
// CHECK: [[SELF_COPY:%.*]] = copy_value [[SELF]]
// CHECK: [[SELF_COPY_CAST:%.*]] = upcast [[SELF_COPY]] : $Sub to $Base
@@ -36,12 +36,12 @@
// CHECK: end_borrow [[BORROWED_SELF_COPY_CAST]]
// CHECK: [[RESULT:%.*]] = apply [[SUPER_METHOD]]([[SELF_COPY_CAST]])
// CHECK: bb3(
- // CHECK: destroy_value [[SELF_COPY]]
- // CHECK: } // end sil function '_T015objc_extensions3SubC4propSQySSGfg'
+ // CHECK: destroy_value [[SELF_COPY_CAST]]
+ // CHECK: } // end sil function '_T015objc_extensions3SubC4propSQySSGvg'
// Then check the setter @objc thunk.
//
- // CHECK-LABEL: sil hidden [thunk] @_T015objc_extensions3SubC4propSQySSGfsTo : $@convention(objc_method) (Optional<NSString>, Sub) -> () {
+ // CHECK-LABEL: sil hidden [thunk] @_T015objc_extensions3SubC4propSQySSGvsTo : $@convention(objc_method) (Optional<NSString>, Sub) -> () {
// CHECK: bb0([[NEW_VALUE:%.*]] : $Optional<NSString>, [[SELF:%.*]] : $Sub):
// CHECK: [[NEW_VALUE_COPY:%.*]] = copy_value [[NEW_VALUE]]
// CHECK: [[SELF_COPY:%.*]] = copy_value [[SELF]] : $Sub
@@ -50,15 +50,15 @@
// CHECK: [[FAIL_BB]]:
// CHECK: bb3([[BRIDGED_NEW_VALUE:%.*]] : $Optional<String>):
// CHECK: [[BORROWED_SELF_COPY:%.*]] = begin_borrow [[SELF_COPY]]
- // CHECK: [[NORMAL_FUNC:%.*]] = function_ref @_T015objc_extensions3SubC4propSQySSGfs : $@convention(method) (@owned Optional<String>, @guaranteed Sub) -> ()
+ // CHECK: [[NORMAL_FUNC:%.*]] = function_ref @_T015objc_extensions3SubC4propSQySSGvs : $@convention(method) (@owned Optional<String>, @guaranteed Sub) -> ()
// CHECK: apply [[NORMAL_FUNC]]([[BRIDGED_NEW_VALUE]], [[BORROWED_SELF_COPY]])
// CHECK: end_borrow [[BORROWED_SELF_COPY]] from [[SELF_COPY]]
// CHECK: destroy_value [[SELF_COPY]]
- // CHECK: } // end sil function '_T015objc_extensions3SubC4propSQySSGfsTo'
+ // CHECK: } // end sil function '_T015objc_extensions3SubC4propSQySSGvsTo'
// Then check the body of the actually setter value and make sure that we
// call the didSet function.
- // CHECK-LABEL: sil hidden @_T015objc_extensions3SubC4propSQySSGfs : $@convention(method) (@owned Optional<String>, @guaranteed Sub) -> () {
+ // CHECK-LABEL: sil hidden @_T015objc_extensions3SubC4propSQySSGvs : $@convention(method) (@owned Optional<String>, @guaranteed Sub) -> () {
// First we get the old value.
// CHECK: bb0([[NEW_VALUE:%.*]] : $Optional<String>, [[SELF:%.*]] : $Sub):
@@ -72,7 +72,7 @@
// CHECK: bb3([[OLD_NSSTRING_BRIDGED:%.*]] : $Optional<String>):
// This next line is completely not needed. But we are emitting it now.
- // CHECK: destroy_value [[SELF_COPY]]
+ // CHECK: destroy_value [[UPCAST_SELF_COPY]]
// CHECK: [[SELF_COPY:%.*]] = copy_value [[SELF]]
// CHECK: [[UPCAST_SELF_COPY:%.*]] = upcast [[SELF_COPY]] : $Sub to $Base
// CHECK: [[BORROWED_UPCAST_SELF:%.*]] = begin_borrow [[UPCAST_SELF_COPY]] : $Base
@@ -88,8 +88,8 @@
// CHECK: end_borrow [[BORROWED_NEW_VALUE]]
// CHECK: apply [[SET_SUPER_METHOD]]([[BRIDGED_NEW_STRING]], [[UPCAST_SELF_COPY]])
// CHECK: destroy_value [[BRIDGED_NEW_STRING]]
- // CHECK: destroy_value [[SELF_COPY]]
- // CHECK: [[DIDSET_NOTIFIER:%.*]] = function_ref @_T015objc_extensions3SubC4propSQySSGfW : $@convention(method) (@owned Optional<String>, @guaranteed Sub) -> ()
+ // CHECK: destroy_value [[UPCAST_SELF_COPY]]
+ // CHECK: [[DIDSET_NOTIFIER:%.*]] = function_ref @_T015objc_extensions3SubC4propSQySSGvW : $@convention(method) (@owned Optional<String>, @guaranteed Sub) -> ()
// CHECK: [[BORROWED_OLD_NSSTRING_BRIDGED:%.*]] = begin_borrow [[OLD_NSSTRING_BRIDGED]]
// CHECK: [[COPIED_OLD_NSSTRING_BRIDGED:%.*]] = copy_value [[BORROWED_OLD_NSSTRING_BRIDGED]]
// CHECK: end_borrow [[BORROWED_OLD_NSSTRING_BRIDGED]] from [[OLD_NSSTRING_BRIDGED]]
@@ -97,7 +97,7 @@
// CHECK: apply [[DIDSET_NOTIFIER]]([[COPIED_OLD_NSSTRING_BRIDGED]], [[SELF]])
// CHECK: destroy_value [[OLD_NSSTRING_BRIDGED]]
// CHECK: destroy_value [[NEW_VALUE]]
- // CHECK: } // end sil function '_T015objc_extensions3SubC4propSQySSGfs'
+ // CHECK: } // end sil function '_T015objc_extensions3SubC4propSQySSGvs'
}
@@ -152,7 +152,7 @@
}
extension SubSub {
- // CHECK-LABEL: sil hidden @_T015objc_extensions03SubC0C9otherPropSSfs
+ // CHECK-LABEL: sil hidden @_T015objc_extensions03SubC0C9otherPropSSvs
// CHECK: bb0([[NEW_VALUE:%.*]] : $String, [[SELF:%.*]] : $SubSub):
// CHECK: [[SELF_COPY_1:%.*]] = copy_value [[SELF]]
// CHECK: [[UPCAST_SELF_COPY_1:%.*]] = upcast [[SELF_COPY_1]] : $SubSub to $Sub
@@ -167,7 +167,7 @@
// CHECK: [[DOWNCAST_BORROWED_UPCAST_SELF_COPY_2:%.*]] = unchecked_ref_cast [[BORROWED_UPCAST_SELF_COPY_2]] : $Sub to $SubSub
// CHECK: = super_method [volatile] [[DOWNCAST_BORROWED_UPCAST_SELF_COPY_2]] : $SubSub, #Sub.otherProp!setter.1.foreign
// CHECK: end_borrow [[BORROWED_UPCAST_SELF_COPY_2]] from [[UPCAST_SELF_COPY_2]]
- // CHECK: } // end sil function '_T015objc_extensions03SubC0C9otherPropSSfs'
+ // CHECK: } // end sil function '_T015objc_extensions03SubC0C9otherPropSSvs'
override var otherProp: String {
didSet {
// Ignore it.
@@ -182,7 +182,7 @@
// CHECK-LABEL: sil hidden @_T015objc_extensions19testStaticVarAccessyyF
func testStaticVarAccess() {
- // CHECK: [[F:%.*]] = function_ref @_T0So4BaseC15objc_extensionsE1x33_1F05E59585E0BB585FCA206FBFF1A92DLLSifau
+ // CHECK: [[F:%.*]] = function_ref @_T0So4BaseC15objc_extensionsE1x33_1F05E59585E0BB585FCA206FBFF1A92DLLSivau
// CHECK: [[PTR:%.*]] = apply [[F]]()
// CHECK: [[ADDR:%.*]] = pointer_to_address [[PTR]]
_ = Base.x
diff --git a/test/SILGen/objc_final.swift b/test/SILGen/objc_final.swift
index 008fc28..c283c55 100644
--- a/test/SILGen/objc_final.swift
+++ b/test/SILGen/objc_final.swift
@@ -9,8 +9,8 @@
// CHECK-LABEL: sil hidden [thunk] @_T010objc_final3FooC3foo{{[_0-9a-zA-Z]*}}FTo
@objc var prop: Int = 0
- // CHECK-LABEL: sil hidden [transparent] [thunk] @_T010objc_final3FooC4propSifgTo
- // CHECK-LABEL: sil hidden [transparent] [thunk] @_T010objc_final3FooC4propSifsTo
+ // CHECK-LABEL: sil hidden [transparent] [thunk] @_T010objc_final3FooC4propSivgTo
+ // CHECK-LABEL: sil hidden [transparent] [thunk] @_T010objc_final3FooC4propSivsTo
}
// CHECK-LABEL: sil hidden @_T010objc_final7callFooyAA0D0CF
diff --git a/test/SILGen/objc_imported_generic.swift b/test/SILGen/objc_imported_generic.swift
index 5b72114..76b3731 100644
--- a/test/SILGen/objc_imported_generic.swift
+++ b/test/SILGen/objc_imported_generic.swift
@@ -141,5 +141,5 @@
// Make sure we emitted the witness table for the above conformance
// CHECK-LABEL: sil_witness_table shared [serialized] GenericOption: Hashable module objc_generics {
-// CHECK: method #Hashable.hashValue!getter.1: {{.*}}: @_T0SC13GenericOptionVs8Hashable13objc_genericssACP9hashValueSifgTW
+// CHECK: method #Hashable.hashValue!getter.1: {{.*}}: @_T0SC13GenericOptionVs8Hashable13objc_genericssACP9hashValueSivgTW
// CHECK: }
diff --git a/test/SILGen/objc_local.swift b/test/SILGen/objc_local.swift
index 4dc3cc9..e5c8965 100644
--- a/test/SILGen/objc_local.swift
+++ b/test/SILGen/objc_local.swift
@@ -5,7 +5,7 @@
import Foundation
func foo() {
- // CHECK-LABEL: sil private [thunk] @_T010objc_local3fooyyF3FooL_C1xSifgTo
- // CHECK-LABEL: sil private [thunk] @_T010objc_local3fooyyF3FooL_C1xSifsTo
+ // CHECK-LABEL: sil private [thunk] @_T010objc_local3fooyyF3FooL_C1xSivgTo
+ // CHECK-LABEL: sil private [thunk] @_T010objc_local3fooyyF3FooL_C1xSivsTo
class Foo : NSObject { @objc var x: Int = 0 }
}
diff --git a/test/SILGen/objc_properties.swift b/test/SILGen/objc_properties.swift
index 4131834..cf5bd22 100644
--- a/test/SILGen/objc_properties.swift
+++ b/test/SILGen/objc_properties.swift
@@ -87,12 +87,12 @@
// 'super' property references.
class B : A {
@objc override var computedProp: Int {
- // CHECK-LABEL: sil hidden @_T015objc_properties1BC12computedPropSifg : $@convention(method) (@guaranteed B) -> Int
+ // CHECK-LABEL: sil hidden @_T015objc_properties1BC12computedPropSivg : $@convention(method) (@guaranteed B) -> Int
get {
// CHECK: super_method [volatile] [[SELF:%[0-9]+]] : $B, #A.computedProp!getter.1.foreign : (A) -> () -> Int, $@convention(objc_method) (A) -> Int
return super.computedProp
}
- // CHECK-LABEL: sil hidden @_T015objc_properties1BC12computedPropSifs : $@convention(method) (Int, @guaranteed B) -> ()
+ // CHECK-LABEL: sil hidden @_T015objc_properties1BC12computedPropSivs : $@convention(method) (Int, @guaranteed B) -> ()
set(value) {
// CHECK: super_method [volatile] [[SELF:%[0-9]+]] : $B, #A.computedProp!setter.1.foreign : (A) -> (Int) -> (), $@convention(objc_method) (Int, A) -> ()
super.computedProp = value
@@ -103,7 +103,7 @@
// Test the @NSCopying attribute.
class TestNSCopying {
- // CHECK-LABEL: sil hidden [transparent] @_T015objc_properties13TestNSCopyingC8propertySo8NSStringCfs : $@convention(method) (@owned NSString, @guaranteed TestNSCopying) -> ()
+ // CHECK-LABEL: sil hidden [transparent] @_T015objc_properties13TestNSCopyingC8propertySo8NSStringCvs : $@convention(method) (@owned NSString, @guaranteed TestNSCopying) -> ()
// CHECK: bb0([[ARG0:%.*]] : $NSString, [[ARG1:%.*]] : $TestNSCopying):
// CHECK: [[BORROWED_ARG0:%.*]] = begin_borrow [[ARG0]]
// CHECK: class_method [volatile] [[BORROWED_ARG0]] : $NSString, #NSString.copy!1.foreign
@@ -135,52 +135,52 @@
}
class Singleton : NSObject {
- // CHECK-DAG: sil hidden @_T015objc_properties9SingletonC14sharedInstanceACfgZ : $@convention(method) (@thick Singleton.Type) -> @owned Singleton
- // CHECK-DAG: sil hidden [thunk] @_T015objc_properties9SingletonC14sharedInstanceACfgZTo : $@convention(objc_method) (@objc_metatype Singleton.Type) -> @autoreleased Singleton {
+ // CHECK-DAG: sil hidden @_T015objc_properties9SingletonC14sharedInstanceACvgZ : $@convention(method) (@thick Singleton.Type) -> @owned Singleton
+ // CHECK-DAG: sil hidden [thunk] @_T015objc_properties9SingletonC14sharedInstanceACvgZTo : $@convention(objc_method) (@objc_metatype Singleton.Type) -> @autoreleased Singleton {
static let sharedInstance = Singleton()
- // CHECK-DAG: sil hidden @_T015objc_properties9SingletonC1iSifgZ : $@convention(method) (@thick Singleton.Type) -> Int
- // CHECK-DAG: sil hidden [thunk] @_T015objc_properties9SingletonC1iSifgZTo : $@convention(objc_method) (@objc_metatype Singleton.Type) -> Int
+ // CHECK-DAG: sil hidden @_T015objc_properties9SingletonC1iSivgZ : $@convention(method) (@thick Singleton.Type) -> Int
+ // CHECK-DAG: sil hidden [thunk] @_T015objc_properties9SingletonC1iSivgZTo : $@convention(objc_method) (@objc_metatype Singleton.Type) -> Int
static let i = 2
- // CHECK-DAG: sil hidden @_T015objc_properties9SingletonC1jSSfgZ : $@convention(method) (@thick Singleton.Type) -> @owned String
- // CHECK-DAG: sil hidden [thunk] @_T015objc_properties9SingletonC1jSSfgZTo : $@convention(objc_method) (@objc_metatype Singleton.Type) -> @autoreleased NSString
- // CHECK-DAG: sil hidden @_T015objc_properties9SingletonC1jSSfsZ : $@convention(method) (@owned String, @thick Singleton.Type) -> ()
- // CHECK-DAG: sil hidden [thunk] @_T015objc_properties9SingletonC1jSSfsZTo : $@convention(objc_method) (NSString, @objc_metatype Singleton.Type) -> ()
+ // CHECK-DAG: sil hidden @_T015objc_properties9SingletonC1jSSvgZ : $@convention(method) (@thick Singleton.Type) -> @owned String
+ // CHECK-DAG: sil hidden [thunk] @_T015objc_properties9SingletonC1jSSvgZTo : $@convention(objc_method) (@objc_metatype Singleton.Type) -> @autoreleased NSString
+ // CHECK-DAG: sil hidden @_T015objc_properties9SingletonC1jSSvsZ : $@convention(method) (@owned String, @thick Singleton.Type) -> ()
+ // CHECK-DAG: sil hidden [thunk] @_T015objc_properties9SingletonC1jSSvsZTo : $@convention(objc_method) (NSString, @objc_metatype Singleton.Type) -> ()
static var j = "Hello"
- // CHECK-DAG: sil hidden [thunk] @_T015objc_properties9SingletonC1kSdfgZTo : $@convention(objc_method) (@objc_metatype Singleton.Type) -> Double
- // CHECK-DAG: sil hidden @_T015objc_properties9SingletonC1kSdfgZ : $@convention(method) (@thick Singleton.Type) -> Double
+ // CHECK-DAG: sil hidden [thunk] @_T015objc_properties9SingletonC1kSdvgZTo : $@convention(objc_method) (@objc_metatype Singleton.Type) -> Double
+ // CHECK-DAG: sil hidden @_T015objc_properties9SingletonC1kSdvgZ : $@convention(method) (@thick Singleton.Type) -> Double
static var k: Double {
return 7.7
}
}
class HasUnmanaged : NSObject {
- // CHECK-LABEL: sil hidden [thunk] @_T015objc_properties12HasUnmanagedC3refs0D0VyyXlGSgfgTo
+ // CHECK-LABEL: sil hidden [thunk] @_T015objc_properties12HasUnmanagedC3refs0D0VyyXlGSgvgTo
// CHECK: bb0([[CLS:%.*]] : $HasUnmanaged):
// CHECK: [[CLS_COPY:%.*]] = copy_value [[CLS]]
// CHECK: [[BORROWED_CLS_COPY:%.*]] = begin_borrow [[CLS_COPY]]
- // CHECK: [[NATIVE:%.+]] = function_ref @_T015objc_properties12HasUnmanagedC3refs0D0VyyXlGSgfg
+ // CHECK: [[NATIVE:%.+]] = function_ref @_T015objc_properties12HasUnmanagedC3refs0D0VyyXlGSgvg
// CHECK: [[RESULT:%.+]] = apply [[NATIVE]]([[BORROWED_CLS_COPY]])
// CHECK: end_borrow [[BORROWED_CLS_COPY]] from [[CLS_COPY]]
// CHECK-NOT: {{(retain|release)}}
// CHECK: destroy_value [[CLS_COPY]] : $HasUnmanaged
// CHECK-NOT: {{(retain|release)}}
// CHECK: return [[RESULT]] : $Optional<Unmanaged<AnyObject>>
- // CHECK: } // end sil function '_T015objc_properties12HasUnmanagedC3refs0D0VyyXlGSgfgTo'
+ // CHECK: } // end sil function '_T015objc_properties12HasUnmanagedC3refs0D0VyyXlGSgvgTo'
- // CHECK-LABEL: sil hidden [thunk] @_T015objc_properties12HasUnmanagedC3refs0D0VyyXlGSgfsTo
+ // CHECK-LABEL: sil hidden [thunk] @_T015objc_properties12HasUnmanagedC3refs0D0VyyXlGSgvsTo
// CHECK: bb0([[NEW_VALUE:%.*]] : $Optional<Unmanaged<AnyObject>>, [[SELF:%.*]] : $HasUnmanaged):
// CHECK-NEXT: [[SELF_COPY:%.*]] = copy_value [[SELF]] : $HasUnmanaged
// CHECK-NEXT: [[BORROWED_SELF_COPY:%.*]] = begin_borrow [[SELF_COPY]]
// CHECK-NEXT: // function_ref
- // CHECK-NEXT: [[NATIVE:%.+]] = function_ref @_T015objc_properties12HasUnmanagedC3refs0D0VyyXlGSgfs
+ // CHECK-NEXT: [[NATIVE:%.+]] = function_ref @_T015objc_properties12HasUnmanagedC3refs0D0VyyXlGSgvs
// CHECK-NEXT: [[RESULT:%.*]] = apply [[NATIVE]]([[NEW_VALUE]], [[BORROWED_SELF_COPY]])
// CHECK-NEXT: end_borrow [[BORROWED_SELF_COPY]] from [[SELF_COPY]]
// CHECK-NEXT: destroy_value [[SELF_COPY]] : $HasUnmanaged
// CHECK-NEXT: return [[RESULT:%.*]]
- // CHECK: } // end sil function '_T015objc_properties12HasUnmanagedC3refs0D0VyyXlGSgfsTo'
+ // CHECK: } // end sil function '_T015objc_properties12HasUnmanagedC3refs0D0VyyXlGSgvsTo'
@objc var ref: Unmanaged<AnyObject>?
}
@@ -225,8 +225,8 @@
}
}
-// CHECK-LABEL: sil hidden [thunk] @_T015objc_properties12ObjCSubclassC8propertySifgTo
-// CHECK-LABEL: sil hidden [thunk] @_T015objc_properties12ObjCSubclassC8propertySifsTo
+// CHECK-LABEL: sil hidden [thunk] @_T015objc_properties12ObjCSubclassC8propertySivgTo
+// CHECK-LABEL: sil hidden [thunk] @_T015objc_properties12ObjCSubclassC8propertySivsTo
// Make sure lazy properties that witness @objc protocol requirements are
// correctly formed
@@ -245,6 +245,6 @@
lazy var window = self.instanceMethod()
}
-// CHECK-LABEL: sil hidden @_T015objc_properties15HasLazyPropertyC6windowSo8NSObjectCSgfg : $@convention(method) (@guaranteed HasLazyProperty) -> @owned Optional<NSObject> {
+// CHECK-LABEL: sil hidden @_T015objc_properties15HasLazyPropertyC6windowSo8NSObjectCSgvg : $@convention(method) (@guaranteed HasLazyProperty) -> @owned Optional<NSObject> {
// CHECK: class_method %0 : $HasLazyProperty, #HasLazyProperty.instanceMethod!1 : (HasLazyProperty) -> () -> NSObject?
// CHECK: return
diff --git a/test/SILGen/objc_protocols.swift b/test/SILGen/objc_protocols.swift
index f29c010..c57aba8 100644
--- a/test/SILGen/objc_protocols.swift
+++ b/test/SILGen/objc_protocols.swift
@@ -230,14 +230,14 @@
}
extension StoredPropertyCount: NSCounting {}
-// CHECK-LABEL: sil hidden [transparent] [thunk] @_T014objc_protocols19StoredPropertyCountC5countSifgTo
+// CHECK-LABEL: sil hidden [transparent] [thunk] @_T014objc_protocols19StoredPropertyCountC5countSivgTo
class ComputedPropertyCount {
@objc var count: Int { return 0 }
}
extension ComputedPropertyCount: NSCounting {}
-// CHECK-LABEL: sil hidden [thunk] @_T014objc_protocols21ComputedPropertyCountC5countSifgTo
+// CHECK-LABEL: sil hidden [thunk] @_T014objc_protocols21ComputedPropertyCountC5countSivgTo
// -- adding @objc protocol conformances to native ObjC classes should not
// emit thunks since the methods are already available to ObjC.
diff --git a/test/SILGen/objc_set_bridging.swift b/test/SILGen/objc_set_bridging.swift
index 8ae0b9d..585af2d 100644
--- a/test/SILGen/objc_set_bridging.swift
+++ b/test/SILGen/objc_set_bridging.swift
@@ -50,11 +50,11 @@
var property: Set<Foo> = Set()
// Property getter
- // CHECK-LABEL: sil hidden [thunk] @_T017objc_set_bridging3FooC8property{{[_0-9a-zA-Z]*}}fgTo : $@convention(objc_method) (Foo) -> @autoreleased NSSet
+ // CHECK-LABEL: sil hidden [thunk] @_T017objc_set_bridging3FooC8property{{[_0-9a-zA-Z]*}}vgTo : $@convention(objc_method) (Foo) -> @autoreleased NSSet
// CHECK: bb0([[SELF:%[0-9]+]] : @unowned $Foo):
// CHECK: [[SELF_COPY]] = copy_value [[SELF]] : $Foo
// CHECK: [[BORROWED_SELF_COPY:%.*]] = begin_borrow [[SELF_COPY]]
- // CHECK: [[GETTER:%[0-9]+]] = function_ref @_T017objc_set_bridging3FooC8property{{[_0-9a-zA-Z]*}}fg : $@convention(method) (@guaranteed Foo) -> @owned Set<Foo>
+ // CHECK: [[GETTER:%[0-9]+]] = function_ref @_T017objc_set_bridging3FooC8property{{[_0-9a-zA-Z]*}}vg : $@convention(method) (@guaranteed Foo) -> @owned Set<Foo>
// CHECK: [[SET:%[0-9]+]] = apply [[GETTER]]([[BORROWED_SELF_COPY]]) : $@convention(method) (@guaranteed Foo) -> @owned Set<Foo>
// CHECK: end_borrow [[BORROWED_SELF_COPY]] from [[SELF_COPY]]
// CHECK: destroy_value [[SELF_COPY]]
@@ -64,10 +64,10 @@
// CHECK: end_borrow [[BORROWED_SET]] from [[SET]]
// CHECK: destroy_value [[SET]]
// CHECK: return [[NSSET]] : $NSSet
- // CHECK: } // end sil function '_T017objc_set_bridging3FooC8property{{[_0-9a-zA-Z]*}}fgTo'
+ // CHECK: } // end sil function '_T017objc_set_bridging3FooC8property{{[_0-9a-zA-Z]*}}vgTo'
// Property setter
- // CHECK-LABEL: sil hidden [thunk] @_T017objc_set_bridging3FooC8property{{[_0-9a-zA-Z]*}}fsTo : $@convention(objc_method) (NSSet, Foo) -> () {
+ // CHECK-LABEL: sil hidden [thunk] @_T017objc_set_bridging3FooC8property{{[_0-9a-zA-Z]*}}vsTo : $@convention(objc_method) (NSSet, Foo) -> () {
// CHECK: bb0([[NSSET:%[0-9]+]] : @unowned $NSSet, [[SELF:%[0-9]+]] : @unowned $Foo):
// CHECK: [[NSSET_COPY:%.*]] = copy_value [[NSSET]] : $NSSet
// CHECK: [[SELF_COPY:%.*]] = copy_value [[SELF]] : $Foo
@@ -76,14 +76,14 @@
// CHECK: [[SET_META:%[0-9]+]] = metatype $@thin Set<Foo>.Type
// CHECK: [[SET:%[0-9]+]] = apply [[CONVERTER]]<Foo>([[OPT_NSSET]], [[SET_META]])
// CHECK: [[BORROWED_SELF_COPY:%.*]] = begin_borrow [[SELF_COPY]]
- // CHECK: [[SETTER:%[0-9]+]] = function_ref @_T017objc_set_bridging3FooC8property{{[_0-9a-zA-Z]*}}fs : $@convention(method) (@owned Set<Foo>, @guaranteed Foo) -> ()
+ // CHECK: [[SETTER:%[0-9]+]] = function_ref @_T017objc_set_bridging3FooC8property{{[_0-9a-zA-Z]*}}vs : $@convention(method) (@owned Set<Foo>, @guaranteed Foo) -> ()
// CHECK: [[RESULT:%[0-9]+]] = apply [[SETTER]]([[SET]], [[BORROWED_SELF_COPY]]) : $@convention(method) (@owned Set<Foo>, @guaranteed Foo) -> ()
// CHECK: end_borrow [[BORROWED_SELF_COPY]] from [[SELF_COPY]]
// CHECK: destroy_value [[SELF_COPY]] : $Foo
// CHECK: return [[RESULT]] : $()
- // CHECK-LABEL: sil hidden [thunk] @_T017objc_set_bridging3FooC19nonVerbatimProperty{{[_0-9a-zA-Z]*}}fgTo : $@convention(objc_method) (Foo) -> @autoreleased NSSet
- // CHECK-LABEL: sil hidden [thunk] @_T017objc_set_bridging3FooC19nonVerbatimProperty{{[_0-9a-zA-Z]*}}fsTo : $@convention(objc_method) (NSSet, Foo) -> () {
+ // CHECK-LABEL: sil hidden [thunk] @_T017objc_set_bridging3FooC19nonVerbatimProperty{{[_0-9a-zA-Z]*}}vgTo : $@convention(objc_method) (Foo) -> @autoreleased NSSet
+ // CHECK-LABEL: sil hidden [thunk] @_T017objc_set_bridging3FooC19nonVerbatimProperty{{[_0-9a-zA-Z]*}}vsTo : $@convention(objc_method) (NSSet, Foo) -> () {
@objc var nonVerbatimProperty: Set<String> = Set()
}
diff --git a/test/SILGen/objc_subscript.swift b/test/SILGen/objc_subscript.swift
index 8169dce..b753f06 100644
--- a/test/SILGen/objc_subscript.swift
+++ b/test/SILGen/objc_subscript.swift
@@ -28,12 +28,12 @@
// 'super' subscript usage
class B : A {
@objc override subscript (i: Int) -> ObjCClass {
- // CHECK-LABEL: sil hidden @_T014objc_subscript1BC0B0AA9ObjCClassCSicfg : $@convention(method) (Int, @guaranteed B) -> @owned ObjCClass
+ // CHECK-LABEL: sil hidden @_T014objc_subscript1BCAA9ObjCClassCSicig : $@convention(method) (Int, @guaranteed B) -> @owned ObjCClass
get {
// CHECK: super_method [volatile] [[SELF:%[0-9]+]] : $B, #A.subscript!getter.1.foreign : (A) -> (Int) -> ObjCClass, $@convention(objc_method) (Int, A) -> @autoreleased ObjCClass
return super[i]
}
- // CHECK-LABEL: sil hidden @_T014objc_subscript1BC0B0AA9ObjCClassCSicfs : $@convention(method) (@owned ObjCClass, Int, @guaranteed B) -> ()
+ // CHECK-LABEL: sil hidden @_T014objc_subscript1BCAA9ObjCClassCSicis : $@convention(method) (@owned ObjCClass, Int, @guaranteed B) -> ()
set(value) {
// CHECK: super_method [volatile] [[SELF:%[0-9]+]] : $B, #A.subscript!setter.1.foreign : (A) -> (ObjCClass, Int) -> (), $@convention(objc_method) (ObjCClass, Int, A) -> ()
super[i] = value
diff --git a/test/SILGen/objc_thunks.swift b/test/SILGen/objc_thunks.swift
index 70e8354..ca1f97e 100644
--- a/test/SILGen/objc_thunks.swift
+++ b/test/SILGen/objc_thunks.swift
@@ -74,19 +74,19 @@
@objc var typicalProperty: Gizmo
// -- getter
- // CHECK-LABEL: sil hidden [thunk] @_T011objc_thunks6HoozitC15typicalPropertySo5GizmoCfgTo : $@convention(objc_method) (Hoozit) -> @autoreleased Gizmo {
+ // CHECK-LABEL: sil hidden [thunk] @_T011objc_thunks6HoozitC15typicalPropertySo5GizmoCvgTo : $@convention(objc_method) (Hoozit) -> @autoreleased Gizmo {
// CHECK: bb0([[SELF:%.*]] : @unowned $Hoozit):
// CHECK-NEXT: [[SELF_COPY:%.*]] = copy_value [[SELF]]
// CHECK-NEXT: [[BORROWED_SELF_COPY:%.*]] = begin_borrow [[SELF_COPY]]
// CHECK-NEXT: // function_ref objc_thunks.Hoozit.typicalProperty.getter
- // CHECK-NEXT: [[GETIMPL:%.*]] = function_ref @_T011objc_thunks6HoozitC15typicalPropertySo5GizmoCfg
+ // CHECK-NEXT: [[GETIMPL:%.*]] = function_ref @_T011objc_thunks6HoozitC15typicalPropertySo5GizmoCvg
// CHECK-NEXT: [[RES:%.*]] = apply [[GETIMPL]]([[BORROWED_SELF_COPY]])
// CHECK-NEXT: end_borrow [[BORROWED_SELF_COPY]] from [[SELF_COPY]]
// CHECK-NEXT: destroy_value [[SELF_COPY]]
// CHECK-NEXT: return [[RES]] : $Gizmo
// CHECK-NEXT: }
- // CHECK-LABEL: sil hidden @_T011objc_thunks6HoozitC15typicalPropertySo5GizmoCfg : $@convention(method) (@guaranteed Hoozit) -> @owned Gizmo
+ // CHECK-LABEL: sil hidden @_T011objc_thunks6HoozitC15typicalPropertySo5GizmoCvg : $@convention(method) (@guaranteed Hoozit) -> @owned Gizmo
// CHECK: bb0(%0 : @guaranteed $Hoozit):
// CHECK-NEXT: debug_value %0
// CHECK-NEXT: [[ADDR:%.*]] = ref_element_addr %0 : {{.*}}, #Hoozit.typicalProperty
@@ -96,20 +96,20 @@
// CHECK-NEXT: return [[RES]]
// -- setter
- // CHECK-LABEL: sil hidden [thunk] @_T011objc_thunks6HoozitC15typicalPropertySo5GizmoCfsTo : $@convention(objc_method) (Gizmo, Hoozit) -> () {
+ // CHECK-LABEL: sil hidden [thunk] @_T011objc_thunks6HoozitC15typicalPropertySo5GizmoCvsTo : $@convention(objc_method) (Gizmo, Hoozit) -> () {
// CHECK: bb0([[VALUE:%.*]] : @unowned $Gizmo, [[THIS:%.*]] : @unowned $Hoozit):
// CHECK: [[VALUE_COPY:%.*]] = copy_value [[VALUE]] : $Gizmo
// CHECK: [[THIS_COPY:%.*]] = copy_value [[THIS]] : $Hoozit
// CHECK: [[BORROWED_THIS_COPY:%.*]] = begin_borrow [[THIS_COPY]]
// CHECK: // function_ref objc_thunks.Hoozit.typicalProperty.setter
- // CHECK: [[FR:%.*]] = function_ref @_T011objc_thunks6HoozitC15typicalPropertySo5GizmoCfs
+ // CHECK: [[FR:%.*]] = function_ref @_T011objc_thunks6HoozitC15typicalPropertySo5GizmoCvs
// CHECK: [[RES:%.*]] = apply [[FR]]([[VALUE_COPY]], [[BORROWED_THIS_COPY]])
// CHECK: end_borrow [[BORROWED_THIS_COPY]] from [[THIS_COPY]]
// CHECK: destroy_value [[THIS_COPY]]
// CHECK: return [[RES]] : $(), scope {{.*}} // id: {{.*}} line:[[@LINE-34]]:13:auto_gen
- // CHECK: } // end sil function '_T011objc_thunks6HoozitC15typicalPropertySo5GizmoCfsTo'
+ // CHECK: } // end sil function '_T011objc_thunks6HoozitC15typicalPropertySo5GizmoCvsTo'
- // CHECK-LABEL: sil hidden @_T011objc_thunks6HoozitC15typicalPropertySo5GizmoCfs
+ // CHECK-LABEL: sil hidden @_T011objc_thunks6HoozitC15typicalPropertySo5GizmoCvs
// CHECK: bb0([[ARG0:%.*]] : @owned $Gizmo, [[ARG1:%.*]] : @guaranteed $Hoozit):
// CHECK: [[BORROWED_ARG0:%.*]] = begin_borrow [[ARG0]]
// CHECK: [[ARG0_COPY:%.*]] = copy_value [[BORROWED_ARG0]]
@@ -119,24 +119,24 @@
// CHECK: end_access [[WRITE]] : $*Gizmo
// CHECK: end_borrow [[BORROWED_ARG0]] from [[ARG0]]
// CHECK: destroy_value [[ARG0]]
- // CHECK: } // end sil function '_T011objc_thunks6HoozitC15typicalPropertySo5GizmoCfs'
+ // CHECK: } // end sil function '_T011objc_thunks6HoozitC15typicalPropertySo5GizmoCvs'
// NS_RETURNS_RETAINED getter by family (-copy)
@objc var copyProperty: Gizmo
// -- getter
- // CHECK-LABEL: sil hidden [thunk] @_T011objc_thunks6HoozitC12copyPropertySo5GizmoCfgTo : $@convention(objc_method) (Hoozit) -> @owned Gizmo {
+ // CHECK-LABEL: sil hidden [thunk] @_T011objc_thunks6HoozitC12copyPropertySo5GizmoCvgTo : $@convention(objc_method) (Hoozit) -> @owned Gizmo {
// CHECK: bb0([[SELF:%.*]] : @unowned $Hoozit):
// CHECK-NEXT: [[SELF_COPY:%.*]] = copy_value [[SELF]]
// CHECK-NEXT: [[BORROWED_SELF_COPY:%.*]] = begin_borrow [[SELF_COPY]]
// CHECK-NEXT: // function_ref objc_thunks.Hoozit.copyProperty.getter
- // CHECK-NEXT: [[FR:%.*]] = function_ref @_T011objc_thunks6HoozitC12copyPropertySo5GizmoCfg
+ // CHECK-NEXT: [[FR:%.*]] = function_ref @_T011objc_thunks6HoozitC12copyPropertySo5GizmoCvg
// CHECK-NEXT: [[RES:%.*]] = apply [[FR]]([[BORROWED_SELF_COPY]])
// CHECK-NEXT: end_borrow [[BORROWED_SELF_COPY]] from [[SELF_COPY]]
// CHECK-NEXT: destroy_value [[SELF_COPY]]
// CHECK-NEXT: return [[RES]]
// CHECK-NEXT: }
- // CHECK-LABEL: sil hidden @_T011objc_thunks6HoozitC12copyPropertySo5GizmoCfg
+ // CHECK-LABEL: sil hidden @_T011objc_thunks6HoozitC12copyPropertySo5GizmoCvg
// CHECK: bb0(%0 : @guaranteed $Hoozit):
// CHECK: [[ADDR:%.*]] = ref_element_addr %0 : {{.*}}, #Hoozit.copyProperty
// CHECK-NEXT: [[READ:%.*]] = begin_access [read] [dynamic] [[ADDR]] : $*Gizmo
@@ -145,19 +145,19 @@
// CHECK-NEXT: return [[RES]]
// -- setter is normal
- // CHECK-LABEL: sil hidden [thunk] @_T011objc_thunks6HoozitC12copyPropertySo5GizmoCfsTo : $@convention(objc_method) (Gizmo, Hoozit) -> () {
+ // CHECK-LABEL: sil hidden [thunk] @_T011objc_thunks6HoozitC12copyPropertySo5GizmoCvsTo : $@convention(objc_method) (Gizmo, Hoozit) -> () {
// CHECK: bb0([[VALUE:%.*]] : @unowned $Gizmo, [[THIS:%.*]] : @unowned $Hoozit):
// CHECK-NEXT: [[VALUE_COPY:%.*]] = copy_value [[VALUE]]
// CHECK-NEXT: [[THIS_COPY:%.*]] = copy_value [[THIS]]
// CHECK-NEXT: [[BORROWED_THIS_COPY:%.*]] = begin_borrow [[THIS_COPY]]
// CHECK-NEXT: // function_ref objc_thunks.Hoozit.copyProperty.setter
- // CHECK-NEXT: [[FR:%.*]] = function_ref @_T011objc_thunks6HoozitC12copyPropertySo5GizmoCfs
+ // CHECK-NEXT: [[FR:%.*]] = function_ref @_T011objc_thunks6HoozitC12copyPropertySo5GizmoCvs
// CHECK-NEXT: [[RES:%.*]] = apply [[FR]]([[VALUE_COPY]], [[BORROWED_THIS_COPY]])
// CHECK-NEXT: end_borrow [[BORROWED_THIS_COPY]] from [[THIS_COPY]]
// CHECK-NEXT: destroy_value [[THIS_COPY]]
// CHECK-NEXT: return [[RES]]
- // CHECK-LABEL: sil hidden @_T011objc_thunks6HoozitC12copyPropertySo5GizmoCfs
+ // CHECK-LABEL: sil hidden @_T011objc_thunks6HoozitC12copyPropertySo5GizmoCvs
// CHECK: bb0([[ARG1:%.*]] : @owned $Gizmo, [[SELF:%.*]] : @guaranteed $Hoozit):
// CHECK: [[BORROWED_ARG1:%.*]] = begin_borrow [[ARG1]]
// CHECK: [[ARG1_COPY:%.*]] = copy_value [[BORROWED_ARG1]]
@@ -167,24 +167,24 @@
// CHECK: end_access [[WRITE]] : $*Gizmo
// CHECK: end_borrow [[BORROWED_ARG1]] from [[ARG1]]
// CHECK: destroy_value [[ARG1]]
- // CHECK: } // end sil function '_T011objc_thunks6HoozitC12copyPropertySo5GizmoCfs'
+ // CHECK: } // end sil function '_T011objc_thunks6HoozitC12copyPropertySo5GizmoCvs'
@objc var roProperty: Gizmo { return self }
// -- getter
- // CHECK-LABEL: sil hidden [thunk] @_T011objc_thunks6HoozitC10roPropertySo5GizmoCfgTo : $@convention(objc_method) (Hoozit) -> @autoreleased Gizmo {
+ // CHECK-LABEL: sil hidden [thunk] @_T011objc_thunks6HoozitC10roPropertySo5GizmoCvgTo : $@convention(objc_method) (Hoozit) -> @autoreleased Gizmo {
// CHECK: bb0([[THIS:%.*]] : @unowned $Hoozit):
// CHECK-NEXT: [[THIS_COPY:%.*]] = copy_value [[THIS]]
// CHECK-NEXT: [[BORROWED_THIS_COPY:%.*]] = begin_borrow [[THIS_COPY]]
// CHECK-NEXT: // function_ref
- // CHECK-NEXT: [[NATIVE:%.*]] = function_ref @_T011objc_thunks6HoozitC10roPropertySo5GizmoCfg : $@convention(method) (@guaranteed Hoozit) -> @owned Gizmo
+ // CHECK-NEXT: [[NATIVE:%.*]] = function_ref @_T011objc_thunks6HoozitC10roPropertySo5GizmoCvg : $@convention(method) (@guaranteed Hoozit) -> @owned Gizmo
// CHECK-NEXT: [[RES:%.*]] = apply [[NATIVE]]([[BORROWED_THIS_COPY]])
// CHECK-NEXT: end_borrow [[BORROWED_THIS_COPY]] from [[THIS_COPY]]
// CHECK-NEXT: destroy_value [[THIS_COPY]] : $Hoozit
// CHECK-NEXT: return [[RES]] : $Gizmo
- // CHECK-NEXT: } // end sil function '_T011objc_thunks6HoozitC10roPropertySo5GizmoCfgTo'
+ // CHECK-NEXT: } // end sil function '_T011objc_thunks6HoozitC10roPropertySo5GizmoCvgTo'
// -- no setter
- // CHECK-NOT: sil hidden [thunk] @_T011objc_thunks6HoozitC10roPropertySo5GizmoCfsTo
+ // CHECK-NOT: sil hidden [thunk] @_T011objc_thunks6HoozitC10roPropertySo5GizmoCvsTo
@objc var rwProperty: Gizmo {
get {
@@ -193,16 +193,16 @@
set {}
}
// -- getter
- // CHECK-LABEL: sil hidden [thunk] @_T011objc_thunks6HoozitC10rwPropertySo5GizmoCfgTo : $@convention(objc_method) (Hoozit) -> @autoreleased Gizmo
+ // CHECK-LABEL: sil hidden [thunk] @_T011objc_thunks6HoozitC10rwPropertySo5GizmoCvgTo : $@convention(objc_method) (Hoozit) -> @autoreleased Gizmo
// -- setter
- // CHECK-LABEL: sil hidden [thunk] @_T011objc_thunks6HoozitC10rwPropertySo5GizmoCfsTo : $@convention(objc_method) (Gizmo, Hoozit) -> () {
+ // CHECK-LABEL: sil hidden [thunk] @_T011objc_thunks6HoozitC10rwPropertySo5GizmoCvsTo : $@convention(objc_method) (Gizmo, Hoozit) -> () {
// CHECK: bb0([[VALUE:%.*]] : @unowned $Gizmo, [[THIS:%.*]] : @unowned $Hoozit):
// CHECK-NEXT: [[VALUE_COPY:%.*]] = copy_value [[VALUE]]
// CHECK-NEXT: [[THIS_COPY:%.*]] = copy_value [[THIS]]
// CHECK-NEXT: [[BORROWED_THIS_COPY:%.*]] = begin_borrow [[THIS_COPY]]
// CHECK-NEXT: // function_ref
- // CHECK-NEXT: [[NATIVE:%.*]] = function_ref @_T011objc_thunks6HoozitC10rwPropertySo5GizmoCfs : $@convention(method) (@owned Gizmo, @guaranteed Hoozit) -> ()
+ // CHECK-NEXT: [[NATIVE:%.*]] = function_ref @_T011objc_thunks6HoozitC10rwPropertySo5GizmoCvs : $@convention(method) (@owned Gizmo, @guaranteed Hoozit) -> ()
// CHECK-NEXT: apply [[NATIVE]]([[VALUE_COPY]], [[BORROWED_THIS_COPY]])
// CHECK-NEXT: end_borrow [[BORROWED_THIS_COPY]] from [[THIS_COPY]]
// CHECK-NEXT: destroy_value [[THIS_COPY]]
@@ -216,12 +216,12 @@
set {}
}
// -- getter
- // CHECK-LABEL: sil hidden [thunk] @_T011objc_thunks6HoozitC14copyRWPropertySo5GizmoCfgTo : $@convention(objc_method) (Hoozit) -> @owned Gizmo {
+ // CHECK-LABEL: sil hidden [thunk] @_T011objc_thunks6HoozitC14copyRWPropertySo5GizmoCvgTo : $@convention(objc_method) (Hoozit) -> @owned Gizmo {
// CHECK: bb0([[THIS:%.*]] : @unowned $Hoozit):
// CHECK-NEXT: [[THIS_COPY:%.*]] = copy_value [[THIS]]
// CHECK-NEXT: [[BORROWED_THIS_COPY:%.*]] = begin_borrow [[THIS_COPY]]
// CHECK-NEXT: // function_ref
- // CHECK-NEXT: [[NATIVE:%.*]] = function_ref @_T011objc_thunks6HoozitC14copyRWPropertySo5GizmoCfg : $@convention(method) (@guaranteed Hoozit) -> @owned Gizmo
+ // CHECK-NEXT: [[NATIVE:%.*]] = function_ref @_T011objc_thunks6HoozitC14copyRWPropertySo5GizmoCvg : $@convention(method) (@guaranteed Hoozit) -> @owned Gizmo
// CHECK-NEXT: [[RES:%.*]] = apply [[NATIVE]]([[BORROWED_THIS_COPY]])
// CHECK-NEXT: end_borrow [[BORROWED_THIS_COPY]] from [[THIS_COPY]]
// CHECK-NEXT: destroy_value [[THIS_COPY]]
@@ -230,13 +230,13 @@
// CHECK-NEXT: }
// -- setter is normal
- // CHECK-LABEL: sil hidden [thunk] @_T011objc_thunks6HoozitC14copyRWPropertySo5GizmoCfsTo : $@convention(objc_method) (Gizmo, Hoozit) -> () {
+ // CHECK-LABEL: sil hidden [thunk] @_T011objc_thunks6HoozitC14copyRWPropertySo5GizmoCvsTo : $@convention(objc_method) (Gizmo, Hoozit) -> () {
// CHECK: bb0([[VALUE:%.*]] : @unowned $Gizmo, [[THIS:%.*]] : @unowned $Hoozit):
// CHECK-NEXT: [[VALUE_COPY:%.*]] = copy_value [[VALUE]]
// CHECK-NEXT: [[THIS_COPY:%.*]] = copy_value [[THIS]]
// CHECK-NEXT: [[BORROWED_THIS_COPY:%.*]] = begin_borrow [[THIS_COPY]]
// CHECK-NEXT: // function_ref
- // CHECK-NEXT: [[NATIVE:%.*]] = function_ref @_T011objc_thunks6HoozitC14copyRWPropertySo5GizmoCfs : $@convention(method) (@owned Gizmo, @guaranteed Hoozit) -> ()
+ // CHECK-NEXT: [[NATIVE:%.*]] = function_ref @_T011objc_thunks6HoozitC14copyRWPropertySo5GizmoCvs : $@convention(method) (@owned Gizmo, @guaranteed Hoozit) -> ()
// CHECK-NEXT: apply [[NATIVE]]([[VALUE_COPY]], [[BORROWED_THIS_COPY]])
// CHECK-NEXT: end_borrow [[BORROWED_THIS_COPY]] from [[THIS_COPY]]
// CHECK-NEXT: destroy_value [[THIS_COPY]]
@@ -245,12 +245,12 @@
@objc var initProperty: Gizmo
// -- getter
- // CHECK-LABEL: sil hidden [thunk] @_T011objc_thunks6HoozitC12initPropertySo5GizmoCfgTo : $@convention(objc_method) (Hoozit) -> @autoreleased Gizmo {
+ // CHECK-LABEL: sil hidden [thunk] @_T011objc_thunks6HoozitC12initPropertySo5GizmoCvgTo : $@convention(objc_method) (Hoozit) -> @autoreleased Gizmo {
// CHECK: bb0([[THIS:%.*]] : @unowned $Hoozit):
// CHECK-NEXT: [[THIS_COPY:%.*]] = copy_value [[THIS]]
// CHECK-NEXT: [[BORROWED_THIS_COPY:%.*]] = begin_borrow [[THIS_COPY]]
// CHECK-NEXT: // function_ref
- // CHECK-NEXT: [[NATIVE:%.*]] = function_ref @_T011objc_thunks6HoozitC12initPropertySo5GizmoCfg : $@convention(method) (@guaranteed Hoozit) -> @owned Gizmo
+ // CHECK-NEXT: [[NATIVE:%.*]] = function_ref @_T011objc_thunks6HoozitC12initPropertySo5GizmoCvg : $@convention(method) (@guaranteed Hoozit) -> @owned Gizmo
// CHECK-NEXT: [[RES:%.*]] = apply [[NATIVE]]([[BORROWED_THIS_COPY]])
// CHECK-NEXT: end_borrow [[BORROWED_THIS_COPY]] from [[THIS_COPY]]
// CHECK-NEXT: destroy_value [[THIS_COPY]]
@@ -258,13 +258,13 @@
// CHECK-NEXT: }
// -- setter
- // CHECK-LABEL: sil hidden [thunk] @_T011objc_thunks6HoozitC12initPropertySo5GizmoCfsTo : $@convention(objc_method) (Gizmo, Hoozit) -> () {
+ // CHECK-LABEL: sil hidden [thunk] @_T011objc_thunks6HoozitC12initPropertySo5GizmoCvsTo : $@convention(objc_method) (Gizmo, Hoozit) -> () {
// CHECK: bb0([[VALUE:%.*]] : @unowned $Gizmo, [[THIS:%.*]] : @unowned $Hoozit):
// CHECK-NEXT: [[VALUE_COPY:%.*]] = copy_value [[VALUE]]
// CHECK-NEXT: [[THIS_COPY:%.*]] = copy_value [[THIS]]
// CHECK-NEXT: [[BORROWED_THIS_COPY:%.*]] = begin_borrow [[THIS_COPY]]
// CHECK-NEXT: // function_ref
- // CHECK-NEXT: [[NATIVE:%.*]] = function_ref @_T011objc_thunks6HoozitC12initPropertySo5GizmoCfs : $@convention(method) (@owned Gizmo, @guaranteed Hoozit) -> ()
+ // CHECK-NEXT: [[NATIVE:%.*]] = function_ref @_T011objc_thunks6HoozitC12initPropertySo5GizmoCvs : $@convention(method) (@owned Gizmo, @guaranteed Hoozit) -> ()
// CHECK-NEXT: apply [[NATIVE]]([[VALUE_COPY]], [[BORROWED_THIS_COPY]])
// CHECK-NEXT: end_borrow [[BORROWED_THIS_COPY]] from [[THIS_COPY]]
// CHECK-NEXT: destroy_value [[THIS_COPY]]
@@ -276,12 +276,12 @@
@objc(initPropComputedSetter:) set {}
}
// -- getter
- // CHECK-LABEL: sil hidden [thunk] @_T011objc_thunks6HoozitC12propComputedSo5GizmoCfgTo : $@convention(objc_method) (Hoozit) -> @autoreleased Gizmo {
+ // CHECK-LABEL: sil hidden [thunk] @_T011objc_thunks6HoozitC12propComputedSo5GizmoCvgTo : $@convention(objc_method) (Hoozit) -> @autoreleased Gizmo {
// CHECK: bb0([[THIS:%.*]] : @unowned $Hoozit):
// CHECK-NEXT: [[THIS_COPY:%.*]] = copy_value [[THIS]]
// CHECK-NEXT: [[BORROWED_THIS_COPY:%.*]] = begin_borrow [[THIS_COPY]]
// CHECK-NEXT: // function_ref
- // CHECK-NEXT: [[NATIVE:%.*]] = function_ref @_T011objc_thunks6HoozitC12propComputedSo5GizmoCfg : $@convention(method) (@guaranteed Hoozit) -> @owned Gizmo
+ // CHECK-NEXT: [[NATIVE:%.*]] = function_ref @_T011objc_thunks6HoozitC12propComputedSo5GizmoCvg : $@convention(method) (@guaranteed Hoozit) -> @owned Gizmo
// CHECK-NEXT: [[RES:%.*]] = apply [[NATIVE]]([[BORROWED_THIS_COPY]])
// CHECK-NEXT: end_borrow [[BORROWED_THIS_COPY]] from [[THIS_COPY]]
// CHECK-NEXT: destroy_value [[THIS_COPY]]
@@ -289,13 +289,13 @@
// CHECK-NEXT: }
// -- setter
- // CHECK-LABEL: sil hidden [thunk] @_T011objc_thunks6HoozitC12propComputedSo5GizmoCfsTo : $@convention(objc_method) (Gizmo, Hoozit) -> () {
+ // CHECK-LABEL: sil hidden [thunk] @_T011objc_thunks6HoozitC12propComputedSo5GizmoCvsTo : $@convention(objc_method) (Gizmo, Hoozit) -> () {
// CHECK: bb0([[VALUE:%.*]] : @unowned $Gizmo, [[THIS:%.*]] : @unowned $Hoozit):
// CHECK-NEXT: [[VALUE_COPY:%.*]] = copy_value [[VALUE]]
// CHECK-NEXT: [[THIS_COPY:%.*]] = copy_value [[THIS]]
// CHECK-NEXT: [[BORROWED_THIS_COPY:%.*]] = begin_borrow [[THIS_COPY]]
// CHECK-NEXT: // function_ref
- // CHECK-NEXT: [[NATIVE:%.*]] = function_ref @_T011objc_thunks6HoozitC12propComputedSo5GizmoCfs : $@convention(method) (@owned Gizmo, @guaranteed Hoozit) -> ()
+ // CHECK-NEXT: [[NATIVE:%.*]] = function_ref @_T011objc_thunks6HoozitC12propComputedSo5GizmoCvs : $@convention(method) (@owned Gizmo, @guaranteed Hoozit) -> ()
// CHECK-NEXT: apply [[NATIVE]]([[VALUE_COPY]], [[BORROWED_THIS_COPY]])
// CHECK-NEXT: end_borrow [[BORROWED_THIS_COPY]] from [[THIS_COPY]]
// CHECK-NEXT: destroy_value [[THIS_COPY]]
@@ -328,12 +328,12 @@
// Subscript
@objc subscript (i: Int) -> Hoozit {
// Getter
- // CHECK-LABEL: sil hidden [thunk] @_T011objc_thunks6HoozitC9subscriptACSicfgTo : $@convention(objc_method) (Int, Hoozit) -> @autoreleased Hoozit
+ // CHECK-LABEL: sil hidden [thunk] @_T011objc_thunks6HoozitCACSicigTo : $@convention(objc_method) (Int, Hoozit) -> @autoreleased Hoozit
// CHECK: bb0([[I:%[0-9]+]] : @trivial $Int, [[SELF:%[0-9]+]] : @unowned $Hoozit):
// CHECK-NEXT: [[SELF_COPY:%.*]] = copy_value [[SELF]] : $Hoozit
// CHECK-NEXT: [[BORROWED_SELF_COPY:%.*]] = begin_borrow [[SELF_COPY]]
// CHECK-NEXT: // function_ref
- // CHECK-NEXT: [[NATIVE:%[0-9]+]] = function_ref @_T011objc_thunks6HoozitC9subscriptACSicfg : $@convention(method) (Int, @guaranteed Hoozit) -> @owned Hoozit
+ // CHECK-NEXT: [[NATIVE:%[0-9]+]] = function_ref @_T011objc_thunks6HoozitCACSicig : $@convention(method) (Int, @guaranteed Hoozit) -> @owned Hoozit
// CHECK-NEXT: [[RESULT:%[0-9]+]] = apply [[NATIVE]]([[I]], [[BORROWED_SELF_COPY]]) : $@convention(method) (Int, @guaranteed Hoozit) -> @owned Hoozit
// CHECK-NEXT: end_borrow [[BORROWED_SELF_COPY]] from [[SELF_COPY]]
// CHECK-NEXT: destroy_value [[SELF_COPY]]
@@ -343,17 +343,17 @@
}
// Setter
- // CHECK-LABEL: sil hidden [thunk] @_T011objc_thunks6HoozitC9subscriptACSicfsTo : $@convention(objc_method) (Hoozit, Int, Hoozit) -> ()
+ // CHECK-LABEL: sil hidden [thunk] @_T011objc_thunks6HoozitCACSicisTo : $@convention(objc_method) (Hoozit, Int, Hoozit) -> ()
// CHECK: bb0([[VALUE:%[0-9]+]] : @unowned $Hoozit, [[I:%[0-9]+]] : @trivial $Int, [[SELF:%[0-9]+]] : @unowned $Hoozit):
// CHECK: [[VALUE_COPY:%.*]] = copy_value [[VALUE]] : $Hoozit
// CHECK: [[SELF_COPY:%.*]] = copy_value [[SELF]] : $Hoozit
// CHECK: [[BORROWED_SELF_COPY:%.*]] = begin_borrow [[SELF_COPY]]
- // CHECK: [[NATIVE:%[0-9]+]] = function_ref @_T011objc_thunks6HoozitC9subscriptACSicfs : $@convention(method) (@owned Hoozit, Int, @guaranteed Hoozit) -> ()
+ // CHECK: [[NATIVE:%[0-9]+]] = function_ref @_T011objc_thunks6HoozitCACSicis : $@convention(method) (@owned Hoozit, Int, @guaranteed Hoozit) -> ()
// CHECK: [[RESULT:%[0-9]+]] = apply [[NATIVE]]([[VALUE_COPY]], [[I]], [[BORROWED_SELF_COPY]]) : $@convention(method) (@owned Hoozit, Int, @guaranteed Hoozit) -> ()
// CHECK: end_borrow [[BORROWED_SELF_COPY]] from [[SELF_COPY]]
// CHECK: destroy_value [[SELF_COPY]]
// CHECK: return [[RESULT]] : $()
- // CHECK: } // end sil function '_T011objc_thunks6HoozitC9subscriptACSicfsTo'
+ // CHECK: } // end sil function '_T011objc_thunks6HoozitCACSicisTo'
set {}
}
}
@@ -381,12 +381,12 @@
super.init()
}
- // CHECK-LABEL: sil hidden [thunk] @_T011objc_thunks6WotsitC11descriptionSSfgTo : $@convention(objc_method) <T> (Wotsit<T>) -> @autoreleased NSString {
+ // CHECK-LABEL: sil hidden [thunk] @_T011objc_thunks6WotsitC11descriptionSSvgTo : $@convention(objc_method) <T> (Wotsit<T>) -> @autoreleased NSString {
// CHECK: bb0([[SELF:%.*]] : @unowned $Wotsit<T>):
// CHECK-NEXT: [[SELF_COPY:%.*]] = copy_value [[SELF]] : $Wotsit<T>
// CHECK-NEXT: [[BORROWED_SELF_COPY:%.*]] = begin_borrow [[SELF_COPY]]
// CHECK-NEXT: // function_ref
- // CHECK-NEXT: [[NATIVE:%.*]] = function_ref @_T011objc_thunks6WotsitC11descriptionSSfg : $@convention(method) <τ_0_0> (@guaranteed Wotsit<τ_0_0>) -> @owned String
+ // CHECK-NEXT: [[NATIVE:%.*]] = function_ref @_T011objc_thunks6WotsitC11descriptionSSvg : $@convention(method) <τ_0_0> (@guaranteed Wotsit<τ_0_0>) -> @owned String
// CHECK-NEXT: [[RESULT:%.*]] = apply [[NATIVE:%.*]]<T>([[BORROWED_SELF_COPY]]) : $@convention(method) <τ_0_0> (@guaranteed Wotsit<τ_0_0>) -> @owned String
// CHECK-NEXT: end_borrow [[BORROWED_SELF_COPY]] from [[SELF_COPY]]
// CHECK-NEXT: destroy_value [[SELF_COPY]] : $Wotsit<T>
@@ -452,7 +452,7 @@
// CHECK-LABEL: sil hidden [thunk] @_T011objc_thunks6HoozitC4foofyyFTo : $@convention(objc_method) (Hoozit) -> () {
var extensionProperty: Int { return 0 }
- // CHECK-LABEL: sil hidden @_T011objc_thunks6HoozitC17extensionPropertySifg : $@convention(method) (@guaranteed Hoozit) -> Int
+ // CHECK-LABEL: sil hidden @_T011objc_thunks6HoozitC17extensionPropertySivg : $@convention(method) (@guaranteed Hoozit) -> Int
}
// Calling objc methods of subclass should go through native entry points
@@ -522,12 +522,12 @@
// CHECK-LABEL: sil hidden @_T011objc_thunks19DesignatedOverridesCSQyACGycfc
// CHECK-NOT: return
- // CHECK: function_ref @_T011objc_thunks19DesignatedOverridesC1iSivfi : $@convention(thin) () -> Int
+ // CHECK: function_ref @_T011objc_thunks19DesignatedOverridesC1iSivpfi : $@convention(thin) () -> Int
// CHECK: super_method [volatile] [[SELF:%[0-9]+]] : $DesignatedOverrides, #Gizmo.init!initializer.1.foreign : (Gizmo.Type) -> () -> Gizmo!, $@convention(objc_method) (@owned Gizmo) -> @owned Optional<Gizmo>
// CHECK: return
// CHECK-LABEL: sil hidden @_T011objc_thunks19DesignatedOverridesCSQyACGSi7bellsOn_tcfc
- // CHECK: function_ref @_T011objc_thunks19DesignatedOverridesC1iSivfi : $@convention(thin) () -> Int
+ // CHECK: function_ref @_T011objc_thunks19DesignatedOverridesC1iSivpfi : $@convention(thin) () -> Int
// CHECK: super_method [volatile] [[SELF:%[0-9]+]] : $DesignatedOverrides, #Gizmo.init!initializer.1.foreign : (Gizmo.Type) -> (Int) -> Gizmo!, $@convention(objc_method) (Int, @owned Gizmo) -> @owned Optional<Gizmo>
// CHECK: return
}
diff --git a/test/SILGen/objc_witnesses.swift b/test/SILGen/objc_witnesses.swift
index c34cb65..49cfd89 100644
--- a/test/SILGen/objc_witnesses.swift
+++ b/test/SILGen/objc_witnesses.swift
@@ -62,9 +62,9 @@
subscript(x: Int) -> Any { get }
}
-// CHECK-LABEL: sil private [transparent] [thunk] @_T0So7NSArrayC14objc_witnesses13SubscriptableA2cDP9subscriptypSicfgTW : $@convention(witness_method) (Int, @in_guaranteed NSArray) -> @out Any {
-// CHECK: function_ref @_T0So7NSArrayC9subscriptypSicfgTO : $@convention(method) (Int, @guaranteed NSArray) -> @out Any
-// CHECK-LABEL: sil shared [serializable] [thunk] @_T0So7NSArrayC9subscriptypSicfgTO : $@convention(method) (Int, @guaranteed NSArray) -> @out Any {
+// CHECK-LABEL: sil private [transparent] [thunk] @_T0So7NSArrayC14objc_witnesses13SubscriptableA2cDPypSicigTW : $@convention(witness_method) (Int, @in_guaranteed NSArray) -> @out Any {
+// CHECK: function_ref @_T0So7NSArrayCypSicigTO : $@convention(method) (Int, @guaranteed NSArray) -> @out Any
+// CHECK-LABEL: sil shared [serializable] [thunk] @_T0So7NSArrayCypSicigTO : $@convention(method) (Int, @guaranteed NSArray) -> @out Any {
// CHECK: class_method [volatile] {{%.*}} : $NSArray, #NSArray.subscript!getter.1.foreign
extension NSArray: Subscriptable {}
@@ -78,11 +78,11 @@
dynamic var quantumNumber: Int = 0
}
-// CHECK-LABEL: sil private [transparent] [thunk] @_T014objc_witnesses8ElectronCAA7OrbitalA2aDP13quantumNumberSifgTW
-// CHECK-LABEL: sil shared [transparent] [serializable] [thunk] @_T014objc_witnesses8ElectronC13quantumNumberSifgTD
+// CHECK-LABEL: sil private [transparent] [thunk] @_T014objc_witnesses8ElectronCAA7OrbitalA2aDP13quantumNumberSivgTW
+// CHECK-LABEL: sil shared [transparent] [serializable] [thunk] @_T014objc_witnesses8ElectronC13quantumNumberSivgTD
-// CHECK-LABEL: sil private [transparent] [thunk] @_T014objc_witnesses8ElectronCAA7OrbitalA2aDP13quantumNumberSifsTW
-// CHECK-LABEL: sil shared [transparent] [serializable] [thunk] @_T014objc_witnesses8ElectronC13quantumNumberSifsTD
+// CHECK-LABEL: sil private [transparent] [thunk] @_T014objc_witnesses8ElectronCAA7OrbitalA2aDP13quantumNumberSivsTW
+// CHECK-LABEL: sil shared [transparent] [serializable] [thunk] @_T014objc_witnesses8ElectronC13quantumNumberSivsTD
// witness is a dynamic thunk and is public:
@@ -94,8 +94,8 @@
public dynamic var spin: Float = 0.5
}
-// CHECK-LABEL: sil shared [transparent] [serialized] [thunk] @_T014objc_witnesses8PositronCAA6LeptonA2aDP4spinSffgTW
-// CHECK-LABEL: sil shared [transparent] [serializable] [thunk] @_T014objc_witnesses8PositronC4spinSffgTD
+// CHECK-LABEL: sil shared [transparent] [serialized] [thunk] @_T014objc_witnesses8PositronCAA6LeptonA2aDP4spinSfvgTW
+// CHECK-LABEL: sil shared [transparent] [serializable] [thunk] @_T014objc_witnesses8PositronC4spinSfvgTD
// Override of property defined in @objc extension
@@ -109,11 +109,11 @@
var valence: Int { get { return 1 } set { } }
}
-// CHECK-LABEL: sil private @_T0So8NSObjectC14objc_witnessesE7valenceSifmytfU_ : $@convention(method) (Builtin.RawPointer, @inout Builtin.UnsafeValueBuffer, @inout NSObject, @thick NSObject.Type) -> () {
+// CHECK-LABEL: sil private @_T0So8NSObjectC14objc_witnessesE7valenceSivmytfU_ : $@convention(method) (Builtin.RawPointer, @inout Builtin.UnsafeValueBuffer, @inout NSObject, @thick NSObject.Type) -> () {
// CHECK: class_method [volatile] %4 : $NSObject, #NSObject.valence!setter.1.foreign
// CHECK: }
-// CHECK-LABEL: sil hidden @_T0So8NSObjectC14objc_witnessesE7valenceSifm : $@convention(method) (Builtin.RawPointer, @inout Builtin.UnsafeValueBuffer, @guaranteed NSObject) -> (Builtin.RawPointer, Optional<Builtin.RawPointer>) {
+// CHECK-LABEL: sil hidden @_T0So8NSObjectC14objc_witnessesE7valenceSivm : $@convention(method) (Builtin.RawPointer, @inout Builtin.UnsafeValueBuffer, @guaranteed NSObject) -> (Builtin.RawPointer, Optional<Builtin.RawPointer>) {
// CHECK: class_method [volatile] %2 : $NSObject, #NSObject.valence!getter.1.foreign
// CHECK: }
diff --git a/test/SILGen/opaque_values_silgen.swift b/test/SILGen/opaque_values_silgen.swift
index 9e4d726..088236a 100644
--- a/test/SILGen/opaque_values_silgen.swift
+++ b/test/SILGen/opaque_values_silgen.swift
@@ -90,15 +90,19 @@
// ---
// CHECK-LABEL: sil private @_T020opaque_values_silgen16OpaqueTupleClassC8inAndOutx_xtx_xt1x_tFAA0dF0CADxxAE_tFTV : $@convention(method) <U> (@in (U, U), @guaranteed OpaqueTupleClass<U>) -> @out (U, U) {
// CHECK: bb0([[ARG0:%.*]] : $(U, U), [[ARG1:%.*]] : $OpaqueTupleClass<U>):
-// CHECK: [[TELEM0:%.*]] = tuple_extract [[ARG0]] : $(U, U), 0
-// CHECK: [[TELEM1:%.*]] = tuple_extract [[ARG0]] : $(U, U), 1
-// CHECK: [[APPLY:%.*]] = apply {{.*}}<U>([[TELEM0]], [[TELEM1]], [[ARG1]]) : $@convention(method) <τ_0_0> (@in τ_0_0, @in τ_0_0, @guaranteed OpaqueTupleClass<τ_0_0>) -> (@out τ_0_0, @out τ_0_0)
-// CHECK: [[BORROWED_T:%.*]] = begin_borrow [[APPLY]]
-// CHECK: [[BORROWED_T_EXT0:%.*]] = tuple_extract [[BORROWED_T]] : $(U, U), 0
-// CHECK: [[RETVAL0:%.*]] = copy_value [[BORROWED_T_EXT0]] : $U
-// CHECK: [[BORROWED_T_EXT1:%.*]] = tuple_extract [[BORROWED_T]] : $(U, U), 1
-// CHECK: [[RETVAL1:%.*]] = copy_value [[BORROWED_T_EXT1]] : $U
-// CHECK: end_borrow [[BORROWED_T]]
+// CHECK: [[BORROWED_ARG0:%.*]] = begin_borrow [[ARG0]] : $(U, U)
+// CHECK: [[TELEM0:%.*]] = tuple_extract [[BORROWED_ARG0]] : $(U, U), 0
+// CHECK: [[COPY0:%.*]] = copy_value [[TELEM0]] : $U
+// CHECK: [[TELEM1:%.*]] = tuple_extract [[BORROWED_ARG0]] : $(U, U), 1
+// CHECK: [[COPY1:%.*]] = copy_value [[TELEM1]] : $U
+// CHECK: end_borrow [[BORROWED_ARG0]]
+// CHECK: [[APPLY:%.*]] = apply {{.*}}<U>([[COPY0]], [[COPY1]], [[ARG1]]) : $@convention(method) <τ_0_0> (@in τ_0_0, @in τ_0_0, @guaranteed OpaqueTupleClass<τ_0_0>) -> (@out τ_0_0, @out τ_0_0)
+// CHECK: [[BORROWED_CALL:%.*]] = begin_borrow [[APPLY]]
+// CHECK: [[BORROWED_CALL_EXT0:%.*]] = tuple_extract [[BORROWED_CALL]] : $(U, U), 0
+// CHECK: [[RETVAL0:%.*]] = copy_value [[BORROWED_CALL_EXT0]] : $U
+// CHECK: [[BORROWED_CALL_EXT1:%.*]] = tuple_extract [[BORROWED_CALL]] : $(U, U), 1
+// CHECK: [[RETVAL1:%.*]] = copy_value [[BORROWED_CALL_EXT1]] : $U
+// CHECK: end_borrow [[BORROWED_CALL]]
// CHECK: [[RETVAL:%.*]] = tuple ([[RETVAL0]] : $U, [[RETVAL1]] : $U)
// CHECK: return [[RETVAL]]
// CHECK-LABEL: } // end sil function '_T020opaque_values_silgen16OpaqueTupleClassC8inAndOutx_xtx_xt1x_tFAA0dF0CADxxAE_tFTV'
@@ -865,7 +869,7 @@
// ---
// CHECK-LABEL: sil hidden @_T020opaque_values_silgen21s410__globalRvalueGetS2iF : $@convention(thin) (Int) -> Int {
// CHECK: bb0([[ARG:%.*]] : $Int):
-// CHECK: [[GLOBAL_ADDR:%.*]] = global_addr @_T020opaque_values_silgen16subscriptableGetAA013SubscriptableE0_pv : $*SubscriptableGet
+// CHECK: [[GLOBAL_ADDR:%.*]] = global_addr @_T020opaque_values_silgen16subscriptableGetAA013SubscriptableE0_pvp : $*SubscriptableGet
// CHECK: [[READ:%.*]] = begin_access [read] [dynamic] [[GLOBAL_ADDR]] : $*SubscriptableGet
// CHECK: [[OPEN_ARG:%.*]] = open_existential_addr immutable_access [[READ]] : $*SubscriptableGet to $*@opened
// CHECK: [[GET_OPAQUE:%.*]] = load [copy] [[OPEN_ARG]] : $*@opened
@@ -881,7 +885,7 @@
// ---
// CHECK-LABEL: sil hidden @_T020opaque_values_silgen21s420__globalLvalueGetS2iF : $@convention(thin) (Int) -> Int {
// CHECK: bb0([[ARG:%.*]] : $Int):
-// CHECK: [[GLOBAL_ADDR:%.*]] = global_addr @_T020opaque_values_silgen19subscriptableGetSetAA013SubscriptableeF0_pv : $*SubscriptableGetSet
+// CHECK: [[GLOBAL_ADDR:%.*]] = global_addr @_T020opaque_values_silgen19subscriptableGetSetAA013SubscriptableeF0_pvp : $*SubscriptableGetSet
// CHECK: [[READ:%.*]] = begin_access [read] [dynamic] [[GLOBAL_ADDR]] : $*SubscriptableGetSet
// CHECK: [[OPEN_ARG:%.*]] = open_existential_addr immutable_access [[READ]] : $*SubscriptableGetSet to $*@opened
// CHECK: [[GET_OPAQUE:%.*]] = load [copy] [[OPEN_ARG]] : $*@opened
@@ -900,12 +904,19 @@
// CHECK: [[APPLY_T:%.*]] = apply %{{.*}}<((T) -> (), T)>() : $@convention(thin) <τ_0_0> () -> @out Optional<(Int, τ_0_0)>
// CHECK: switch_enum [[APPLY_T]] : $Optional<(Int, (@callee_owned (@in T) -> @out (), T))>, case #Optional.some!enumelt.1: bb2, case #Optional.none!enumelt: bb1
// CHECK: bb2([[ENUMARG:%.*]] : $(Int, (@callee_owned (@in T) -> @out (), T))):
-// CHECK: [[TELEM0:%.*]] = tuple_extract [[ENUMARG]] : $(Int, (@callee_owned (@in T) -> @out (), T)), 0
-// CHECK: [[TELEM1:%.*]] = tuple_extract [[ENUMARG]] : $(Int, (@callee_owned (@in T) -> @out (), T)), 1
-// CHECK: [[TELEM1P0:%.*]] = tuple_extract [[TELEM1]] : $(@callee_owned (@in T) -> @out (), T), 0
-// CHECK: [[TELEM1P1:%.*]] = tuple_extract [[TELEM1]] : $(@callee_owned (@in T) -> @out (), T), 1
-// CHECK: [[PAPPLY:%.*]] = partial_apply %{{.*}}<T>([[TELEM1P0]]) : $@convention(thin) <τ_0_0> (@in τ_0_0, @owned @callee_owned (@in τ_0_0) -> @out ()) -> ()
-// CHECK: [[NEWT0:%.*]] = tuple ([[PAPPLY]] : $@callee_owned (@in T) -> (), [[TELEM1P1]] : $T)
+// CHECK: [[BORROWED_ENUMARG:%.*]] = begin_borrow [[ENUMARG]] : $(Int, (@callee_owned (@in T) -> @out (), T))
+// CHECK: [[TELEM0:%.*]] = tuple_extract [[BORROWED_ENUMARG]] : $(Int, (@callee_owned (@in T) -> @out (), T)), 0
+// CHECK: [[TELEM1:%.*]] = tuple_extract [[BORROWED_ENUMARG]] : $(Int, (@callee_owned (@in T) -> @out (), T)), 1
+// CHECK: [[COPY1:%.*]] = copy_value [[TELEM1]] : $(@callee_owned (@in T) -> @out (), T)
+// CHECK: end_borrow [[BORROWED_ENUMARG]]
+// CHECK: [[BORROWED_COPY1:%.*]] = begin_borrow [[COPY1]] : $(@callee_owned (@in T) -> @out (), T)
+// CHECK: [[TELEM1P0:%.*]] = tuple_extract [[BORROWED_COPY1]] : $(@callee_owned (@in T) -> @out (), T), 0
+// CHECK: [[COPY1P0:%.*]] = copy_value [[TELEM1P0]] : $@callee_owned (@in T) -> @out ()
+// CHECK: [[TELEM1P1:%.*]] = tuple_extract [[BORROWED_COPY1]] : $(@callee_owned (@in T) -> @out (), T), 1
+// CHECK: [[COPY1P1:%.*]] = copy_value [[TELEM1P1]] : $T
+// CHECK: end_borrow [[BORROWED_COPY1]]
+// CHECK: [[PAPPLY:%.*]] = partial_apply %{{.*}}<T>([[COPY1P0]]) : $@convention(thin) <τ_0_0> (@in τ_0_0, @owned @callee_owned (@in τ_0_0) -> @out ()) -> ()
+// CHECK: [[NEWT0:%.*]] = tuple ([[PAPPLY]] : $@callee_owned (@in T) -> (), [[COPY1P1]] : $T)
// CHECK: [[NEWT1:%.*]] = tuple ([[TELEM0]] : $Int, [[NEWT0]] : $(@callee_owned (@in T) -> (), T))
// CHECK: [[NEWENUM:%.*]] = enum $Optional<(Int, (@callee_owned (@in T) -> (), T))>, #Optional.some!enumelt.1, [[NEWT1]] : $(Int, (@callee_owned (@in T) -> (), T))
// CHECK: br bb3([[NEWENUM]] : $Optional<(Int, (@callee_owned (@in T) -> (), T))>)
@@ -959,7 +970,7 @@
// Test SILGenBuilder.loadCopy().
// ---
// CHECK-LABEL: sil hidden @_T020opaque_values_silgen21s450__________lastValxSayxGd_tlF : $@convention(thin) <T> (@owned Array<T>) -> @out T
-// CHECK: [[LOAD:%.*]] = load [copy] %34 : $*T
+// CHECK: [[LOAD:%.*]] = load [copy] %{{.*}} : $*T
// CHECK: return [[LOAD]] : $T
// CHECK-LABEL: } // end sil function '_T020opaque_values_silgen21s450__________lastValxSayxGd_tlF'
func s450__________lastVal<T>(_ rest: T...) -> T {
@@ -1236,7 +1247,7 @@
// Tests materializeForSet's createSetterCallback for opaque values
// ---
-// CHECK-LABEL: sil shared [transparent] [serialized] @_T0s10DictionaryV20opaque_values_silgenE9subscriptq_Sgq_cfmytfU_ : $@convention(method) <Key, Value where Key : Hashable> (Builtin.RawPointer, @inout Builtin.UnsafeValueBuffer, @inout Dictionary<Key, Value>, @thick Dictionary<Key, Value>.Type) -> () {
+// CHECK-LABEL: sil shared [transparent] [serialized] @_T0s10DictionaryV20opaque_values_silgenEq_Sgq_cimytfU_ : $@convention(method) <Key, Value where Key : Hashable> (Builtin.RawPointer, @inout Builtin.UnsafeValueBuffer, @inout Dictionary<Key, Value>, @thick Dictionary<Key, Value>.Type) -> () {
// CHECK: bb0([[ARG0:%.*]] : $Builtin.RawPointer, [[ARG1:%.*]] : $*Builtin.UnsafeValueBuffer, [[ARG2:%.*]] : $*Dictionary<Key, Value>, [[ARG3:%.*]] : $@thick Dictionary<Key, Value>.Type):
// CHECK: [[PROJ_VAL1:%.*]] = project_value_buffer $Value in [[ARG1]] : $*Builtin.UnsafeValueBuffer
// CHECK: [[LOAD_VAL1:%.*]] = load [take] [[PROJ_VAL1]] : $*Value
@@ -1244,7 +1255,7 @@
// CHECK: [[LOAD_VAL0:%.*]] = load [take] [[ADDR_VAL0]] : $*Optional<Value>
// CHECK: apply {{.*}}<Key, Value>([[LOAD_VAL0]], [[LOAD_VAL1]], [[ARG2]]) : $@convention(method) <τ_0_0, τ_0_1 where τ_0_0 : Hashable> (@in Optional<τ_0_1>, @in τ_0_1, @inout Dictionary<τ_0_0, τ_0_1>) -> ()
// CHECK: return %{{.*}} : $()
-// CHECK-LABEL: } // end sil function '_T0s10DictionaryV20opaque_values_silgenE9subscriptq_Sgq_cfmytfU_'
+// CHECK-LABEL: } // end sil function '_T0s10DictionaryV20opaque_values_silgenEq_Sgq_cimytfU_'
extension Dictionary {
public subscript(key: Value) -> Value? {
@inline(__always)
diff --git a/test/SILGen/optional_lvalue.swift b/test/SILGen/optional_lvalue.swift
index 0d90a95..9c8b2d5 100644
--- a/test/SILGen/optional_lvalue.swift
+++ b/test/SILGen/optional_lvalue.swift
@@ -51,8 +51,8 @@
}
// CHECK-LABEL: sil hidden @_T015optional_lvalue07assign_a1_B9_computedSiAA1SVSgz_SitF
-// CHECK: function_ref @_T015optional_lvalue1SV8computedSifs
-// CHECK: function_ref @_T015optional_lvalue1SV8computedSifg
+// CHECK: function_ref @_T015optional_lvalue1SV8computedSivs
+// CHECK: function_ref @_T015optional_lvalue1SV8computedSivg
func assign_optional_lvalue_computed(_ x: inout S?, _ y: Int) -> Int {
x!.computed = y
return x!.computed
diff --git a/test/SILGen/optional_to_bool.swift b/test/SILGen/optional_to_bool.swift
index 9235259..c89e115 100644
--- a/test/SILGen/optional_to_bool.swift
+++ b/test/SILGen/optional_to_bool.swift
@@ -5,10 +5,10 @@
public class A {}
public class B: A {
- // CHECK-LABEL: sil @_T016optional_to_bool1BC1x{{[_0-9a-zA-Z]*}}fg
+ // CHECK-LABEL: sil @_T016optional_to_bool1BC1x{{[_0-9a-zA-Z]*}}vg
// CHECK: select_enum {{%.*}} : $Optional<Int>
public lazy var x: Int = 0
- // CHECK-LABEL: sil @_T016optional_to_bool1BC1y{{[_0-9a-zA-Z]*}}fg
+ // CHECK-LABEL: sil @_T016optional_to_bool1BC1y{{[_0-9a-zA-Z]*}}vg
// CHECK: select_enum_addr {{%.*}} : $*Optional<P>
public lazy var y: P = 0
}
diff --git a/test/SILGen/pointer_conversion.swift b/test/SILGen/pointer_conversion.swift
index eade0c2..e8ab640 100644
--- a/test/SILGen/pointer_conversion.swift
+++ b/test/SILGen/pointer_conversion.swift
@@ -188,12 +188,12 @@
}
takesMutablePointer(&logicalInt)
// CHECK: [[TAKES_MUTABLE:%.*]] = function_ref @_T018pointer_conversion19takesMutablePointer{{[_0-9a-zA-Z]*}}F
- // CHECK: [[GETTER:%.*]] = function_ref @_T018pointer_conversion14inoutToPointeryyF10logicalIntL_Sifg
+ // CHECK: [[GETTER:%.*]] = function_ref @_T018pointer_conversion14inoutToPointeryyF10logicalIntL_Sivg
// CHECK: apply [[GETTER]]
// CHECK: [[CONVERT:%.*]] = function_ref @_T0s30_convertInOutToPointerArgument{{[_0-9a-zA-Z]*}}F
// CHECK: apply [[CONVERT]]<UnsafeMutablePointer<Int>>
// CHECK: apply [[TAKES_MUTABLE]]
- // CHECK: [[SETTER:%.*]] = function_ref @_T018pointer_conversion14inoutToPointeryyF10logicalIntL_Sifs
+ // CHECK: [[SETTER:%.*]] = function_ref @_T018pointer_conversion14inoutToPointeryyF10logicalIntL_Sivs
// CHECK: apply [[SETTER]]
takesMutableRawPointer(&int)
@@ -206,12 +206,12 @@
takesMutableRawPointer(&logicalInt)
// CHECK: [[TAKES_MUTABLE:%.*]] = function_ref @_T018pointer_conversion22takesMutableRawPointer{{[_0-9a-zA-Z]*}}F
- // CHECK: [[GETTER:%.*]] = function_ref @_T018pointer_conversion14inoutToPointeryyF10logicalIntL_Sifg
+ // CHECK: [[GETTER:%.*]] = function_ref @_T018pointer_conversion14inoutToPointeryyF10logicalIntL_Sivg
// CHECK: apply [[GETTER]]
// CHECK: [[CONVERT:%.*]] = function_ref @_T0s30_convertInOutToPointerArgument{{[_0-9a-zA-Z]*}}F
// CHECK: apply [[CONVERT]]<UnsafeMutableRawPointer>
// CHECK: apply [[TAKES_MUTABLE]]
- // CHECK: [[SETTER:%.*]] = function_ref @_T018pointer_conversion14inoutToPointeryyF10logicalIntL_Sifs
+ // CHECK: [[SETTER:%.*]] = function_ref @_T018pointer_conversion14inoutToPointeryyF10logicalIntL_Sivs
// CHECK: apply [[SETTER]]
}
diff --git a/test/SILGen/properties.swift b/test/SILGen/properties.swift
index 594c723..a215b6a 100644
--- a/test/SILGen/properties.swift
+++ b/test/SILGen/properties.swift
@@ -171,7 +171,7 @@
return struct_rvalue().z
// CHECK: [[GET_RVAL:%[0-9]+]] = function_ref @_T010properties13struct_rvalue{{[_0-9a-zA-Z]*}}F
// CHECK: [[STRUCT:%[0-9]+]] = apply [[GET_RVAL]]()
- // CHECK: [[GET_METHOD:%[0-9]+]] = function_ref @_T010properties3ValV1z{{[_0-9a-zA-Z]*}}fg
+ // CHECK: [[GET_METHOD:%[0-9]+]] = function_ref @_T010properties3ValV1z{{[_0-9a-zA-Z]*}}vg
// CHECK: [[VALUE:%[0-9]+]] = apply [[GET_METHOD]]([[STRUCT]])
// CHECK: return [[VALUE]]
}
@@ -180,7 +180,7 @@
func logical_struct_set(_ value: inout Val, z: Int) {
// CHECK: bb0([[VAL:%[0-9]+]] : $*Val, [[Z:%[0-9]+]] : $Int):
value.z = z
- // CHECK: [[Z_SET_METHOD:%[0-9]+]] = function_ref @_T010properties3ValV1z{{[_0-9a-zA-Z]*}}fs
+ // CHECK: [[Z_SET_METHOD:%[0-9]+]] = function_ref @_T010properties3ValV1z{{[_0-9a-zA-Z]*}}vs
// CHECK: [[WRITE:%.*]] = begin_access [modify] [unknown] [[VAL]]
// CHECK: apply [[Z_SET_METHOD]]([[Z]], [[WRITE]])
// CHECK: return
@@ -190,7 +190,7 @@
func logical_struct_in_tuple_set(_ value: inout (Int, Val), z: Int) {
// CHECK: bb0([[VAL:%[0-9]+]] : $*(Int, Val), [[Z:%[0-9]+]] : $Int):
value.1.z = z
- // CHECK: [[Z_SET_METHOD:%[0-9]+]] = function_ref @_T010properties3ValV1z{{[_0-9a-zA-Z]*}}fs
+ // CHECK: [[Z_SET_METHOD:%[0-9]+]] = function_ref @_T010properties3ValV1z{{[_0-9a-zA-Z]*}}vs
// CHECK: [[WRITE:%.*]] = begin_access [modify] [unknown] [[VAL]]
// CHECK: [[VAL_1:%[0-9]+]] = tuple_element_addr [[WRITE]] : {{.*}}, 1
// CHECK: apply [[Z_SET_METHOD]]([[Z]], [[VAL_1]])
@@ -221,7 +221,7 @@
// -- val.ref.val_prop.z_tuple
// CHECK: [[V_R_VP_Z_TUPLE_MAT:%[0-9]+]] = alloc_stack $(Int, Int)
// CHECK: [[LD:%[0-9]+]] = load_borrow [[VAL_REF_VAL_PROP_MAT]]
- // CHECK: [[GET_Z_TUPLE_METHOD:%[0-9]+]] = function_ref @_T010properties3ValV7z_tupleSi_Sitfg
+ // CHECK: [[GET_Z_TUPLE_METHOD:%[0-9]+]] = function_ref @_T010properties3ValV7z_tupleSi_Sitvg
// CHECK: [[A0:%.*]] = tuple_element_addr [[V_R_VP_Z_TUPLE_MAT]] : {{.*}}, 0
// CHECK: [[A1:%.*]] = tuple_element_addr [[V_R_VP_Z_TUPLE_MAT]] : {{.*}}, 1
// CHECK: [[V_R_VP_Z_TUPLE:%[0-9]+]] = apply [[GET_Z_TUPLE_METHOD]]([[LD]])
@@ -235,7 +235,7 @@
// CHECK: assign [[Z1]] to [[V_R_VP_Z_TUPLE_1]]
// -- writeback to val.ref.val_prop.z_tuple
// CHECK: [[WB_V_R_VP_Z_TUPLE:%[0-9]+]] = load [trivial] [[V_R_VP_Z_TUPLE_MAT]]
- // CHECK: [[SET_Z_TUPLE_METHOD:%[0-9]+]] = function_ref @_T010properties3ValV7z_tupleSi_Sitfs
+ // CHECK: [[SET_Z_TUPLE_METHOD:%[0-9]+]] = function_ref @_T010properties3ValV7z_tupleSi_Sitvs
// CHECK: apply [[SET_Z_TUPLE_METHOD]]({{%[0-9]+, %[0-9]+}}, [[VAL_REF_VAL_PROP_MAT]])
// -- writeback to val.ref.val_prop
// CHECK: switch_enum [[OPT_CALLBACK]] : $Optional<Builtin.RawPointer>, case #Optional.some!enumelt.1: [[WRITEBACK:bb[0-9]+]], case #Optional.none!enumelt: [[CONT:bb[0-9]+]]
@@ -268,7 +268,7 @@
// CHECK: [[WRITE:%.*]] = begin_access [modify] [unknown] [[VAL]]
// CHECK: [[Z_TUPLE_MATERIALIZED:%[0-9]+]] = alloc_stack $(Int, Int)
// CHECK: [[VAL1:%[0-9]+]] = load_borrow [[WRITE]]
- // CHECK: [[Z_GET_METHOD:%[0-9]+]] = function_ref @_T010properties3ValV7z_tupleSi_Sitfg
+ // CHECK: [[Z_GET_METHOD:%[0-9]+]] = function_ref @_T010properties3ValV7z_tupleSi_Sitvg
// CHECK: [[A0:%.*]] = tuple_element_addr [[Z_TUPLE_MATERIALIZED]] : {{.*}}, 0
// CHECK: [[A1:%.*]] = tuple_element_addr [[Z_TUPLE_MATERIALIZED]] : {{.*}}, 1
// CHECK: [[Z_TUPLE:%[0-9]+]] = apply [[Z_GET_METHOD]]([[VAL1]])
@@ -280,18 +280,18 @@
// CHECK: [[Z_TUPLE_1:%[0-9]+]] = tuple_element_addr [[Z_TUPLE_MATERIALIZED]] : {{.*}}, 1
// CHECK: assign [[Z1]] to [[Z_TUPLE_1]]
// CHECK: [[Z_TUPLE_MODIFIED:%[0-9]+]] = load [trivial] [[Z_TUPLE_MATERIALIZED]]
- // CHECK: [[Z_SET_METHOD:%[0-9]+]] = function_ref @_T010properties3ValV7z_tupleSi_Sitfs
+ // CHECK: [[Z_SET_METHOD:%[0-9]+]] = function_ref @_T010properties3ValV7z_tupleSi_Sitvs
// CHECK: apply [[Z_SET_METHOD]]({{%[0-9]+, %[0-9]+}}, [[WRITE]])
// CHECK: dealloc_stack [[Z_TUPLE_MATERIALIZED]]
// CHECK: return
}
var global_prop : Int {
- // CHECK-LABEL: sil hidden @_T010properties11global_prop{{[_0-9a-zA-Z]*}}fg
+ // CHECK-LABEL: sil hidden @_T010properties11global_prop{{[_0-9a-zA-Z]*}}vg
get {
return zero
}
- // CHECK-LABEL: sil hidden @_T010properties11global_prop{{[_0-9a-zA-Z]*}}fs
+ // CHECK-LABEL: sil hidden @_T010properties11global_prop{{[_0-9a-zA-Z]*}}vs
set {
use(newValue)
}
@@ -300,7 +300,7 @@
// CHECK-LABEL: sil hidden @_T010properties18logical_global_get{{[_0-9a-zA-Z]*}}F
func logical_global_get() -> Int {
return global_prop
- // CHECK: [[GET:%[0-9]+]] = function_ref @_T010properties11global_prop{{[_0-9a-zA-Z]*}}fg
+ // CHECK: [[GET:%[0-9]+]] = function_ref @_T010properties11global_prop{{[_0-9a-zA-Z]*}}vg
// CHECK: [[VALUE:%[0-9]+]] = apply [[GET]]()
// CHECK: return [[VALUE]]
}
@@ -308,7 +308,7 @@
// CHECK-LABEL: sil hidden @_T010properties18logical_global_set{{[_0-9a-zA-Z]*}}F
func logical_global_set(_ x: Int) {
global_prop = x
- // CHECK: [[SET:%[0-9]+]] = function_ref @_T010properties11global_prop{{[_0-9a-zA-Z]*}}fs
+ // CHECK: [[SET:%[0-9]+]] = function_ref @_T010properties11global_prop{{[_0-9a-zA-Z]*}}vs
// CHECK: apply [[SET]](%0)
}
@@ -319,7 +319,7 @@
return x
}
}
- // CHECK: [[GET_REF:%[0-9]+]] = function_ref [[PROP_GET_CLOSURE:@_T010properties17logical_local_getS2iF4propL_Sifg]]
+ // CHECK: [[GET_REF:%[0-9]+]] = function_ref [[PROP_GET_CLOSURE:@_T010properties17logical_local_getS2iF4propL_Sivg]]
// CHECK: apply [[GET_REF]](%0)
return prop
}
@@ -360,7 +360,7 @@
// CHECK: [[FUNC_REF:%[0-9]+]] = function_ref @_T010properties26logical_local_captured_getS2iF0E5_propL_SiyF
// CHECK: apply [[FUNC_REF]](%0)
}
-// CHECK: sil private @_T010properties26logical_local_captured_get{{.*}}fg
+// CHECK: sil private @_T010properties26logical_local_captured_get{{.*}}vg
// CHECK: bb0(%{{[0-9]+}} : $Int):
func inout_arg(_ x: inout Int) {}
@@ -385,7 +385,7 @@
func val_subscript_get(_ v: Val, i: Int) -> Float {
return v[i]
// CHECK: [[BORROWED_VVAL:%.*]] = begin_borrow [[VVAL]]
- // CHECK: [[SUBSCRIPT_GET_METHOD:%[0-9]+]] = function_ref @_T010properties3ValV9subscript{{[_0-9a-zA-Z]*}}fg
+ // CHECK: [[SUBSCRIPT_GET_METHOD:%[0-9]+]] = function_ref @_T010properties3ValV{{[_0-9a-zA-Z]*}}ig
// CHECK: [[RET:%[0-9]+]] = apply [[SUBSCRIPT_GET_METHOD]]([[I]], [[BORROWED_VVAL]]) : $@convention(method) (Int, @guaranteed Val)
// CHECK: end_borrow [[BORROWED_VVAL]] from [[VVAL]]
// CHECK: destroy_value [[VVAL]]
@@ -399,7 +399,7 @@
v[i] = x
// CHECK: [[VADDR:%[0-9]+]] = alloc_box ${ var Val }
// CHECK: [[PB:%.*]] = project_box [[VADDR]]
- // CHECK: [[SUBSCRIPT_SET_METHOD:%[0-9]+]] = function_ref @_T010properties3ValV9subscript{{[_0-9a-zA-Z]*}}fs
+ // CHECK: [[SUBSCRIPT_SET_METHOD:%[0-9]+]] = function_ref @_T010properties3ValV{{[_0-9a-zA-Z]*}}is
// CHECK: [[WRITE:%.*]] = begin_access [modify] [unknown] [[PB]]
// CHECK: apply [[SUBSCRIPT_SET_METHOD]]([[X]], [[I]], [[WRITE]])
}
@@ -429,7 +429,7 @@
// CHECK-LABEL: sil hidden @_T010properties20generic_mono_log_get{{[_0-9a-zA-Z]*}}F
func generic_mono_log_get<T>(_ g: Generic<T>) -> Int {
return g.mono_log
- // CHECK: [[GENERIC_GET_METHOD:%[0-9]+]] = function_ref @_T010properties7GenericV8mono_log{{[_0-9a-zA-Z]*}}fg
+ // CHECK: [[GENERIC_GET_METHOD:%[0-9]+]] = function_ref @_T010properties7GenericV8mono_log{{[_0-9a-zA-Z]*}}vg
// CHECK: apply [[GENERIC_GET_METHOD]]<
}
@@ -437,21 +437,21 @@
func generic_mono_log_set<T>(_ g: Generic<T>, x: Int) {
var g = g
g.mono_log = x
- // CHECK: [[GENERIC_SET_METHOD:%[0-9]+]] = function_ref @_T010properties7GenericV8mono_log{{[_0-9a-zA-Z]*}}fs
+ // CHECK: [[GENERIC_SET_METHOD:%[0-9]+]] = function_ref @_T010properties7GenericV8mono_log{{[_0-9a-zA-Z]*}}vs
// CHECK: apply [[GENERIC_SET_METHOD]]<
}
// CHECK-LABEL: sil hidden @_T010properties26generic_mono_subscript_get{{[_0-9a-zA-Z]*}}F
func generic_mono_subscript_get<T>(_ g: Generic<T>, i: Int) -> Float {
return g[i]
- // CHECK: [[GENERIC_GET_METHOD:%[0-9]+]] = function_ref @_T010properties7GenericV9subscript{{[_0-9a-zA-Z]*}}fg
+ // CHECK: [[GENERIC_GET_METHOD:%[0-9]+]] = function_ref @_T010properties7GenericV{{[_0-9a-zA-Z]*}}ig
// CHECK: apply [[GENERIC_GET_METHOD]]<
}
// CHECK-LABEL: sil hidden @{{.*}}generic_mono_subscript_set
func generic_mono_subscript_set<T>(_ g: inout Generic<T>, i: Int, x: Float) {
g[i] = x
- // CHECK: [[GENERIC_SET_METHOD:%[0-9]+]] = function_ref @_T010properties7GenericV9subscript{{[_0-9a-zA-Z]*}}fs
+ // CHECK: [[GENERIC_SET_METHOD:%[0-9]+]] = function_ref @_T010properties7GenericV{{[_0-9a-zA-Z]*}}is
// CHECK: apply [[GENERIC_SET_METHOD]]<
}
@@ -464,7 +464,7 @@
// CHECK-LABEL: sil hidden @_T010properties26bound_generic_mono_log_get{{[_0-9a-zA-Z]*}}F
func bound_generic_mono_log_get(_ g: Generic<UnicodeScalar>, x: Int) -> Int {
return g.mono_log
-// CHECK: [[GENERIC_GET_METHOD:%[0-9]+]] = function_ref @_T010properties7GenericV8mono_log{{[_0-9a-zA-Z]*}}fg
+// CHECK: [[GENERIC_GET_METHOD:%[0-9]+]] = function_ref @_T010properties7GenericV8mono_log{{[_0-9a-zA-Z]*}}vg
// CHECK: apply [[GENERIC_GET_METHOD]]<
}
@@ -487,13 +487,13 @@
}
// CHECK-LABEL: sil hidden @_T010properties10static_get{{[_0-9a-zA-Z]*}}F
-// CHECK: function_ref @_T010properties14StaticPropertyV3foo{{[_0-9a-zA-Z]*}}fgZ : $@convention(method) (@thin StaticProperty.Type) -> Int
+// CHECK: function_ref @_T010properties14StaticPropertyV3foo{{[_0-9a-zA-Z]*}}vgZ : $@convention(method) (@thin StaticProperty.Type) -> Int
func static_get() -> Int {
return StaticProperty.foo
}
// CHECK-LABEL: sil hidden @_T010properties10static_set{{[_0-9a-zA-Z]*}}F
-// CHECK: function_ref @_T010properties14StaticPropertyV3foo{{[_0-9a-zA-Z]*}}fsZ : $@convention(method) (Int, @thin StaticProperty.Type) -> ()
+// CHECK: function_ref @_T010properties14StaticPropertyV3foo{{[_0-9a-zA-Z]*}}vsZ : $@convention(method) (Int, @thin StaticProperty.Type) -> ()
func static_set(_ x: Int) {
StaticProperty.foo = x
}
@@ -508,7 +508,7 @@
var a: Int {
willSet(newA) {
// CHECK-LABEL: // {{.*}}.DidSetWillSetTests.a.willset
- // CHECK-NEXT: sil hidden @_T010properties010DidSetWillC5TestsV1a{{[_0-9a-zA-Z]*}}fw
+ // CHECK-NEXT: sil hidden @_T010properties010DidSetWillC5TestsV1a{{[_0-9a-zA-Z]*}}vw
// CHECK: bb0(%0 : $Int, %1 : $*DidSetWillSetTests):
// CHECK-NEXT: debug_value %0
// CHECK-NEXT: debug_value_addr %1 : $*DidSetWillSetTests
@@ -532,7 +532,7 @@
didSet {
// CHECK-LABEL: // {{.*}}.DidSetWillSetTests.a.didset
- // CHECK-NEXT: sil hidden @_T010properties010DidSetWillC5TestsV1a{{[_0-9a-zA-Z]*}}fW
+ // CHECK-NEXT: sil hidden @_T010properties010DidSetWillC5TestsV1a{{[_0-9a-zA-Z]*}}vW
// CHECK: bb0(%0 : $Int, %1 : $*DidSetWillSetTests):
// CHECK-NEXT: debug
// CHECK-NEXT: debug_value_addr %1 : $*DidSetWillSetTests
@@ -550,7 +550,7 @@
a = zero // reassign, but don't infinite loop.
// CHECK-NEXT: // function_ref properties.zero.unsafeMutableAddressor : Swift.Int
- // CHECK-NEXT: [[ZEROFN:%.*]] = function_ref @_T010properties4zero{{[_0-9a-zA-Z]*}}fau
+ // CHECK-NEXT: [[ZEROFN:%.*]] = function_ref @_T010properties4zero{{[_0-9a-zA-Z]*}}vau
// CHECK-NEXT: [[ZERORAW:%.*]] = apply [[ZEROFN]]() : $@convention(thin) () -> Builtin.RawPointer
// CHECK-NEXT: [[ZEROADDR:%.*]] = pointer_to_address [[ZERORAW]] : $Builtin.RawPointer to [strict] $*Int
// CHECK-NEXT: [[READ:%.*]] = begin_access [read] [dynamic] [[ZEROADDR]] : $*Int
@@ -571,14 +571,14 @@
// These are the synthesized getter and setter for the willset/didset variable.
// CHECK-LABEL: // {{.*}}.DidSetWillSetTests.a.getter
- // CHECK-NEXT: sil hidden [transparent] @_T010properties010DidSetWillC5TestsV1aSifg
+ // CHECK-NEXT: sil hidden [transparent] @_T010properties010DidSetWillC5TestsV1aSivg
// CHECK: bb0(%0 : $DidSetWillSetTests):
// CHECK-NEXT: debug_value %0
// CHECK-NEXT: %2 = struct_extract %0 : $DidSetWillSetTests, #DidSetWillSetTests.a
// CHECK-NEXT: return %2 : $Int{{.*}} // id: %3
// CHECK-LABEL: // {{.*}}.DidSetWillSetTests.a.setter
- // CHECK-NEXT: sil hidden @_T010properties010DidSetWillC5TestsV1aSifs
+ // CHECK-NEXT: sil hidden @_T010properties010DidSetWillC5TestsV1aSivs
// CHECK: bb0(%0 : $Int, %1 : $*DidSetWillSetTests):
// CHECK-NEXT: debug_value %0
// CHECK-NEXT: debug_value_addr %1
@@ -590,7 +590,7 @@
// CHECK-NEXT: debug_value [[OLDVAL]] : $Int, let, name "tmp"
// CHECK-NEXT: // function_ref {{.*}}.DidSetWillSetTests.a.willset : Swift.Int
- // CHECK-NEXT: [[WILLSETFN:%.*]] = function_ref @_T010properties010DidSetWillC5TestsV1a{{[_0-9a-zA-Z]*}}fw
+ // CHECK-NEXT: [[WILLSETFN:%.*]] = function_ref @_T010properties010DidSetWillC5TestsV1a{{[_0-9a-zA-Z]*}}vw
// CHECK-NEXT: [[WRITE:%.*]] = begin_access [modify] [unknown] %1
// CHECK-NEXT: apply [[WILLSETFN]](%0, [[WRITE]]) : $@convention(method) (Int, @inout DidSetWillSetTests) -> ()
// CHECK-NEXT: end_access [[WRITE]]
@@ -599,7 +599,7 @@
// CHECK-NEXT: assign %0 to [[AADDR]] : $*Int
// CHECK-NEXT: end_access [[WRITE]]
// CHECK-NEXT: // function_ref {{.*}}.DidSetWillSetTests.a.didset : Swift.Int
- // CHECK-NEXT: [[DIDSETFN:%.*]] = function_ref @_T010properties010DidSetWillC5TestsV1a{{[_0-9a-zA-Z]*}}fW : $@convention(method) (Int, @inout DidSetWillSetTests) -> ()
+ // CHECK-NEXT: [[DIDSETFN:%.*]] = function_ref @_T010properties010DidSetWillC5TestsV1a{{[_0-9a-zA-Z]*}}vW : $@convention(method) (Int, @inout DidSetWillSetTests) -> ()
// CHECK-NEXT: [[WRITE:%.*]] = begin_access [modify] [unknown] %1
// CHECK-NEXT: apply [[DIDSETFN]]([[OLDVAL]], [[WRITE]]) : $@convention(method) (Int, @inout DidSetWillSetTests) -> ()
@@ -633,23 +633,23 @@
// CHECK-LABEL: sil private @globalinit_{{.*}}_func1 : $@convention(thin) () -> () {
// CHECK: bb0:
// CHECK-NEXT: alloc_global @_T010properties25global_observing_propertySiv
-// CHECK-NEXT: %1 = global_addr @_T010properties25global_observing_propertySiv : $*Int
+// CHECK-NEXT: %1 = global_addr @_T010properties25global_observing_propertySivp : $*Int
// CHECK: properties.zero.unsafeMutableAddressor
// CHECK: return
// The didSet implementation needs to call takeInt.
-// CHECK-LABEL: sil hidden @_T010properties25global_observing_property{{[_0-9a-zA-Z]*}}fW
+// CHECK-LABEL: sil hidden @_T010properties25global_observing_property{{[_0-9a-zA-Z]*}}vW
// CHECK: function_ref properties.takeInt
// CHECK-NEXT: function_ref @_T010properties7takeInt{{[_0-9a-zA-Z]*}}F
// The setter needs to call didSet implementation.
-// CHECK-LABEL: sil hidden @_T010properties25global_observing_property{{[_0-9a-zA-Z]*}}fs
+// CHECK-LABEL: sil hidden @_T010properties25global_observing_property{{[_0-9a-zA-Z]*}}vs
// CHECK: function_ref properties.global_observing_property.unsafeMutableAddressor
-// CHECK-NEXT: function_ref @_T010properties25global_observing_property{{[_0-9a-zA-Z]*}}fau
+// CHECK-NEXT: function_ref @_T010properties25global_observing_property{{[_0-9a-zA-Z]*}}vau
// CHECK: function_ref properties.global_observing_property.didset
-// CHECK-NEXT: function_ref @_T010properties25global_observing_property{{[_0-9a-zA-Z]*}}fW
+// CHECK-NEXT: function_ref @_T010properties25global_observing_property{{[_0-9a-zA-Z]*}}vW
// Test local observing properties.
@@ -756,7 +756,7 @@
}
// CHECK: // setter of p #1 : Swift.Int in properties.propertyWithDidSetTakingOldValue()
-// CHECK-NEXT: sil {{.*}} @_T010properties32propertyWithDidSetTakingOldValueyyF1pL_Sifs
+// CHECK-NEXT: sil {{.*}} @_T010properties32propertyWithDidSetTakingOldValueyyF1pL_Sivs
// CHECK: bb0([[ARG1:%.*]] : $Int, [[ARG2:%.*]] : ${ var Int }):
// CHECK-NEXT: debug_value [[ARG1]] : $Int, let, name "newValue", argno 1
// CHECK-NEXT: [[ARG2_PB:%.*]] = project_box [[ARG2]]
@@ -772,7 +772,7 @@
// SEMANTIC ARC TODO: Another case where we need to put the mark_function_escape on a new projection after a copy.
// CHECK-NEXT: mark_function_escape [[ARG2_PB]]
// CHECK-NEXT: // function_ref
-// CHECK-NEXT: [[FUNC:%.*]] = function_ref @_T010properties32propertyWithDidSetTakingOldValueyyF1pL_SifW : $@convention(thin) (Int, @owned { var Int }) -> ()
+// CHECK-NEXT: [[FUNC:%.*]] = function_ref @_T010properties32propertyWithDidSetTakingOldValueyyF1pL_SivW : $@convention(thin) (Int, @owned { var Int }) -> ()
// CHECK-NEXT: %{{.*}} = apply [[FUNC]]([[ARG2_PB_VAL]], [[ARG2_COPY]]) : $@convention(thin) (Int, @owned { var Int }) -> ()
// CHECK-NEXT: destroy_value [[ARG2]] : ${ var Int }
// CHECK-NEXT: %{{.*}} = tuple ()
@@ -798,7 +798,7 @@
// CHECK: bb0([[SELF:%.*]] : $DerivedProperty):
// CHECK: [[SELF_COPY:%[0-9]+]] = copy_value [[SELF]]
// CHECK: [[BASEPTR:%[0-9]+]] = upcast [[SELF_COPY]] : $DerivedProperty to $BaseProperty
-// CHECK: [[FN:%[0-9]+]] = function_ref @_T010properties12BasePropertyC1xSifg : $@convention(method) (@guaranteed BaseProperty) -> Int
+// CHECK: [[FN:%[0-9]+]] = function_ref @_T010properties12BasePropertyC1xSivg : $@convention(method) (@guaranteed BaseProperty) -> Int
// CHECK: [[RESULT:%.*]] = apply [[FN]]([[BASEPTR]]) : $@convention(method) (@guaranteed BaseProperty) -> Int
// CHECK: destroy_value [[BASEPTR]]
// CHECK: return [[RESULT]] : $Int
@@ -1084,11 +1084,11 @@
return x.prop
}
// CHECK-LABEL: sil hidden @_T010properties30addressOnlyNonmutatingProperty{{[_0-9a-zA-Z]*}}F
-// CHECK: [[SET:%.*]] = function_ref @_T010properties25AddressOnlyNonmutatingSetV4propSifs
+// CHECK: [[SET:%.*]] = function_ref @_T010properties25AddressOnlyNonmutatingSetV4propSivs
// CHECK: apply [[SET]]<T>({{%.*}}, [[TMP:%[0-9]*]])
// CHECK: destroy_addr [[TMP]]
// CHECK: dealloc_stack [[TMP]]
-// CHECK: [[GET:%.*]] = function_ref @_T010properties25AddressOnlyNonmutatingSetV4propSifg
+// CHECK: [[GET:%.*]] = function_ref @_T010properties25AddressOnlyNonmutatingSetV4propSivg
// CHECK: apply [[GET]]<T>([[TMP:%[0-9]*]])
// CHECK: destroy_addr [[TMP]]
// CHECK: dealloc_stack [[TMP]]
@@ -1103,7 +1103,7 @@
// CHECK-LABEL: sil hidden @_T010properties015addressOnlyReadC24SubscriptFromMutableBase
// CHECK: [[BASE:%.*]] = alloc_box ${ var AddressOnlyReadOnlySubscript }
// CHECK: copy_addr [[BASE:%.*]] to [initialization] [[COPY:%.*]] :
-// CHECK: [[GETTER:%.*]] = function_ref @_T010properties015AddressOnlyReadC9SubscriptV9subscript{{[_0-9a-zA-Z]*}}fg
+// CHECK: [[GETTER:%.*]] = function_ref @_T010properties015AddressOnlyReadC9SubscriptV{{[_0-9a-zA-Z]*}}ig
// CHECK: apply [[GETTER]]({{%.*}}, [[COPY]])
func addressOnlyReadOnlySubscriptFromMutableBase(_ x: Int) {
var base = AddressOnlyReadOnlySubscript()
@@ -1153,9 +1153,9 @@
}
}
-// CHECK-LABEL: sil hidden [transparent] @_T010properties29BaseClassWithInternalPropertyC1xytfg
+// CHECK-LABEL: sil hidden [transparent] @_T010properties29BaseClassWithInternalPropertyC1xytvg
-// CHECK-LABEL: sil [transparent] [serialized] @_T010properties30DerivedClassWithPublicPropertyC1xytfg
+// CHECK-LABEL: sil [transparent] [serialized] @_T010properties30DerivedClassWithPublicPropertyC1xytvg
// CHECK: bb0([[SELF:%.*]] : $DerivedClassWithPublicProperty):
// CHECK: [[SELF_COPY:%.*]] = copy_value [[SELF]] : $DerivedClassWithPublicProperty
// CHECK-NEXT: [[SUPER:%.*]] = upcast [[SELF_COPY]] : $DerivedClassWithPublicProperty to $BaseClassWithInternalProperty
@@ -1165,7 +1165,7 @@
// CHECK-NEXT: end_borrow [[BORROWED_SUPER]] from [[SUPER]]
// CHECK-NEXT: [[RESULT:%.*]] = apply [[METHOD]]([[SUPER]]) : $@convention(method) (@guaranteed BaseClassWithInternalProperty) -> ()
// CHECK-NEXT: destroy_value [[SUPER]] : $BaseClassWithInternalProperty
-// CHECK: } // end sil function '_T010properties30DerivedClassWithPublicPropertyC1xytfg'
+// CHECK: } // end sil function '_T010properties30DerivedClassWithPublicPropertyC1xytvg'
// Make sure that we can handle this AST:
// (load_expr
diff --git a/test/SILGen/property_behavior_init.swift b/test/SILGen/property_behavior_init.swift
index dc7616d..39b3d8b 100644
--- a/test/SILGen/property_behavior_init.swift
+++ b/test/SILGen/property_behavior_init.swift
@@ -43,7 +43,7 @@
// CHECK: [[READ:%.*]] = begin_access [read] [unknown] [[PB_BOX]]
// CHECK: [[SELF:%.*]] = load [trivial] [[READ]]
- // CHECK: [[GETTER:%.*]] = function_ref @_T022property_behavior_init3FooV1xSifg
+ // CHECK: [[GETTER:%.*]] = function_ref @_T022property_behavior_init3FooV1xSivg
// CHECK: apply [[GETTER]]([[SELF]])
_ = self.x
@@ -51,12 +51,12 @@
// CHECK: [[WRITE:%.*]] = begin_access [modify] [unknown] [[PB_BOX]]
// CHECK: [[INOUT:%.*]] = alloc_stack
// CHECK: [[SELF:%.*]] = load [trivial] [[WRITE]]
- // CHECK: [[GETTER:%.*]] = function_ref @_T022property_behavior_init3FooV1xSifg
+ // CHECK: [[GETTER:%.*]] = function_ref @_T022property_behavior_init3FooV1xSivg
// CHECK: [[VALUE:%.*]] = apply [[GETTER]]([[SELF]])
// CHECK: store [[VALUE]] to [trivial] [[INOUT]]
// CHECK: apply [[WHACK]]<Int>([[INOUT]])
// CHECK: [[VALUE:%.*]] = load [trivial] [[INOUT]]
- // CHECK: [[SETTER:%.*]] = function_ref @_T022property_behavior_init3FooV1xSifs
+ // CHECK: [[SETTER:%.*]] = function_ref @_T022property_behavior_init3FooV1xSivs
// CHECK: apply [[SETTER]]([[VALUE]], [[WRITE]])
whack(&self.x)
}
diff --git a/test/SILGen/protocol_class_refinement.swift b/test/SILGen/protocol_class_refinement.swift
index eb0c6d7..4de2ca2 100644
--- a/test/SILGen/protocol_class_refinement.swift
+++ b/test/SILGen/protocol_class_refinement.swift
@@ -45,7 +45,7 @@
// CHECK: apply [[SET_CLSID]]<T>([[UID]], [[WRITE]])
x.clsid = x.uid()
- // CHECK: [[SET_NEXTCLSID:%.*]] = function_ref @_T025protocol_class_refinement3UIDPAAE9nextCLSIDSifs
+ // CHECK: [[SET_NEXTCLSID:%.*]] = function_ref @_T025protocol_class_refinement3UIDPAAE9nextCLSIDSivs
// -- call x.uid()
// CHECK: [[GET_UID:%.*]] = witness_method $T, #UID.uid!1
// CHECK: [[READ:%.*]] = begin_access [read] [unknown] [[PB]] : $*T
@@ -63,7 +63,7 @@
// -- call x.uid()
// CHECK: [[READ1:%.*]] = begin_access [read] [unknown] [[PB]] : $*T
// CHECK: [[X1:%.*]] = load [copy] [[READ1]]
- // CHECK: [[SET_SECONDNEXT:%.*]] = function_ref @_T025protocol_class_refinement9ObjectUIDPAAE15secondNextCLSIDSifs
+ // CHECK: [[SET_SECONDNEXT:%.*]] = function_ref @_T025protocol_class_refinement9ObjectUIDPAAE15secondNextCLSIDSivs
// CHECK: [[BORROWED_X1:%.*]] = begin_borrow [[X1]]
// CHECK: [[GET_UID:%.*]] = witness_method $T, #UID.uid!1
// CHECK: [[READ:%.*]] = begin_access [read] [unknown] [[PB]] : $*T
@@ -104,7 +104,7 @@
// CHECK: apply [[SET_CLSID]]<T>([[UID]], [[WRITE]])
x.clsid = x.uid()
- // CHECK: [[SET_NEXTCLSID:%.*]] = function_ref @_T025protocol_class_refinement3UIDPAAE9nextCLSIDSifs
+ // CHECK: [[SET_NEXTCLSID:%.*]] = function_ref @_T025protocol_class_refinement3UIDPAAE9nextCLSIDSivs
// -- call x.uid()
// CHECK: [[GET_UID:%.*]] = witness_method $T, #UID.uid!1
// CHECK: [[READ:%.*]] = begin_access [read] [unknown] [[PB]] : $*T
diff --git a/test/SILGen/protocol_extensions.swift b/test/SILGen/protocol_extensions.swift
index 2cee85c..cdf5483 100644
--- a/test/SILGen/protocol_extensions.swift
+++ b/test/SILGen/protocol_extensions.swift
@@ -69,9 +69,9 @@
}
// (materializeForSet test from above)
-// CHECK-LABEL: sil private [transparent] [thunk] @_T019protocol_extensions1CCAA2P1A2aDP9subscriptS2icfmTW
+// CHECK-LABEL: sil private [transparent] [thunk] @_T019protocol_extensions1CCAA2P1A2aDPS2icimTW
// CHECK: bb0(%0 : $Builtin.RawPointer, %1 : $*Builtin.UnsafeValueBuffer, %2 : $Int, %3 : $*C):
-// CHECK: function_ref @_T019protocol_extensions2P1PAAE9subscriptS2icfg
+// CHECK: function_ref @_T019protocol_extensions2P1PAAES2icig
// CHECK: return
class D : C { }
@@ -110,110 +110,110 @@
var d2: D = d.returnsSelf()
// CHECK: metatype $@thick D.Type
- // CHECK: function_ref @_T019protocol_extensions2P1PAAE22staticReadOnlyPropertySifgZ
+ // CHECK: function_ref @_T019protocol_extensions2P1PAAE22staticReadOnlyPropertySivgZ
let _ = D.staticReadOnlyProperty
// CHECK: metatype $@thick D.Type
- // CHECK: function_ref @_T019protocol_extensions2P1PAAE16staticReadWrite1SifsZ
+ // CHECK: function_ref @_T019protocol_extensions2P1PAAE16staticReadWrite1SivsZ
D.staticReadWrite1 = 1
// CHECK: metatype $@thick D.Type
// CHECK: alloc_stack $Int
- // CHECK: function_ref @_T019protocol_extensions2P1PAAE16staticReadWrite1SifgZ
+ // CHECK: function_ref @_T019protocol_extensions2P1PAAE16staticReadWrite1SivgZ
// CHECK: store
// CHECK: load
- // CHECK: function_ref @_T019protocol_extensions2P1PAAE16staticReadWrite1SifsZ
+ // CHECK: function_ref @_T019protocol_extensions2P1PAAE16staticReadWrite1SivsZ
// CHECK: dealloc_stack
D.staticReadWrite1 += 1
// CHECK: metatype $@thick D.Type
- // CHECK: function_ref @_T019protocol_extensions2P1PAAE16staticReadWrite2AA3BoxVfsZ
+ // CHECK: function_ref @_T019protocol_extensions2P1PAAE16staticReadWrite2AA3BoxVvsZ
D.staticReadWrite2 = Box(number: 2)
// CHECK: metatype $@thick D.Type
// CHECK: alloc_stack $Box
- // CHECK: function_ref @_T019protocol_extensions2P1PAAE16staticReadWrite2AA3BoxVfgZ
+ // CHECK: function_ref @_T019protocol_extensions2P1PAAE16staticReadWrite2AA3BoxVvgZ
// CHECK: store
// CHECK: load
- // CHECK: function_ref @_T019protocol_extensions2P1PAAE16staticReadWrite2AA3BoxVfsZ
+ // CHECK: function_ref @_T019protocol_extensions2P1PAAE16staticReadWrite2AA3BoxVvsZ
// CHECK: dealloc_stack
D.staticReadWrite2.number += 5
// CHECK: function_ref @_T019protocol_extensions10inout_funcySizF
// CHECK: metatype $@thick D.Type
// CHECK: alloc_stack $Box
- // CHECK: function_ref @_T019protocol_extensions2P1PAAE16staticReadWrite2AA3BoxVfgZ
+ // CHECK: function_ref @_T019protocol_extensions2P1PAAE16staticReadWrite2AA3BoxVvgZ
// CHECK: store
// CHECK: load
- // CHECK: function_ref @_T019protocol_extensions2P1PAAE16staticReadWrite2AA3BoxVfsZ
+ // CHECK: function_ref @_T019protocol_extensions2P1PAAE16staticReadWrite2AA3BoxVvsZ
// CHECK: dealloc_stack
inout_func(&D.staticReadWrite2.number)
- // CHECK: function_ref @_T019protocol_extensions2P1PAAE22staticReadOnlyPropertySifgZ
+ // CHECK: function_ref @_T019protocol_extensions2P1PAAE22staticReadOnlyPropertySivgZ
let _ = dd.staticReadOnlyProperty
- // CHECK: function_ref @_T019protocol_extensions2P1PAAE16staticReadWrite1SifsZ
+ // CHECK: function_ref @_T019protocol_extensions2P1PAAE16staticReadWrite1SivsZ
dd.staticReadWrite1 = 1
// CHECK: alloc_stack $Int
- // CHECK: function_ref @_T019protocol_extensions2P1PAAE16staticReadWrite1SifgZ
+ // CHECK: function_ref @_T019protocol_extensions2P1PAAE16staticReadWrite1SivgZ
// CHECK: store
// CHECK: load
- // CHECK: function_ref @_T019protocol_extensions2P1PAAE16staticReadWrite1SifsZ
+ // CHECK: function_ref @_T019protocol_extensions2P1PAAE16staticReadWrite1SivsZ
// CHECK: dealloc_stack
dd.staticReadWrite1 += 1
- // CHECK: function_ref @_T019protocol_extensions2P1PAAE16staticReadWrite2AA3BoxVfsZ
+ // CHECK: function_ref @_T019protocol_extensions2P1PAAE16staticReadWrite2AA3BoxVvsZ
dd.staticReadWrite2 = Box(number: 2)
// CHECK: alloc_stack $Box
- // CHECK: function_ref @_T019protocol_extensions2P1PAAE16staticReadWrite2AA3BoxVfgZ
+ // CHECK: function_ref @_T019protocol_extensions2P1PAAE16staticReadWrite2AA3BoxVvgZ
// CHECK: store
// CHECK: load
- // CHECK: function_ref @_T019protocol_extensions2P1PAAE16staticReadWrite2AA3BoxVfsZ
+ // CHECK: function_ref @_T019protocol_extensions2P1PAAE16staticReadWrite2AA3BoxVvsZ
// CHECK: dealloc_stack
dd.staticReadWrite2.number += 5
// CHECK: function_ref @_T019protocol_extensions10inout_funcySizF
// CHECK: alloc_stack $Box
- // CHECK: function_ref @_T019protocol_extensions2P1PAAE16staticReadWrite2AA3BoxVfgZ
+ // CHECK: function_ref @_T019protocol_extensions2P1PAAE16staticReadWrite2AA3BoxVvgZ
// CHECK: store
// CHECK: load
- // CHECK: function_ref @_T019protocol_extensions2P1PAAE16staticReadWrite2AA3BoxVfsZ
+ // CHECK: function_ref @_T019protocol_extensions2P1PAAE16staticReadWrite2AA3BoxVvsZ
// CHECK: dealloc_stack
inout_func(&dd.staticReadWrite2.number)
- // CHECK: function_ref @_T019protocol_extensions2P1PAAE22staticReadOnlyPropertySifgZ
+ // CHECK: function_ref @_T019protocol_extensions2P1PAAE22staticReadOnlyPropertySivgZ
let _ = m.d.staticReadOnlyProperty
- // CHECK: function_ref @_T019protocol_extensions2P1PAAE16staticReadWrite1SifsZ
+ // CHECK: function_ref @_T019protocol_extensions2P1PAAE16staticReadWrite1SivsZ
m.d.staticReadWrite1 = 1
// CHECK: alloc_stack $Int
- // CHECK: function_ref @_T019protocol_extensions2P1PAAE16staticReadWrite1SifgZ
+ // CHECK: function_ref @_T019protocol_extensions2P1PAAE16staticReadWrite1SivgZ
// CHECK: store
// CHECK: load
- // CHECK: function_ref @_T019protocol_extensions2P1PAAE16staticReadWrite1SifsZ
+ // CHECK: function_ref @_T019protocol_extensions2P1PAAE16staticReadWrite1SivsZ
// CHECK: dealloc_stack
m.d.staticReadWrite1 += 1
- // CHECK: function_ref @_T019protocol_extensions2P1PAAE16staticReadWrite2AA3BoxVfsZ
+ // CHECK: function_ref @_T019protocol_extensions2P1PAAE16staticReadWrite2AA3BoxVvsZ
m.d.staticReadWrite2 = Box(number: 2)
// CHECK: alloc_stack $Box
- // CHECK: function_ref @_T019protocol_extensions2P1PAAE16staticReadWrite2AA3BoxVfgZ
+ // CHECK: function_ref @_T019protocol_extensions2P1PAAE16staticReadWrite2AA3BoxVvgZ
// CHECK: store
// CHECK: load
- // CHECK: function_ref @_T019protocol_extensions2P1PAAE16staticReadWrite2AA3BoxVfsZ
+ // CHECK: function_ref @_T019protocol_extensions2P1PAAE16staticReadWrite2AA3BoxVvsZ
// CHECK: dealloc_stack
m.d.staticReadWrite2.number += 5
// CHECK: function_ref @_T019protocol_extensions10inout_funcySizF
// CHECK: alloc_stack $Box
- // CHECK: function_ref @_T019protocol_extensions2P1PAAE16staticReadWrite2AA3BoxVfgZ
+ // CHECK: function_ref @_T019protocol_extensions2P1PAAE16staticReadWrite2AA3BoxVvgZ
// CHECK: store
// CHECK: load
- // CHECK: function_ref @_T019protocol_extensions2P1PAAE16staticReadWrite2AA3BoxVfsZ
+ // CHECK: function_ref @_T019protocol_extensions2P1PAAE16staticReadWrite2AA3BoxVvsZ
// CHECK: dealloc_stack
inout_func(&m.d.staticReadWrite2.number)
@@ -222,123 +222,123 @@
// CHECK-LABEL: sil hidden @_T019protocol_extensions5testSyAA10MetaHolderV_AA1SVm2sstF
func testS(_ m: MetaHolder, ss: S.Type) {
- // CHECK: function_ref @_T019protocol_extensions2P1PAAE22staticReadOnlyPropertySifgZ
+ // CHECK: function_ref @_T019protocol_extensions2P1PAAE22staticReadOnlyPropertySivgZ
// CHECK: metatype $@thick S.Type
let _ = S.staticReadOnlyProperty
- // CHECK: function_ref @_T019protocol_extensions2P1PAAE16staticReadWrite1SifsZ
+ // CHECK: function_ref @_T019protocol_extensions2P1PAAE16staticReadWrite1SivsZ
// CHECK: metatype $@thick S.Type
S.staticReadWrite1 = 1
// CHECK: alloc_stack $Int
- // CHECK: function_ref @_T019protocol_extensions2P1PAAE16staticReadWrite1SifgZ
+ // CHECK: function_ref @_T019protocol_extensions2P1PAAE16staticReadWrite1SivgZ
// CHECK: metatype $@thick S.Type
// CHECK: store
// CHECK: load
- // CHECK: function_ref @_T019protocol_extensions2P1PAAE16staticReadWrite1SifsZ
+ // CHECK: function_ref @_T019protocol_extensions2P1PAAE16staticReadWrite1SivsZ
// CHECK: dealloc_stack
S.staticReadWrite1 += 1
- // CHECK: function_ref @_T019protocol_extensions2P1PAAE16staticReadWrite2AA3BoxVfsZ
+ // CHECK: function_ref @_T019protocol_extensions2P1PAAE16staticReadWrite2AA3BoxVvsZ
// CHECK: metatype $@thick S.Type
S.staticReadWrite2 = Box(number: 2)
// CHECK: alloc_stack $Box
- // CHECK: function_ref @_T019protocol_extensions2P1PAAE16staticReadWrite2AA3BoxVfgZ
+ // CHECK: function_ref @_T019protocol_extensions2P1PAAE16staticReadWrite2AA3BoxVvgZ
// CHECK: metatype $@thick S.Type
// CHECK: store
// CHECK: load
- // CHECK: function_ref @_T019protocol_extensions2P1PAAE16staticReadWrite2AA3BoxVfsZ
+ // CHECK: function_ref @_T019protocol_extensions2P1PAAE16staticReadWrite2AA3BoxVvsZ
// CHECK: dealloc_stack
S.staticReadWrite2.number += 5
// CHECK: function_ref @_T019protocol_extensions10inout_funcySizF
// CHECK: alloc_stack $Box
- // CHECK: function_ref @_T019protocol_extensions2P1PAAE16staticReadWrite2AA3BoxVfgZ
+ // CHECK: function_ref @_T019protocol_extensions2P1PAAE16staticReadWrite2AA3BoxVvgZ
// CHECK: metatype $@thick S.Type
// CHECK: store
// CHECK: load
- // CHECK: function_ref @_T019protocol_extensions2P1PAAE16staticReadWrite2AA3BoxVfsZ
+ // CHECK: function_ref @_T019protocol_extensions2P1PAAE16staticReadWrite2AA3BoxVvsZ
// CHECK: dealloc_stack
inout_func(&S.staticReadWrite2.number)
- // CHECK: function_ref @_T019protocol_extensions2P1PAAE22staticReadOnlyPropertySifgZ
+ // CHECK: function_ref @_T019protocol_extensions2P1PAAE22staticReadOnlyPropertySivgZ
// CHECK: metatype $@thick S.Type
let _ = ss.staticReadOnlyProperty
- // CHECK: function_ref @_T019protocol_extensions2P1PAAE16staticReadWrite1SifsZ
+ // CHECK: function_ref @_T019protocol_extensions2P1PAAE16staticReadWrite1SivsZ
// CHECK: metatype $@thick S.Type
ss.staticReadWrite1 = 1
// CHECK: alloc_stack $Int
- // CHECK: function_ref @_T019protocol_extensions2P1PAAE16staticReadWrite1SifgZ
+ // CHECK: function_ref @_T019protocol_extensions2P1PAAE16staticReadWrite1SivgZ
// CHECK: metatype $@thick S.Type
// CHECK: store
// CHECK: load
- // CHECK: function_ref @_T019protocol_extensions2P1PAAE16staticReadWrite1SifsZ
+ // CHECK: function_ref @_T019protocol_extensions2P1PAAE16staticReadWrite1SivsZ
// CHECK: dealloc_stack
ss.staticReadWrite1 += 1
- // CHECK: function_ref @_T019protocol_extensions2P1PAAE16staticReadWrite2AA3BoxVfsZ
+ // CHECK: function_ref @_T019protocol_extensions2P1PAAE16staticReadWrite2AA3BoxVvsZ
// CHECK: metatype $@thick S.Type
ss.staticReadWrite2 = Box(number: 2)
// CHECK: alloc_stack $Box
- // CHECK: function_ref @_T019protocol_extensions2P1PAAE16staticReadWrite2AA3BoxVfgZ
+ // CHECK: function_ref @_T019protocol_extensions2P1PAAE16staticReadWrite2AA3BoxVvgZ
// CHECK: metatype $@thick S.Type
// CHECK: store
// CHECK: load
- // CHECK: function_ref @_T019protocol_extensions2P1PAAE16staticReadWrite2AA3BoxVfsZ
+ // CHECK: function_ref @_T019protocol_extensions2P1PAAE16staticReadWrite2AA3BoxVvsZ
// CHECK: dealloc_stack
ss.staticReadWrite2.number += 5
// CHECK: function_ref @_T019protocol_extensions10inout_funcySizF
// CHECK: alloc_stack $Box
- // CHECK: function_ref @_T019protocol_extensions2P1PAAE16staticReadWrite2AA3BoxVfgZ
+ // CHECK: function_ref @_T019protocol_extensions2P1PAAE16staticReadWrite2AA3BoxVvgZ
// CHECK: metatype $@thick S.Type
// CHECK: store
// CHECK: load
- // CHECK: function_ref @_T019protocol_extensions2P1PAAE16staticReadWrite2AA3BoxVfsZ
+ // CHECK: function_ref @_T019protocol_extensions2P1PAAE16staticReadWrite2AA3BoxVvsZ
// CHECK: dealloc_stack
inout_func(&ss.staticReadWrite2.number)
- // CHECK: function_ref @_T019protocol_extensions2P1PAAE22staticReadOnlyPropertySifgZ
+ // CHECK: function_ref @_T019protocol_extensions2P1PAAE22staticReadOnlyPropertySivgZ
// CHECK: metatype $@thick S.Type
let _ = m.s.staticReadOnlyProperty
- // CHECK: function_ref @_T019protocol_extensions2P1PAAE16staticReadWrite1SifsZ
+ // CHECK: function_ref @_T019protocol_extensions2P1PAAE16staticReadWrite1SivsZ
// CHECK: metatype $@thick S.Type
m.s.staticReadWrite1 = 1
// CHECK: alloc_stack $Int
- // CHECK: function_ref @_T019protocol_extensions2P1PAAE16staticReadWrite1SifgZ
+ // CHECK: function_ref @_T019protocol_extensions2P1PAAE16staticReadWrite1SivgZ
// CHECK: metatype $@thick S.Type
// CHECK: store
// CHECK: load
- // CHECK: function_ref @_T019protocol_extensions2P1PAAE16staticReadWrite1SifsZ
+ // CHECK: function_ref @_T019protocol_extensions2P1PAAE16staticReadWrite1SivsZ
// CHECK: dealloc_stack
m.s.staticReadWrite1 += 1
- // CHECK: function_ref @_T019protocol_extensions2P1PAAE16staticReadWrite2AA3BoxVfsZ
+ // CHECK: function_ref @_T019protocol_extensions2P1PAAE16staticReadWrite2AA3BoxVvsZ
// CHECK: metatype $@thick S.Type
m.s.staticReadWrite2 = Box(number: 2)
// CHECK: alloc_stack $Box
- // CHECK: function_ref @_T019protocol_extensions2P1PAAE16staticReadWrite2AA3BoxVfgZ
+ // CHECK: function_ref @_T019protocol_extensions2P1PAAE16staticReadWrite2AA3BoxVvgZ
// CHECK: metatype $@thick S.Type
// CHECK: store
// CHECK: load
- // CHECK: function_ref @_T019protocol_extensions2P1PAAE16staticReadWrite2AA3BoxVfsZ
+ // CHECK: function_ref @_T019protocol_extensions2P1PAAE16staticReadWrite2AA3BoxVvsZ
// CHECK: dealloc_stack
m.s.staticReadWrite2.number += 5
// CHECK: function_ref @_T019protocol_extensions10inout_funcySizF
// CHECK: alloc_stack $Box
- // CHECK: function_ref @_T019protocol_extensions2P1PAAE16staticReadWrite2AA3BoxVfgZ
+ // CHECK: function_ref @_T019protocol_extensions2P1PAAE16staticReadWrite2AA3BoxVvgZ
// CHECK: metatype $@thick S.Type
// CHECK: store
// CHECK: load
- // CHECK: function_ref @_T019protocol_extensions2P1PAAE16staticReadWrite2AA3BoxVfsZ
+ // CHECK: function_ref @_T019protocol_extensions2P1PAAE16staticReadWrite2AA3BoxVvsZ
// CHECK: dealloc_stack
inout_func(&m.s.staticReadWrite2.number)
@@ -347,123 +347,123 @@
// CHECK-LABEL: sil hidden @_T019protocol_extensions5testG{{[_0-9a-zA-Z]*}}F
func testG<T>(_ m: GenericMetaHolder<T>, gg: G<T>.Type) {
- // CHECK: function_ref @_T019protocol_extensions2P1PAAE22staticReadOnlyPropertySifgZ
+ // CHECK: function_ref @_T019protocol_extensions2P1PAAE22staticReadOnlyPropertySivgZ
// CHECK: metatype $@thick G<T>.Type
let _ = G<T>.staticReadOnlyProperty
- // CHECK: function_ref @_T019protocol_extensions2P1PAAE16staticReadWrite1SifsZ
+ // CHECK: function_ref @_T019protocol_extensions2P1PAAE16staticReadWrite1SivsZ
// CHECK: metatype $@thick G<T>.Type
G<T>.staticReadWrite1 = 1
// CHECK: alloc_stack $Int
- // CHECK: function_ref @_T019protocol_extensions2P1PAAE16staticReadWrite1SifgZ
+ // CHECK: function_ref @_T019protocol_extensions2P1PAAE16staticReadWrite1SivgZ
// CHECK: metatype $@thick G<T>.Type
// CHECK: store
// CHECK: load
- // CHECK: function_ref @_T019protocol_extensions2P1PAAE16staticReadWrite1SifsZ
+ // CHECK: function_ref @_T019protocol_extensions2P1PAAE16staticReadWrite1SivsZ
// CHECK: dealloc_stack
G<T>.staticReadWrite1 += 1
- // CHECK: function_ref @_T019protocol_extensions2P1PAAE16staticReadWrite2AA3BoxVfsZ
+ // CHECK: function_ref @_T019protocol_extensions2P1PAAE16staticReadWrite2AA3BoxVvsZ
// CHECK: metatype $@thick G<T>.Type
G<T>.staticReadWrite2 = Box(number: 2)
// CHECK: alloc_stack $Box
- // CHECK: function_ref @_T019protocol_extensions2P1PAAE16staticReadWrite2AA3BoxVfgZ
+ // CHECK: function_ref @_T019protocol_extensions2P1PAAE16staticReadWrite2AA3BoxVvgZ
// CHECK: metatype $@thick G<T>.Type
// CHECK: store
// CHECK: load
- // CHECK: function_ref @_T019protocol_extensions2P1PAAE16staticReadWrite2AA3BoxVfsZ
+ // CHECK: function_ref @_T019protocol_extensions2P1PAAE16staticReadWrite2AA3BoxVvsZ
// CHECK: dealloc_stack
G<T>.staticReadWrite2.number += 5
// CHECK: function_ref @_T019protocol_extensions10inout_funcySizF
// CHECK: alloc_stack $Box
- // CHECK: function_ref @_T019protocol_extensions2P1PAAE16staticReadWrite2AA3BoxVfgZ
+ // CHECK: function_ref @_T019protocol_extensions2P1PAAE16staticReadWrite2AA3BoxVvgZ
// CHECK: metatype $@thick G<T>.Type
// CHECK: store
// CHECK: load
- // CHECK: function_ref @_T019protocol_extensions2P1PAAE16staticReadWrite2AA3BoxVfsZ
+ // CHECK: function_ref @_T019protocol_extensions2P1PAAE16staticReadWrite2AA3BoxVvsZ
// CHECK: dealloc_stack
inout_func(&G<T>.staticReadWrite2.number)
- // CHECK: function_ref @_T019protocol_extensions2P1PAAE22staticReadOnlyPropertySifgZ
+ // CHECK: function_ref @_T019protocol_extensions2P1PAAE22staticReadOnlyPropertySivgZ
// CHECK: metatype $@thick G<T>.Type
let _ = gg.staticReadOnlyProperty
- // CHECK: function_ref @_T019protocol_extensions2P1PAAE16staticReadWrite1SifsZ
+ // CHECK: function_ref @_T019protocol_extensions2P1PAAE16staticReadWrite1SivsZ
// CHECK: metatype $@thick G<T>.Type
gg.staticReadWrite1 = 1
// CHECK: alloc_stack $Int
- // CHECK: function_ref @_T019protocol_extensions2P1PAAE16staticReadWrite1SifgZ
+ // CHECK: function_ref @_T019protocol_extensions2P1PAAE16staticReadWrite1SivgZ
// CHECK: metatype $@thick G<T>.Type
// CHECK: store
// CHECK: load
- // CHECK: function_ref @_T019protocol_extensions2P1PAAE16staticReadWrite1SifsZ
+ // CHECK: function_ref @_T019protocol_extensions2P1PAAE16staticReadWrite1SivsZ
// CHECK: dealloc_stack
gg.staticReadWrite1 += 1
- // CHECK: function_ref @_T019protocol_extensions2P1PAAE16staticReadWrite2AA3BoxVfsZ
+ // CHECK: function_ref @_T019protocol_extensions2P1PAAE16staticReadWrite2AA3BoxVvsZ
// CHECK: metatype $@thick G<T>.Type
gg.staticReadWrite2 = Box(number: 2)
// CHECK: alloc_stack $Box
- // CHECK: function_ref @_T019protocol_extensions2P1PAAE16staticReadWrite2AA3BoxVfgZ
+ // CHECK: function_ref @_T019protocol_extensions2P1PAAE16staticReadWrite2AA3BoxVvgZ
// CHECK: metatype $@thick G<T>.Type
// CHECK: store
// CHECK: load
- // CHECK: function_ref @_T019protocol_extensions2P1PAAE16staticReadWrite2AA3BoxVfsZ
+ // CHECK: function_ref @_T019protocol_extensions2P1PAAE16staticReadWrite2AA3BoxVvsZ
// CHECK: dealloc_stack
gg.staticReadWrite2.number += 5
// CHECK: function_ref @_T019protocol_extensions10inout_funcySizF
// CHECK: alloc_stack $Box
- // CHECK: function_ref @_T019protocol_extensions2P1PAAE16staticReadWrite2AA3BoxVfgZ
+ // CHECK: function_ref @_T019protocol_extensions2P1PAAE16staticReadWrite2AA3BoxVvgZ
// CHECK: metatype $@thick G<T>.Type
// CHECK: store
// CHECK: load
- // CHECK: function_ref @_T019protocol_extensions2P1PAAE16staticReadWrite2AA3BoxVfsZ
+ // CHECK: function_ref @_T019protocol_extensions2P1PAAE16staticReadWrite2AA3BoxVvsZ
// CHECK: dealloc_stack
inout_func(&gg.staticReadWrite2.number)
- // CHECK: function_ref @_T019protocol_extensions2P1PAAE22staticReadOnlyPropertySifgZ
+ // CHECK: function_ref @_T019protocol_extensions2P1PAAE22staticReadOnlyPropertySivgZ
// CHECK: metatype $@thick G<T>.Type
let _ = m.g.staticReadOnlyProperty
- // CHECK: function_ref @_T019protocol_extensions2P1PAAE16staticReadWrite1SifsZ
+ // CHECK: function_ref @_T019protocol_extensions2P1PAAE16staticReadWrite1SivsZ
// CHECK: metatype $@thick G<T>.Type
m.g.staticReadWrite1 = 1
// CHECK: alloc_stack $Int
- // CHECK: function_ref @_T019protocol_extensions2P1PAAE16staticReadWrite1SifgZ
+ // CHECK: function_ref @_T019protocol_extensions2P1PAAE16staticReadWrite1SivgZ
// CHECK: metatype $@thick G<T>.Type
// CHECK: store
// CHECK: load
- // CHECK: function_ref @_T019protocol_extensions2P1PAAE16staticReadWrite1SifsZ
+ // CHECK: function_ref @_T019protocol_extensions2P1PAAE16staticReadWrite1SivsZ
// CHECK: dealloc_stack
m.g.staticReadWrite1 += 1
- // CHECK: function_ref @_T019protocol_extensions2P1PAAE16staticReadWrite2AA3BoxVfsZ
+ // CHECK: function_ref @_T019protocol_extensions2P1PAAE16staticReadWrite2AA3BoxVvsZ
// CHECK: metatype $@thick G<T>.Type
m.g.staticReadWrite2 = Box(number: 2)
// CHECK: alloc_stack $Box
- // CHECK: function_ref @_T019protocol_extensions2P1PAAE16staticReadWrite2AA3BoxVfgZ
+ // CHECK: function_ref @_T019protocol_extensions2P1PAAE16staticReadWrite2AA3BoxVvgZ
// CHECK: metatype $@thick G<T>.Type
// CHECK: store
// CHECK: load
- // CHECK: function_ref @_T019protocol_extensions2P1PAAE16staticReadWrite2AA3BoxVfsZ
+ // CHECK: function_ref @_T019protocol_extensions2P1PAAE16staticReadWrite2AA3BoxVvsZ
// CHECK: dealloc_stack
m.g.staticReadWrite2.number += 5
// CHECK: function_ref @_T019protocol_extensions10inout_funcySizF
// CHECK: alloc_stack $Box
- // CHECK: function_ref @_T019protocol_extensions2P1PAAE16staticReadWrite2AA3BoxVfgZ
+ // CHECK: function_ref @_T019protocol_extensions2P1PAAE16staticReadWrite2AA3BoxVvgZ
// CHECK: metatype $@thick G<T>.Type
// CHECK: store
// CHECK: load
- // CHECK: function_ref @_T019protocol_extensions2P1PAAE16staticReadWrite2AA3BoxVfsZ
+ // CHECK: function_ref @_T019protocol_extensions2P1PAAE16staticReadWrite2AA3BoxVvsZ
// CHECK: dealloc_stack
inout_func(&m.g.staticReadWrite2.number)
@@ -507,7 +507,7 @@
// CHECK: [[POPENED:%[0-9]+]] = open_existential_addr immutable_access [[P]] : $*P1 to $*@opened([[UUID:".*"]]) P1
// CHECK: copy_addr [[POPENED]] to [initialization] [[POPENED_COPY:%.*]] :
- // CHECK: [[GETTER:%[0-9]+]] = function_ref @_T019protocol_extensions2P1PAAE9subscriptSbs5Int64Vcfg
+ // CHECK: [[GETTER:%[0-9]+]] = function_ref @_T019protocol_extensions2P1PAAESbs5Int64Vcig
// CHECK: apply [[GETTER]]<@opened([[UUID]]) P1>([[I]], [[POPENED_COPY]]) : $@convention(method) <τ_0_0 where τ_0_0 : P1> (Int64, @in_guaranteed τ_0_0) -> Bool
// CHECK: destroy_addr [[POPENED_COPY]]
// CHECK: store{{.*}} : $*Bool
@@ -516,7 +516,7 @@
// CHECK: [[POPENED:%[0-9]+]] = open_existential_addr immutable_access [[P]] : $*P1 to $*@opened([[UUID:".*"]]) P1
// CHECK: copy_addr [[POPENED]] to [initialization] [[POPENED_COPY:%.*]] :
- // CHECK: [[GETTER:%[0-9]+]] = function_ref @_T019protocol_extensions2P1PAAE4propSbfg
+ // CHECK: [[GETTER:%[0-9]+]] = function_ref @_T019protocol_extensions2P1PAAE4propSbvg
// CHECK: apply [[GETTER]]<@opened([[UUID]]) P1>([[POPENED_COPY]]) : $@convention(method) <τ_0_0 where τ_0_0 : P1> (@in_guaranteed τ_0_0) -> Bool
// CHECK: store{{.*}} : $*Bool
// CHECK: dealloc_stack [[POPENED_COPY]]
@@ -540,13 +540,13 @@
func testExistentialsGetters(_ p1: P1) {
// CHECK: [[POPENED:%[0-9]+]] = open_existential_addr immutable_access [[P]] : $*P1 to $*@opened([[UUID:".*"]]) P1
// CHECK: copy_addr [[POPENED]] to [initialization] [[POPENED_COPY:%.*]] :
- // CHECK: [[FN:%[0-9]+]] = function_ref @_T019protocol_extensions2P1PAAE5prop2Sbfg
+ // CHECK: [[FN:%[0-9]+]] = function_ref @_T019protocol_extensions2P1PAAE5prop2Sbvg
// CHECK: [[B:%[0-9]+]] = apply [[FN]]<@opened([[UUID]]) P1>([[POPENED_COPY]]) : $@convention(method) <τ_0_0 where τ_0_0 : P1> (@in_guaranteed τ_0_0) -> Bool
let b: Bool = p1.prop2
// CHECK: [[POPENED:%[0-9]+]] = open_existential_addr immutable_access [[P]] : $*P1 to $*@opened([[UUID:".*"]]) P1
// CHECK: copy_addr [[POPENED]] to [initialization] [[POPENED_COPY:%.*]] :
- // CHECK: [[GETTER:%[0-9]+]] = function_ref @_T019protocol_extensions2P1PAAE9subscriptS2bcfg
+ // CHECK: [[GETTER:%[0-9]+]] = function_ref @_T019protocol_extensions2P1PAAES2bcig
// CHECK: apply [[GETTER]]<@opened([[UUID]]) P1>([[B]], [[POPENED_COPY]]) : $@convention(method) <τ_0_0 where τ_0_0 : P1> (Bool, @in_guaranteed τ_0_0) -> Bool
let b2: Bool = p1[b]
}
@@ -560,14 +560,14 @@
// CHECK-NEXT: copy_addr [[P]] to [initialization] [[PBP]] : $*P1
// CHECK: [[WRITE:%.*]] = begin_access [modify] [unknown] [[PBP]]
// CHECK: [[POPENED:%[0-9]+]] = open_existential_addr mutable_access [[WRITE]] : $*P1 to $*@opened([[UUID:".*"]]) P1
- // CHECK: [[GETTER:%[0-9]+]] = function_ref @_T019protocol_extensions2P1PAAE5prop2Sbfs
+ // CHECK: [[GETTER:%[0-9]+]] = function_ref @_T019protocol_extensions2P1PAAE5prop2Sbvs
// CHECK: apply [[GETTER]]<@opened([[UUID]]) P1>([[B]], [[POPENED]]) : $@convention(method) <τ_0_0 where τ_0_0 : P1> (Bool, @inout τ_0_0) -> ()
// CHECK-NOT: deinit_existential_addr
p1.prop2 = b
// CHECK: [[WRITE:%.*]] = begin_access [modify] [unknown] [[PBP]]
// CHECK: [[POPENED:%[0-9]+]] = open_existential_addr mutable_access [[WRITE]] : $*P1 to $*@opened([[UUID:".*"]]) P1
- // CHECK: [[SUBSETTER:%[0-9]+]] = function_ref @_T019protocol_extensions2P1PAAE9subscriptS2bcfs
+ // CHECK: [[SUBSETTER:%[0-9]+]] = function_ref @_T019protocol_extensions2P1PAAES2bcis
// CHECK: apply [[SUBSETTER]]<@opened([[UUID]]) P1>([[B]], [[B]], [[POPENED]]) : $@convention(method) <τ_0_0 where τ_0_0 : P1> (Bool, Bool, @inout τ_0_0) -> ()
// CHECK-NOT: deinit_existential_addr [[PB]] : $*P1
p1[b] = b
@@ -595,12 +595,12 @@
// CHECK: [[P1_COPY:%[0-9]+]] = alloc_stack $P1
// CHECK-NEXT: [[HASP1_COPY:%[0-9]+]] = alloc_stack $HasAP1
// CHECK-NEXT: copy_addr [[WRITE]] to [initialization] [[HASP1_COPY]] : $*HasAP1
- // CHECK: [[SOMEP1_GETTER:%[0-9]+]] = function_ref @_T019protocol_extensions6HasAP1V6someP1AA0F0_pfg : $@convention(method) (@in_guaranteed HasAP1) -> @out P1
+ // CHECK: [[SOMEP1_GETTER:%[0-9]+]] = function_ref @_T019protocol_extensions6HasAP1V6someP1AA0F0_pvg : $@convention(method) (@in_guaranteed HasAP1) -> @out P1
// CHECK: [[RESULT:%[0-9]+]] = apply [[SOMEP1_GETTER]]([[P1_COPY]], [[HASP1_COPY]]) : $@convention(method) (@in_guaranteed HasAP1) -> @out P1
// CHECK: [[P1_OPENED:%[0-9]+]] = open_existential_addr mutable_access [[P1_COPY]] : $*P1 to $*@opened([[UUID:".*"]]) P1
- // CHECK: [[PROP2_SETTER:%[0-9]+]] = function_ref @_T019protocol_extensions2P1PAAE5prop2Sbfs : $@convention(method) <τ_0_0 where τ_0_0 : P1> (Bool, @inout τ_0_0) -> ()
+ // CHECK: [[PROP2_SETTER:%[0-9]+]] = function_ref @_T019protocol_extensions2P1PAAE5prop2Sbvs : $@convention(method) <τ_0_0 where τ_0_0 : P1> (Bool, @inout τ_0_0) -> ()
// CHECK: apply [[PROP2_SETTER]]<@opened([[UUID]]) P1>([[B]], [[P1_OPENED]]) : $@convention(method) <τ_0_0 where τ_0_0 : P1> (Bool, @inout τ_0_0) -> ()
- // CHECK: [[SOMEP1_SETTER:%[0-9]+]] = function_ref @_T019protocol_extensions6HasAP1V6someP1AA0F0_pfs : $@convention(method) (@in P1, @inout HasAP1) -> ()
+ // CHECK: [[SOMEP1_SETTER:%[0-9]+]] = function_ref @_T019protocol_extensions6HasAP1V6someP1AA0F0_pvs : $@convention(method) (@in P1, @inout HasAP1) -> ()
// CHECK: apply [[SOMEP1_SETTER]]([[P1_COPY]], [[WRITE]]) : $@convention(method) (@in P1, @inout HasAP1) -> ()
// CHECK-NOT: deinit_existential_addr
hasAP1.someP1.prop2 = b
diff --git a/test/SILGen/protocol_resilience.swift b/test/SILGen/protocol_resilience.swift
index 78fa6cd..658150d 100644
--- a/test/SILGen/protocol_resilience.swift
+++ b/test/SILGen/protocol_resilience.swift
@@ -110,18 +110,18 @@
extension ResilientStorage {
-// CHECK-LABEL: sil private [transparent] [thunk] @_T019protocol_resilience16ResilientStorageP19propertyWithDefaultSifg
-// CHECK-LABEL: sil @_T019protocol_resilience16ResilientStoragePAAE19propertyWithDefaultSifg
+// CHECK-LABEL: sil private [transparent] [thunk] @_T019protocol_resilience16ResilientStorageP19propertyWithDefaultSivg
+// CHECK-LABEL: sil @_T019protocol_resilience16ResilientStoragePAAE19propertyWithDefaultSivg
public var propertyWithDefault: Int {
get { return 0 }
}
-// CHECK-LABEL: sil private [transparent] [thunk] @_T019protocol_resilience16ResilientStorageP26mutablePropertyWithDefaultSifg
-// CHECK-LABEL: sil @_T019protocol_resilience16ResilientStoragePAAE26mutablePropertyWithDefaultSifg
-// CHECK-LABEL: sil private [transparent] [thunk] @_T019protocol_resilience16ResilientStorageP26mutablePropertyWithDefaultSifs
-// CHECK-LABEL: sil @_T019protocol_resilience16ResilientStoragePAAE26mutablePropertyWithDefaultSifs
-// CHECK-LABEL: sil private [transparent] @_T019protocol_resilience16ResilientStorageP26mutablePropertyWithDefaultSifmytfU_
-// CHECK-LABEL: sil private [transparent] [thunk] @_T019protocol_resilience16ResilientStorageP26mutablePropertyWithDefaultSifm
+// CHECK-LABEL: sil private [transparent] [thunk] @_T019protocol_resilience16ResilientStorageP26mutablePropertyWithDefaultSivg
+// CHECK-LABEL: sil @_T019protocol_resilience16ResilientStoragePAAE26mutablePropertyWithDefaultSivg
+// CHECK-LABEL: sil private [transparent] [thunk] @_T019protocol_resilience16ResilientStorageP26mutablePropertyWithDefaultSivs
+// CHECK-LABEL: sil @_T019protocol_resilience16ResilientStoragePAAE26mutablePropertyWithDefaultSivs
+// CHECK-LABEL: sil private [transparent] @_T019protocol_resilience16ResilientStorageP26mutablePropertyWithDefaultSivmytfU_
+// CHECK-LABEL: sil private [transparent] [thunk] @_T019protocol_resilience16ResilientStorageP26mutablePropertyWithDefaultSivm
public var mutablePropertyWithDefault: Int {
get { return 0 }
set { }
@@ -132,12 +132,12 @@
set { }
}
-// CHECK-LABEL: sil private [transparent] [thunk] @_T019protocol_resilience16ResilientStorageP33mutableGenericPropertyWithDefault1TQzfg
-// CHECK-LABEL: sil @_T019protocol_resilience16ResilientStoragePAAE33mutableGenericPropertyWithDefault1TQzfg
-// CHECK-LABEL: sil private [transparent] [thunk] @_T019protocol_resilience16ResilientStorageP33mutableGenericPropertyWithDefault1TQzfs
-// CHECK-LABEL: sil @_T019protocol_resilience16ResilientStoragePAAE33mutableGenericPropertyWithDefault1TQzfs
-// CHECK-LABEL: sil private [transparent] @_T019protocol_resilience16ResilientStorageP33mutableGenericPropertyWithDefault1TQzfmytfU_
-// CHECK-LABEL: sil private [transparent] [thunk] @_T019protocol_resilience16ResilientStorageP33mutableGenericPropertyWithDefault1TQzfm
+// CHECK-LABEL: sil private [transparent] [thunk] @_T019protocol_resilience16ResilientStorageP33mutableGenericPropertyWithDefault1TQzvg
+// CHECK-LABEL: sil @_T019protocol_resilience16ResilientStoragePAAE33mutableGenericPropertyWithDefault1TQzvg
+// CHECK-LABEL: sil private [transparent] [thunk] @_T019protocol_resilience16ResilientStorageP33mutableGenericPropertyWithDefault1TQzvs
+// CHECK-LABEL: sil @_T019protocol_resilience16ResilientStoragePAAE33mutableGenericPropertyWithDefault1TQzvs
+// CHECK-LABEL: sil private [transparent] @_T019protocol_resilience16ResilientStorageP33mutableGenericPropertyWithDefault1TQzvmytfU_
+// CHECK-LABEL: sil private [transparent] [thunk] @_T019protocol_resilience16ResilientStorageP33mutableGenericPropertyWithDefault1TQzvm
public var mutableGenericPropertyWithDefault: T {
get {
return T(default: ())
@@ -145,12 +145,12 @@
set { }
}
-// CHECK-LABEL: sil private [transparent] [thunk] @_T019protocol_resilience16ResilientStorageP9subscript1TQzAFcfg
-// CHECK-LABEL: sil @_T019protocol_resilience16ResilientStoragePAAE9subscript1TQzAFcfg
-// CHECK-LABEL: sil private [transparent] [thunk] @_T019protocol_resilience16ResilientStorageP9subscript1TQzAFcfs
-// CHECK-LABEL: sil @_T019protocol_resilience16ResilientStoragePAAE9subscript1TQzAFcfs
-// CHECK-LABEL: sil private [transparent] @_T019protocol_resilience16ResilientStorageP9subscript1TQzAFcfmytfU_
-// CHECK-LABEL: sil private [transparent] [thunk] @_T019protocol_resilience16ResilientStorageP9subscript1TQzAFcfm
+// CHECK-LABEL: sil private [transparent] [thunk] @_T019protocol_resilience16ResilientStorageP1TQzAEcig
+// CHECK-LABEL: sil @_T019protocol_resilience16ResilientStoragePAAE1TQzAEcig
+// CHECK-LABEL: sil private [transparent] [thunk] @_T019protocol_resilience16ResilientStorageP1TQzAEcis
+// CHECK-LABEL: sil @_T019protocol_resilience16ResilientStoragePAAE1TQzAEcis
+// CHECK-LABEL: sil private [transparent] @_T019protocol_resilience16ResilientStorageP1TQzAEcimytfU_
+// CHECK-LABEL: sil private [transparent] [thunk] @_T019protocol_resilience16ResilientStorageP1TQzAEcim
public subscript(x: T) -> T {
get {
return x
@@ -158,12 +158,12 @@
set { }
}
-// CHECK-LABEL: sil private [transparent] [thunk] @_T019protocol_resilience16ResilientStorageP36mutatingGetterWithNonMutatingDefaultSifg
-// CHECK-LABEL: sil @_T019protocol_resilience16ResilientStoragePAAE36mutatingGetterWithNonMutatingDefaultSifg
-// CHECK-LABEL: sil private [transparent] [thunk] @_T019protocol_resilience16ResilientStorageP36mutatingGetterWithNonMutatingDefaultSifs
-// CHECK-LABEL: sil @_T019protocol_resilience16ResilientStoragePAAE36mutatingGetterWithNonMutatingDefaultSifs
-// CHECK-LABEL: sil private [transparent] @_T019protocol_resilience16ResilientStorageP36mutatingGetterWithNonMutatingDefaultSifmytfU_
-// CHECK-LABEL: sil private [transparent] [thunk] @_T019protocol_resilience16ResilientStorageP36mutatingGetterWithNonMutatingDefaultSifm
+// CHECK-LABEL: sil private [transparent] [thunk] @_T019protocol_resilience16ResilientStorageP36mutatingGetterWithNonMutatingDefaultSivg
+// CHECK-LABEL: sil @_T019protocol_resilience16ResilientStoragePAAE36mutatingGetterWithNonMutatingDefaultSivg
+// CHECK-LABEL: sil private [transparent] [thunk] @_T019protocol_resilience16ResilientStorageP36mutatingGetterWithNonMutatingDefaultSivs
+// CHECK-LABEL: sil @_T019protocol_resilience16ResilientStoragePAAE36mutatingGetterWithNonMutatingDefaultSivs
+// CHECK-LABEL: sil private [transparent] @_T019protocol_resilience16ResilientStorageP36mutatingGetterWithNonMutatingDefaultSivmytfU_
+// CHECK-LABEL: sil private [transparent] [thunk] @_T019protocol_resilience16ResilientStorageP36mutatingGetterWithNonMutatingDefaultSivm
public var mutatingGetterWithNonMutatingDefault: Int {
get {
return 0
@@ -227,7 +227,7 @@
// CHECK-LABEL: sil hidden @_T019protocol_resilience22inoutResilientProtocoly010resilient_A005OtherdE0_pzF
func inoutResilientProtocol(_ x: inout OtherResilientProtocol) {
- // CHECK: function_ref @_T018resilient_protocol22OtherResilientProtocolPAAE19propertyInExtensionSifm
+ // CHECK: function_ref @_T018resilient_protocol22OtherResilientProtocolPAAE19propertyInExtensionSivm
inoutFunc(&x.propertyInExtension)
}
@@ -235,10 +235,10 @@
// CHECK-LABEL: sil hidden @_T019protocol_resilience22inoutResilientProtocolyAA19OtherConformingTypeVzF
func inoutResilientProtocol(_ x: inout OtherConformingType) {
- // CHECK: function_ref @_T018resilient_protocol22OtherResilientProtocolPAAE19propertyInExtensionSifm
+ // CHECK: function_ref @_T018resilient_protocol22OtherResilientProtocolPAAE19propertyInExtensionSivm
inoutFunc(&x.propertyInExtension)
- // CHECK: function_ref @_T018resilient_protocol22OtherResilientProtocolPAAE25staticPropertyInExtensionSifmZ
+ // CHECK: function_ref @_T018resilient_protocol22OtherResilientProtocolPAAE25staticPropertyInExtensionSivmZ
inoutFunc(&OtherConformingType.staticPropertyInExtension)
}
@@ -282,23 +282,23 @@
// CHECK-LABEL: sil_default_witness_table ResilientStorage {
// CHECK-NEXT: no_default
// CHECK-NEXT: no_default
-// CHECK-NEXT: method #ResilientStorage.propertyWithDefault!getter.1: {{.*}} : @_T019protocol_resilience16ResilientStorageP19propertyWithDefaultSifg
+// CHECK-NEXT: method #ResilientStorage.propertyWithDefault!getter.1: {{.*}} : @_T019protocol_resilience16ResilientStorageP19propertyWithDefaultSivg
// CHECK-NEXT: no_default
-// CHECK-NEXT: method #ResilientStorage.mutablePropertyWithDefault!getter.1: {{.*}} : @_T019protocol_resilience16ResilientStorageP26mutablePropertyWithDefaultSifg
-// CHECK-NEXT: method #ResilientStorage.mutablePropertyWithDefault!setter.1: {{.*}} : @_T019protocol_resilience16ResilientStorageP26mutablePropertyWithDefaultSifs
-// CHECK-NEXT: method #ResilientStorage.mutablePropertyWithDefault!materializeForSet.1: {{.*}} : @_T019protocol_resilience16ResilientStorageP26mutablePropertyWithDefaultSifm
+// CHECK-NEXT: method #ResilientStorage.mutablePropertyWithDefault!getter.1: {{.*}} : @_T019protocol_resilience16ResilientStorageP26mutablePropertyWithDefaultSivg
+// CHECK-NEXT: method #ResilientStorage.mutablePropertyWithDefault!setter.1: {{.*}} : @_T019protocol_resilience16ResilientStorageP26mutablePropertyWithDefaultSivs
+// CHECK-NEXT: method #ResilientStorage.mutablePropertyWithDefault!materializeForSet.1: {{.*}} : @_T019protocol_resilience16ResilientStorageP26mutablePropertyWithDefaultSivm
// CHECK-NEXT: no_default
// CHECK-NEXT: no_default
// CHECK-NEXT: no_default
-// CHECK-NEXT: method #ResilientStorage.mutableGenericPropertyWithDefault!getter.1: {{.*}} : @_T019protocol_resilience16ResilientStorageP33mutableGenericPropertyWithDefault1TQzfg
-// CHECK-NEXT: method #ResilientStorage.mutableGenericPropertyWithDefault!setter.1: {{.*}} : @_T019protocol_resilience16ResilientStorageP33mutableGenericPropertyWithDefault1TQzfs
-// CHECK-NEXT: method #ResilientStorage.mutableGenericPropertyWithDefault!materializeForSet.1: {{.*}} : @_T019protocol_resilience16ResilientStorageP33mutableGenericPropertyWithDefault1TQzfm
-// CHECK-NEXT: method #ResilientStorage.subscript!getter.1: {{.*}} : @_T019protocol_resilience16ResilientStorageP9subscript1TQzAFcfg
-// CHECK-NEXT: method #ResilientStorage.subscript!setter.1: {{.*}} : @_T019protocol_resilience16ResilientStorageP9subscript1TQzAFcfs
-// CHECK-NEXT: method #ResilientStorage.subscript!materializeForSet.1: {{.*}} : @_T019protocol_resilience16ResilientStorageP9subscript1TQzAFcfm
-// CHECK-NEXT: method #ResilientStorage.mutatingGetterWithNonMutatingDefault!getter.1: {{.*}} : @_T019protocol_resilience16ResilientStorageP36mutatingGetterWithNonMutatingDefaultSifg
-// CHECK-NEXT: method #ResilientStorage.mutatingGetterWithNonMutatingDefault!setter.1: {{.*}} : @_T019protocol_resilience16ResilientStorageP36mutatingGetterWithNonMutatingDefaultSifs
-// CHECK-NEXT: method #ResilientStorage.mutatingGetterWithNonMutatingDefault!materializeForSet.1: {{.*}} : @_T019protocol_resilience16ResilientStorageP36mutatingGetterWithNonMutatingDefaultSifm
+// CHECK-NEXT: method #ResilientStorage.mutableGenericPropertyWithDefault!getter.1: {{.*}} : @_T019protocol_resilience16ResilientStorageP33mutableGenericPropertyWithDefault1TQzvg
+// CHECK-NEXT: method #ResilientStorage.mutableGenericPropertyWithDefault!setter.1: {{.*}} : @_T019protocol_resilience16ResilientStorageP33mutableGenericPropertyWithDefault1TQzvs
+// CHECK-NEXT: method #ResilientStorage.mutableGenericPropertyWithDefault!materializeForSet.1: {{.*}} : @_T019protocol_resilience16ResilientStorageP33mutableGenericPropertyWithDefault1TQzvm
+// CHECK-NEXT: method #ResilientStorage.subscript!getter.1: {{.*}} : @_T019protocol_resilience16ResilientStorageP1TQzAEcig
+// CHECK-NEXT: method #ResilientStorage.subscript!setter.1: {{.*}} : @_T019protocol_resilience16ResilientStorageP1TQzAEcis
+// CHECK-NEXT: method #ResilientStorage.subscript!materializeForSet.1: {{.*}} : @_T019protocol_resilience16ResilientStorageP1TQzAEcim
+// CHECK-NEXT: method #ResilientStorage.mutatingGetterWithNonMutatingDefault!getter.1: {{.*}} : @_T019protocol_resilience16ResilientStorageP36mutatingGetterWithNonMutatingDefaultSivg
+// CHECK-NEXT: method #ResilientStorage.mutatingGetterWithNonMutatingDefault!setter.1: {{.*}} : @_T019protocol_resilience16ResilientStorageP36mutatingGetterWithNonMutatingDefaultSivs
+// CHECK-NEXT: method #ResilientStorage.mutatingGetterWithNonMutatingDefault!materializeForSet.1: {{.*}} : @_T019protocol_resilience16ResilientStorageP36mutatingGetterWithNonMutatingDefaultSivm
// CHECK-NEXT: }
// CHECK-LABEL: sil_default_witness_table ResilientOperators {
@@ -312,9 +312,9 @@
// CHECK-LABEL: sil_default_witness_table ReabstractSelfRefined {
// CHECK-NEXT: no_default
-// CHECK-NEXT: method #ReabstractSelfRefined.callback!getter.1: {{.*}} : @_T019protocol_resilience21ReabstractSelfRefinedP8callbackxxcfg
-// CHECK-NEXT: method #ReabstractSelfRefined.callback!setter.1: {{.*}} : @_T019protocol_resilience21ReabstractSelfRefinedP8callbackxxcfs
-// CHECK-NEXT: method #ReabstractSelfRefined.callback!materializeForSet.1: {{.*}} : @_T019protocol_resilience21ReabstractSelfRefinedP8callbackxxcfm
+// CHECK-NEXT: method #ReabstractSelfRefined.callback!getter.1: {{.*}} : @_T019protocol_resilience21ReabstractSelfRefinedP8callbackxxcvg
+// CHECK-NEXT: method #ReabstractSelfRefined.callback!setter.1: {{.*}} : @_T019protocol_resilience21ReabstractSelfRefinedP8callbackxxcvs
+// CHECK-NEXT: method #ReabstractSelfRefined.callback!materializeForSet.1: {{.*}} : @_T019protocol_resilience21ReabstractSelfRefinedP8callbackxxcvm
// CHECK-NEXT: }
// CHECK-LABEL: sil_default_witness_table hidden InternalProtocol {
diff --git a/test/SILGen/protocols.swift b/test/SILGen/protocols.swift
index 91a5b21..24d4712 100644
--- a/test/SILGen/protocols.swift
+++ b/test/SILGen/protocols.swift
@@ -21,7 +21,7 @@
// CHECK-LABEL: sil hidden @{{.*}}use_subscript_rvalue_get
// CHECK: bb0(%0 : @trivial $Int):
-// CHECK: [[GLOB:%[0-9]+]] = global_addr @_T09protocols16subscriptableGetAA013SubscriptableC0_pv : $*SubscriptableGet
+// CHECK: [[GLOB:%[0-9]+]] = global_addr @_T09protocols16subscriptableGetAA013SubscriptableC0_pvp : $*SubscriptableGet
// CHECK: [[READ:%.*]] = begin_access [read] [dynamic] [[GLOB]] : $*SubscriptableGet
// CHECK: [[PROJ:%[0-9]+]] = open_existential_addr immutable_access [[READ]] : $*SubscriptableGet to $*[[OPENED:@opened(.*) SubscriptableGet]]
// CHECK: [[ALLOCSTACK:%[0-9]+]] = alloc_stack $[[OPENED]]
@@ -39,7 +39,7 @@
// CHECK-LABEL: sil hidden @{{.*}}use_subscript_lvalue_get
// CHECK: bb0(%0 : @trivial $Int):
-// CHECK: [[GLOB:%[0-9]+]] = global_addr @_T09protocols19subscriptableGetSetAA013SubscriptablecD0_pv : $*SubscriptableGetSet
+// CHECK: [[GLOB:%[0-9]+]] = global_addr @_T09protocols19subscriptableGetSetAA013SubscriptablecD0_pvp : $*SubscriptableGetSet
// CHECK: [[READ:%.*]] = begin_access [read] [dynamic] [[GLOB]] : $*SubscriptableGetSet
// CHECK: [[PROJ:%[0-9]+]] = open_existential_addr immutable_access [[READ]] : $*SubscriptableGetSet to $*[[OPENED:@opened(.*) SubscriptableGetSet]]
// CHECK: [[ALLOCSTACK:%[0-9]+]] = alloc_stack $[[OPENED]]
@@ -57,7 +57,7 @@
// CHECK-LABEL: sil hidden @{{.*}}use_subscript_lvalue_set
// CHECK: bb0(%0 : @trivial $Int):
-// CHECK: [[GLOB:%[0-9]+]] = global_addr @_T09protocols19subscriptableGetSetAA013SubscriptablecD0_pv : $*SubscriptableGetSet
+// CHECK: [[GLOB:%[0-9]+]] = global_addr @_T09protocols19subscriptableGetSetAA013SubscriptablecD0_pvp : $*SubscriptableGetSet
// CHECK: [[READ:%.*]] = begin_access [modify] [dynamic] [[GLOB]] : $*SubscriptableGetSet
// CHECK: [[PROJ:%[0-9]+]] = open_existential_addr mutable_access [[READ]] : $*SubscriptableGetSet to $*[[OPENED:@opened(.*) SubscriptableGetSet]]
// CHECK-NEXT: [[METH:%[0-9]+]] = witness_method $[[OPENED]], #SubscriptableGetSet.subscript!setter.1
@@ -128,7 +128,7 @@
return propertyGet.a
}
// CHECK-LABEL: sil hidden @{{.*}}use_property_rvalue_get
-// CHECK: [[GLOB:%[0-9]+]] = global_addr @_T09protocols11propertyGetAA18PropertyWithGetter_pv : $*PropertyWithGetter
+// CHECK: [[GLOB:%[0-9]+]] = global_addr @_T09protocols11propertyGetAA18PropertyWithGetter_pvp : $*PropertyWithGetter
// CHECK: [[READ:%.*]] = begin_access [read] [dynamic] [[GLOB]] : $*PropertyWithGetter
// CHECK: [[PROJ:%[0-9]+]] = open_existential_addr immutable_access [[READ]] : $*PropertyWithGetter to $*[[OPENED:@opened(.*) PropertyWithGetter]]
// CHECK: [[COPY:%.*]] = alloc_stack $[[OPENED]]
@@ -140,7 +140,7 @@
return propertyGetSet.b
}
// CHECK-LABEL: sil hidden @{{.*}}use_property_lvalue_get
-// CHECK: [[GLOB:%[0-9]+]] = global_addr @_T09protocols14propertyGetSetAA24PropertyWithGetterSetter_pv : $*PropertyWithGetterSetter
+// CHECK: [[GLOB:%[0-9]+]] = global_addr @_T09protocols14propertyGetSetAA24PropertyWithGetterSetter_pvp : $*PropertyWithGetterSetter
// CHECK: [[READ:%.*]] = begin_access [read] [dynamic] [[GLOB]] : $*PropertyWithGetterSetter
// CHECK: [[PROJ:%[0-9]+]] = open_existential_addr immutable_access [[READ]] : $*PropertyWithGetterSetter to $*[[OPENED:@opened(.*) PropertyWithGetterSetter]]
// CHECK: [[STACK:%[0-9]+]] = alloc_stack $[[OPENED]]
@@ -154,7 +154,7 @@
// CHECK-LABEL: sil hidden @{{.*}}use_property_lvalue_set
// CHECK: bb0(%0 : @trivial $Int):
-// CHECK: [[GLOB:%[0-9]+]] = global_addr @_T09protocols14propertyGetSetAA24PropertyWithGetterSetter_pv : $*PropertyWithGetterSetter
+// CHECK: [[GLOB:%[0-9]+]] = global_addr @_T09protocols14propertyGetSetAA24PropertyWithGetterSetter_pvp : $*PropertyWithGetterSetter
// CHECK: [[READ:%.*]] = begin_access [modify] [dynamic] [[GLOB]] : $*PropertyWithGetterSetter
// CHECK: [[PROJ:%[0-9]+]] = open_existential_addr mutable_access [[READ]] : $*PropertyWithGetterSetter to $*[[OPENED:@opened(.*) PropertyWithGetterSetter]]
// CHECK-NEXT: [[METH:%[0-9]+]] = witness_method $[[OPENED]], #PropertyWithGetterSetter.b!setter.1
@@ -253,7 +253,7 @@
// Make sure we are generating a protocol witness that calls the class method on
// ClassWithGetter.
-// CHECK-LABEL: sil private [transparent] [thunk] @_T09protocols15ClassWithGetterCAA08PropertycD0A2aDP1aSifgTW : $@convention(witness_method) (@in_guaranteed ClassWithGetter) -> Int {
+// CHECK-LABEL: sil private [transparent] [thunk] @_T09protocols15ClassWithGetterCAA08PropertycD0A2aDP1aSivgTW : $@convention(witness_method) (@in_guaranteed ClassWithGetter) -> Int {
// CHECK: bb0([[C:%.*]] : @trivial $*ClassWithGetter):
// CHECK-NEXT: [[CCOPY:%.*]] = alloc_stack $ClassWithGetter
// CHECK-NEXT: copy_addr [[C]] to [initialization] [[CCOPY]]
@@ -281,7 +281,7 @@
}
}
-// CHECK-LABEL: sil private [transparent] [thunk] @_T09protocols21ClassWithGetterSetterCAA08PropertycdE0A2aDP1bSifgTW : $@convention(witness_method) (@in_guaranteed ClassWithGetterSetter) -> Int {
+// CHECK-LABEL: sil private [transparent] [thunk] @_T09protocols21ClassWithGetterSetterCAA08PropertycdE0A2aDP1bSivgTW : $@convention(witness_method) (@in_guaranteed ClassWithGetterSetter) -> Int {
// CHECK: bb0([[C:%.*]] : @trivial $*ClassWithGetterSetter):
// CHECK-NEXT: [[CCOPY:%.*]] = alloc_stack $ClassWithGetterSetter
// CHECK-NEXT: copy_addr [[C]] to [initialization] [[CCOPY]]
@@ -337,13 +337,13 @@
// thunking code being too dumb but it is harmless to program
// correctness.
//
-// CHECK-LABEL: sil private [transparent] [thunk] @_T09protocols24StructWithStoredPropertyVAA0eC6GetterA2aDP1aSifgTW : $@convention(witness_method) (@in_guaranteed StructWithStoredProperty) -> Int {
+// CHECK-LABEL: sil private [transparent] [thunk] @_T09protocols24StructWithStoredPropertyVAA0eC6GetterA2aDP1aSivgTW : $@convention(witness_method) (@in_guaranteed StructWithStoredProperty) -> Int {
// CHECK: bb0([[C:%.*]] : @trivial $*StructWithStoredProperty):
// CHECK-NEXT: [[CCOPY:%.*]] = alloc_stack $StructWithStoredProperty
// CHECK-NEXT: copy_addr [[C]] to [initialization] [[CCOPY]]
// CHECK-NEXT: [[CCOPY_LOADED:%.*]] = load [trivial] [[CCOPY]]
// CHECK-NEXT: function_ref
-// CHECK-NEXT: [[FUN:%.*]] = function_ref @_T09protocols24StructWithStoredPropertyV1aSifg : $@convention(method) (StructWithStoredProperty) -> Int
+// CHECK-NEXT: [[FUN:%.*]] = function_ref @_T09protocols24StructWithStoredPropertyV1aSivg : $@convention(method) (StructWithStoredProperty) -> Int
// CHECK-NEXT: apply [[FUN]]([[CCOPY_LOADED]])
// CHECK-NEXT: dealloc_stack [[CCOPY]]
// CHECK-NEXT: return
@@ -367,14 +367,14 @@
// CHECK-NEXT: return %2 : $Int
}
-// CHECK-LABEL: sil private [transparent] [thunk] @_T09protocols29StructWithStoredClassPropertyVAA0fC6GetterA2aDP1aSifgTW : $@convention(witness_method) (@in_guaranteed StructWithStoredClassProperty) -> Int {
+// CHECK-LABEL: sil private [transparent] [thunk] @_T09protocols29StructWithStoredClassPropertyVAA0fC6GetterA2aDP1aSivgTW : $@convention(witness_method) (@in_guaranteed StructWithStoredClassProperty) -> Int {
// CHECK: bb0([[C:%.*]] : @trivial $*StructWithStoredClassProperty):
// CHECK-NEXT: [[CCOPY:%.*]] = alloc_stack $StructWithStoredClassProperty
// CHECK-NEXT: copy_addr [[C]] to [initialization] [[CCOPY]]
// CHECK-NEXT: [[CCOPY_LOADED:%.*]] = load [take] [[CCOPY]]
// CHECK-NEXT: [[BORROWED_CCOPY_LOADED:%.*]] = begin_borrow [[CCOPY_LOADED]]
// CHECK-NEXT: function_ref
-// CHECK-NEXT: [[FUN:%.*]] = function_ref @_T09protocols29StructWithStoredClassPropertyV1aSifg : $@convention(method) (@guaranteed StructWithStoredClassProperty) -> Int
+// CHECK-NEXT: [[FUN:%.*]] = function_ref @_T09protocols29StructWithStoredClassPropertyV1aSivg : $@convention(method) (@guaranteed StructWithStoredClassProperty) -> Int
// CHECK-NEXT: apply [[FUN]]([[BORROWED_CCOPY_LOADED]])
// CHECK-NEXT: end_borrow [[BORROWED_CCOPY_LOADED]] from [[CCOPY_LOADED]]
// CHECK-NEXT: destroy_value [[CCOPY_LOADED]]
@@ -433,23 +433,23 @@
// CHECK: apply [[CALLBACK]]<T>
// CHECK-LABEL: sil_witness_table hidden ClassWithGetter: PropertyWithGetter module protocols {
-// CHECK-NEXT: method #PropertyWithGetter.a!getter.1: {{.*}} : @_T09protocols15ClassWithGetterCAA08PropertycD0A2aDP1aSifgTW
+// CHECK-NEXT: method #PropertyWithGetter.a!getter.1: {{.*}} : @_T09protocols15ClassWithGetterCAA08PropertycD0A2aDP1aSivgTW
// CHECK-NEXT: }
// CHECK-LABEL: sil_witness_table hidden ClassWithGetterSetter: PropertyWithGetterSetter module protocols {
-// CHECK-NEXT: method #PropertyWithGetterSetter.b!getter.1: {{.*}} : @_T09protocols21ClassWithGetterSetterCAA08PropertycdE0A2aDP1bSifgTW
-// CHECK-NEXT: method #PropertyWithGetterSetter.b!setter.1: {{.*}} : @_T09protocols21ClassWithGetterSetterCAA08PropertycdE0A2aDP1bSifsTW
-// CHECK-NEXT: method #PropertyWithGetterSetter.b!materializeForSet.1: {{.*}} : @_T09protocols21ClassWithGetterSetterCAA08PropertycdE0A2aDP1bSifmTW
+// CHECK-NEXT: method #PropertyWithGetterSetter.b!getter.1: {{.*}} : @_T09protocols21ClassWithGetterSetterCAA08PropertycdE0A2aDP1bSivgTW
+// CHECK-NEXT: method #PropertyWithGetterSetter.b!setter.1: {{.*}} : @_T09protocols21ClassWithGetterSetterCAA08PropertycdE0A2aDP1bSivsTW
+// CHECK-NEXT: method #PropertyWithGetterSetter.b!materializeForSet.1: {{.*}} : @_T09protocols21ClassWithGetterSetterCAA08PropertycdE0A2aDP1bSivmTW
// CHECK-NEXT: }
// CHECK-LABEL: sil_witness_table hidden ClassWithGetterSetter: PropertyWithGetter module protocols {
-// CHECK-NEXT: method #PropertyWithGetter.a!getter.1: {{.*}} : @_T09protocols21ClassWithGetterSetterCAA08PropertycD0A2aDP1aSifgTW
+// CHECK-NEXT: method #PropertyWithGetter.a!getter.1: {{.*}} : @_T09protocols21ClassWithGetterSetterCAA08PropertycD0A2aDP1aSivgTW
// CHECK-NEXT: }
// CHECK-LABEL: sil_witness_table hidden StructWithStoredProperty: PropertyWithGetter module protocols {
-// CHECK-NEXT: method #PropertyWithGetter.a!getter.1: {{.*}} : @_T09protocols24StructWithStoredPropertyVAA0eC6GetterA2aDP1aSifgTW
+// CHECK-NEXT: method #PropertyWithGetter.a!getter.1: {{.*}} : @_T09protocols24StructWithStoredPropertyVAA0eC6GetterA2aDP1aSivgTW
// CHECK-NEXT: }
// CHECK-LABEL: sil_witness_table hidden StructWithStoredClassProperty: PropertyWithGetter module protocols {
-// CHECK-NEXT: method #PropertyWithGetter.a!getter.1: {{.*}} : @_T09protocols29StructWithStoredClassPropertyVAA0fC6GetterA2aDP1aSifgTW
+// CHECK-NEXT: method #PropertyWithGetter.a!getter.1: {{.*}} : @_T09protocols29StructWithStoredClassPropertyVAA0fC6GetterA2aDP1aSivgTW
// CHECK-NEXT: }
diff --git a/test/SILGen/reabstract-tuple.swift b/test/SILGen/reabstract-tuple.swift
index eb7384b..dac9bc7 100644
--- a/test/SILGen/reabstract-tuple.swift
+++ b/test/SILGen/reabstract-tuple.swift
@@ -1,4 +1,4 @@
-// RUN: %target-swift-frontend -emit-silgen -verify %s
+// RUN: %target-swift-frontend -enable-sil-ownership -emit-silgen -verify %s | %FileCheck %s
// SR-3090:
@@ -10,9 +10,52 @@
}
}
-let box = Box((22, { () in }))
-let foo = box.value.0
-print(foo)
+// CHECK: sil @_T04main7testBoxyyF : $@convention(thin) () -> () {
+// CHECK: bb0:
+// CHECK: // function_ref Box.__allocating_init(_:)
+// CHECK: [[INIT_F:%.*]] = function_ref @_T04main3BoxCACyxGxcfC : $@convention(method) <τ_0_0> (@in τ_0_0, @thick Box<τ_0_0>.Type) -> @owned Box<τ_0_0> // user: %26
+// CHECK: // function_ref closure #1 in testBox()
+// CHECK: [[CLOSURE:%.*]] = function_ref @_T04main7testBoxyyFyycfU_ : $@convention(thin) () -> ()
+// CHECK: [[THICK:%.*]] = thin_to_thick_function [[CLOSURE]] : $@convention(thin) () -> () to $@callee_owned () -> ()
+// CHECK: [[TUPLEA:%.*]] = tuple (%{{.*}} : $Int, [[THICK]] : $@callee_owned () -> ())
+// CHECK: [[BORROWA:%.*]] = begin_borrow [[TUPLEA]] : $(Int, @callee_owned () -> ())
+// CHECK: [[ELTA_0:%.*]] = tuple_extract [[BORROWA]] : $(Int, @callee_owned () -> ()), 0
+// CHECK: [[ELTA_1:%.*]] = tuple_extract [[BORROWA]] : $(Int, @callee_owned () -> ()), 1
+// CHECK: [[COPYA_1:%.*]] = copy_value [[ELTA_1]] : $@callee_owned () -> ()
+// CHECK: end_borrow [[BORROWA]] from %{{.*}} : $(Int, @callee_owned () -> ()), $(Int, @callee_owned () -> ())
+// CHECK: [[THUNK1:%.*]] = function_ref @_T0Ix_ytytIxir_TR : $@convention(thin) (@in (), @owned @callee_owned () -> ()) -> @out ()
+// CHECK: [[PA:%.*]] = partial_apply [[THUNK1]]([[COPYA_1]]) : $@convention(thin) (@in (), @owned @callee_owned () -> ()) -> @out ()
+// CHECK: [[TUPLEB:%.*]] = tuple ([[ELTA_0]] : $Int, [[PA]] : $@callee_owned (@in ()) -> @out ())
+// CHECK: [[BORROWB:%.*]] = begin_borrow [[TUPLEB]] : $(Int, @callee_owned (@in ()) -> @out ())
+// CHECK: [[TUPLEB_0:%.*]] = tuple_extract [[BORROWB]] : $(Int, @callee_owned (@in ()) -> @out ()), 0
+// CHECK: [[TUPLEB_1:%.*]] = tuple_extract [[BORROWB]] : $(Int, @callee_owned (@in ()) -> @out ()), 1
+// CHECK: [[COPYB_1:%.*]] = copy_value [[TUPLEB_1]] : $@callee_owned (@in ()) -> @out ()
+// CHECK: [[CALL:%.*]] = apply [[INIT_F]]<(Int, () -> ())>(%{{.*}}, %{{.*}}) : $@convention(method) <τ_0_0> (@in τ_0_0, @thick Box<τ_0_0>.Type) -> @owned Box<τ_0_0>
+// CHECK: end_borrow [[BORROWB]] from %{{.*}} : $(Int, @callee_owned (@in ()) -> @out ()), $(Int, @callee_owned (@in ()) -> @out ())
+// CHECK: destroy_value [[TUPLEB]] : $(Int, @callee_owned (@in ()) -> @out ())
+// CHECK: destroy_value [[TUPLEA]] : $(Int, @callee_owned () -> ())
+// CHECK: [[BORROW_CALL:%.*]] = begin_borrow [[CALL]] : $Box<(Int, () -> ())>
+// CHECK: [[REF:%.*]] = ref_element_addr [[BORROW_CALL]] : $Box<(Int, () -> ())>, #Box.value
+// CHECK: [[READ:%.*]] = begin_access [read] [dynamic] [[REF]] : $*(Int, @callee_owned (@in ()) -> @out ())
+// CHECK: [[TUPLEC:%.*]] = load [copy] [[READ]] : $*(Int, @callee_owned (@in ()) -> @out ())
+// CHECK: [[BORROW_TUPLEC:%.*]] = begin_borrow [[TUPLEC]] : $(Int, @callee_owned (@in ()) -> @out ())
+// CHECK: [[TUPLEC_0:%.*]] = tuple_extract [[BORROW_TUPLEC]] : $(Int, @callee_owned (@in ()) -> @out ()), 0
+// CHECK: [[TUPLEC_1:%.*]] = tuple_extract [[BORROW_TUPLEC]] : $(Int, @callee_owned (@in ()) -> @out ()), 1
+// CHECK: [[COPYC_1:%.*]] = copy_value [[TUPLEC_1]] : $@callee_owned (@in ()) -> @out ()
+// CHECK: [[THUNK2:%.*]] = function_ref @_T0ytytIxir_Ix_TR : $@convention(thin) (@owned @callee_owned (@in ()) -> @out ()) -> ()
+// CHECK: [[PA2:%.*]] = partial_apply [[THUNK2]]([[COPYC_1]]) : $@convention(thin) (@owned @callee_owned (@in ()) -> @out ()) -> ()
+// CHECK: end_access [[READ]] : $*(Int, @callee_owned (@in ()) -> @out ())
+// CHECK: destroy_value [[PA2]] : $@callee_owned () -> ()
+// CHECK: end_borrow [[BORROW_TUPLEC]] from %{{.*}} : $(Int, @callee_owned (@in ()) -> @out ()), $(Int, @callee_owned (@in ()) -> @out ())
+// CHECK: destroy_value [[TUPLEC]] : $(Int, @callee_owned (@in ()) -> @out ())
+// CHECK: end_borrow [[BORROW_CALL]] from %{{.*}} : $Box<(Int, () -> ())>, $Box<(Int, () -> ())>
+// CHECK-LABEL: } // end sil function '_T04main7testBoxyyF'
+public func testBox() {
+ let box = Box((22, { () in }))
+ let foo = box.value.0
+ print(foo)
+}
+
// Another crash -- re-abstracting function type inside optional in tuple
// in-place
diff --git a/test/SILGen/scalar_to_tuple_args.swift b/test/SILGen/scalar_to_tuple_args.swift
index 06be998..8ba1090 100644
--- a/test/SILGen/scalar_to_tuple_args.swift
+++ b/test/SILGen/scalar_to_tuple_args.swift
@@ -12,7 +12,7 @@
func variadicSecond(_ x: Int, _ y: Int...) {}
var x = 0
-// CHECK: [[X_ADDR:%.*]] = global_addr @_T020scalar_to_tuple_args1xSiv : $*Int
+// CHECK: [[X_ADDR:%.*]] = global_addr @_T020scalar_to_tuple_args1xSivp : $*Int
// CHECK: [[INOUT_WITH_DEFAULTS:%.*]] = function_ref @_T020scalar_to_tuple_args17inoutWithDefaultsySiz_Si1ySi1ztF
// CHECK: [[DEFAULT_Y:%.*]] = apply {{.*}} : $@convention(thin) () -> Int
// CHECK: [[DEFAULT_Z:%.*]] = apply {{.*}} : $@convention(thin) () -> Int
diff --git a/test/SILGen/specialize_attr.swift b/test/SILGen/specialize_attr.swift
index 98c7e24..69a76e9 100644
--- a/test/SILGen/specialize_attr.swift
+++ b/test/SILGen/specialize_attr.swift
@@ -64,13 +64,13 @@
}
// ASubscriptable.subscript.getter with _specialize
-// CHECK-LABEL: sil [_specialize exported: false, kind: full, where Element == Int] @_T015specialize_attr14ASubscriptableC9subscriptxSicfg : $@convention(method) <Element> (Int, @guaranteed ASubscriptable<Element>) -> @out Element {
+// CHECK-LABEL: sil [_specialize exported: false, kind: full, where Element == Int] @_T015specialize_attr14ASubscriptableCxSicig : $@convention(method) <Element> (Int, @guaranteed ASubscriptable<Element>) -> @out Element {
// ASubscriptable.subscript.setter with _specialize
-// CHECK-LABEL: sil [_specialize exported: false, kind: full, where Element == Int] @_T015specialize_attr14ASubscriptableC9subscriptxSicfs : $@convention(method) <Element> (@in Element, Int, @guaranteed ASubscriptable<Element>) -> () {
+// CHECK-LABEL: sil [_specialize exported: false, kind: full, where Element == Int] @_T015specialize_attr14ASubscriptableCxSicis : $@convention(method) <Element> (@in Element, Int, @guaranteed ASubscriptable<Element>) -> () {
// ASubscriptable.subscript.materializeForSet with no attribute
-// CHECK-LABEL: sil [transparent] [serialized] @_T015specialize_attr14ASubscriptableC9subscriptxSicfm : $@convention(method) <Element> (Builtin.RawPointer, @inout Builtin.UnsafeValueBuffer, Int, @guaranteed ASubscriptable<Element>) -> (Builtin.RawPointer, Optional<Builtin.RawPointer>) {
+// CHECK-LABEL: sil [transparent] [serialized] @_T015specialize_attr14ASubscriptableCxSicim : $@convention(method) <Element> (Builtin.RawPointer, @inout Builtin.UnsafeValueBuffer, Int, @guaranteed ASubscriptable<Element>) -> (Builtin.RawPointer, Optional<Builtin.RawPointer>) {
public class Addressable<Element> : TestSubscriptable {
var storage: UnsafeMutablePointer<Element>
@@ -92,17 +92,17 @@
}
// Addressable.subscript.getter with no attribute
-// CHECK-LABEL: sil [transparent] [serialized] @_T015specialize_attr11AddressableC9subscriptxSicfg : $@convention(method) <Element> (Int, @guaranteed Addressable<Element>) -> @out Element {
+// CHECK-LABEL: sil [transparent] [serialized] @_T015specialize_attr11AddressableCxSicig : $@convention(method) <Element> (Int, @guaranteed Addressable<Element>) -> @out Element {
// Addressable.subscript.unsafeAddressor with _specialize
-// CHECK-LABEL: sil [_specialize exported: false, kind: full, where Element == Int] @_T015specialize_attr11AddressableC9subscriptxSicflu : $@convention(method) <Element> (Int, @guaranteed Addressable<Element>) -> UnsafePointer<Element> {
+// CHECK-LABEL: sil [_specialize exported: false, kind: full, where Element == Int] @_T015specialize_attr11AddressableCxSicilu : $@convention(method) <Element> (Int, @guaranteed Addressable<Element>) -> UnsafePointer<Element> {
// Addressable.subscript.setter with no attribute
-// CHECK-LABEL: sil [transparent] [serialized] @_T015specialize_attr11AddressableC9subscriptxSicfs : $@convention(method) <Element> (@in Element, Int, @guaranteed Addressable<Element>) -> () {
+// CHECK-LABEL: sil [transparent] [serialized] @_T015specialize_attr11AddressableCxSicis : $@convention(method) <Element> (@in Element, Int, @guaranteed Addressable<Element>) -> () {
// Addressable.subscript.unsafeMutableAddressor with _specialize
-// CHECK-LABEL: sil [_specialize exported: false, kind: full, where Element == Int] @_T015specialize_attr11AddressableC9subscriptxSicfau : $@convention(method) <Element> (Int, @guaranteed Addressable<Element>) -> UnsafeMutablePointer<Element> {
+// CHECK-LABEL: sil [_specialize exported: false, kind: full, where Element == Int] @_T015specialize_attr11AddressableCxSiciau : $@convention(method) <Element> (Int, @guaranteed Addressable<Element>) -> UnsafeMutablePointer<Element> {
// Addressable.subscript.materializeForSet with no attribute
-// CHECK-LABEL: sil [transparent] [serialized] @_T015specialize_attr11AddressableC9subscriptxSicfm : $@convention(method) <Element> (Builtin.RawPointer, @inout Builtin.UnsafeValueBuffer, Int, @guaranteed Addressable<Element>) -> (Builtin.RawPointer, Optional<Builtin.RawPointer>) {
+// CHECK-LABEL: sil [transparent] [serialized] @_T015specialize_attr11AddressableCxSicim : $@convention(method) <Element> (Builtin.RawPointer, @inout Builtin.UnsafeValueBuffer, Int, @guaranteed Addressable<Element>) -> (Builtin.RawPointer, Optional<Builtin.RawPointer>) {
diff --git a/test/SILGen/statements.swift b/test/SILGen/statements.swift
index 720b141..82f573d 100644
--- a/test/SILGen/statements.swift
+++ b/test/SILGen/statements.swift
@@ -411,7 +411,7 @@
// CHECK: apply [[BAR]](
bar(1)
- // CHECK: [[GLOBAL:%.*]] = function_ref @_T010statements11global_condSbfau
+ // CHECK: [[GLOBAL:%.*]] = function_ref @_T010statements11global_condSbvau
// CHECK: cond_br {{%.*}}, bb2, bb3
if (global_cond) {
// CHECK: bb2:
@@ -426,7 +426,7 @@
// CHECK: apply [[BAR]](
bar(2)
- // CHECK: [[GLOBAL:%.*]] = function_ref @_T010statements11global_condSbfau
+ // CHECK: [[GLOBAL:%.*]] = function_ref @_T010statements11global_condSbvau
// CHECK: cond_br {{%.*}}, bb4, bb5
if (global_cond) {
// CHECK: bb4:
diff --git a/test/SILGen/static-stored-properties-in-concrete-contexts.swift b/test/SILGen/static-stored-properties-in-concrete-contexts.swift
index 789eaf3..e636fce 100644
--- a/test/SILGen/static-stored-properties-in-concrete-contexts.swift
+++ b/test/SILGen/static-stored-properties-in-concrete-contexts.swift
@@ -6,11 +6,11 @@
extension Foo where T == Int {
// CHECK: sil_global private [[X_TOKEN:@.*]] : $Builtin.Word
- // CHECK: sil_global hidden [let] @_T04main3FooVAASiRszlE1xSivZ : $Int
+ // CHECK: sil_global hidden [let] @_T04main3FooVAASiRszlE1xSivpZ : $Int
static let x = foo
// CHECK: sil_global private [[Y_TOKEN:@.*]] : $Builtin.Word
- // CHECK: sil_global hidden @_T04main3FooVAASiRszlE1ySivZ : $Int
+ // CHECK: sil_global hidden @_T04main3FooVAASiRszlE1ySivpZ : $Int
static var y = foo
}
diff --git a/test/SILGen/struct_resilience.swift b/test/SILGen/struct_resilience.swift
index f53b162..beb7461 100644
--- a/test/SILGen/struct_resilience.swift
+++ b/test/SILGen/struct_resilience.swift
@@ -16,16 +16,16 @@
// CHECK: copy_addr %1 to [initialization] [[OTHER_SIZE_BOX:%[0-9]*]] : $*Size
var s2 = s
-// CHECK: [[SETTER:%.*]] = function_ref @_T016resilient_struct4SizeV1wSifs : $@convention(method) (Int, @inout Size) -> ()
+// CHECK: [[SETTER:%.*]] = function_ref @_T016resilient_struct4SizeV1wSivs : $@convention(method) (Int, @inout Size) -> ()
// CHECK: copy_addr %1 to [initialization] [[SIZE_BOX:%.*]] : $*Size
-// CHECK: [[GETTER:%.*]] = function_ref @_T016resilient_struct4SizeV1wSifg : $@convention(method) (@in_guaranteed Size) -> Int
+// CHECK: [[GETTER:%.*]] = function_ref @_T016resilient_struct4SizeV1wSivg : $@convention(method) (@in_guaranteed Size) -> Int
// CHECK: [[RESULT:%.*]] = apply [[GETTER]]([[SIZE_BOX]])
// CHECK: [[WRITE:%.*]] = begin_access [modify] [unknown] [[OTHER_SIZE_BOX]] : $*Size
// CHECK: apply [[SETTER]]([[RESULT]], [[WRITE]])
s2.w = s.w
// CHECK: copy_addr %1 to [initialization] [[SIZE_BOX:%.*]] : $*Size
-// CHECK: [[FN:%.*]] = function_ref @_T016resilient_struct4SizeV1hSifg : $@convention(method) (@in_guaranteed Size) -> Int
+// CHECK: [[FN:%.*]] = function_ref @_T016resilient_struct4SizeV1hSivg : $@convention(method) (@in_guaranteed Size) -> Int
// CHECK: [[RESULT:%.*]] = apply [[FN]]([[SIZE_BOX]])
_ = s.h
@@ -46,7 +46,7 @@
func resilientInOutTest(_ s: inout Size) {
// CHECK: function_ref @_T017struct_resilience9inoutFuncySizF
-// CHECK: function_ref @_T016resilient_struct4SizeV1wSifm
+// CHECK: function_ref @_T016resilient_struct4SizeV1wSivm
inoutFunc(&s.w)
@@ -91,9 +91,9 @@
// Static computed property
-// CHECK-LABEL: sil @_T017struct_resilience6MySizeV10expirationSifgZ : $@convention(method) (@thin MySize.Type) -> Int
-// CHECK-LABEL: sil @_T017struct_resilience6MySizeV10expirationSifsZ : $@convention(method) (Int, @thin MySize.Type) -> ()
-// CHECK-LABEL: sil @_T017struct_resilience6MySizeV10expirationSifmZ : $@convention(method) (Builtin.RawPointer, @inout Builtin.UnsafeValueBuffer, @thin MySize.Type) -> (Builtin.RawPointer, Optional<Builtin.RawPointer>)
+// CHECK-LABEL: sil @_T017struct_resilience6MySizeV10expirationSivgZ : $@convention(method) (@thin MySize.Type) -> Int
+// CHECK-LABEL: sil @_T017struct_resilience6MySizeV10expirationSivsZ : $@convention(method) (Int, @thin MySize.Type) -> ()
+// CHECK-LABEL: sil @_T017struct_resilience6MySizeV10expirationSivmZ : $@convention(method) (Builtin.RawPointer, @inout Builtin.UnsafeValueBuffer, @thin MySize.Type) -> (Builtin.RawPointer, Optional<Builtin.RawPointer>)
public static var expiration: Int {
get { return copyright + 70 }
set { copyright = newValue - 70 }
@@ -101,9 +101,9 @@
// Instance computed property
-// CHECK-LABEL: sil @_T017struct_resilience6MySizeV1dSifg : $@convention(method) (@in_guaranteed MySize) -> Int
-// CHECK-LABEL: sil @_T017struct_resilience6MySizeV1dSifs : $@convention(method) (Int, @inout MySize) -> ()
-// CHECK-LABEL: sil @_T017struct_resilience6MySizeV1dSifm : $@convention(method) (Builtin.RawPointer, @inout Builtin.UnsafeValueBuffer, @inout MySize) -> (Builtin.RawPointer, Optional<Builtin.RawPointer>)
+// CHECK-LABEL: sil @_T017struct_resilience6MySizeV1dSivg : $@convention(method) (@in_guaranteed MySize) -> Int
+// CHECK-LABEL: sil @_T017struct_resilience6MySizeV1dSivs : $@convention(method) (Int, @inout MySize) -> ()
+// CHECK-LABEL: sil @_T017struct_resilience6MySizeV1dSivm : $@convention(method) (Builtin.RawPointer, @inout Builtin.UnsafeValueBuffer, @inout MySize) -> (Builtin.RawPointer, Optional<Builtin.RawPointer>)
public var d: Int {
get { return 0 }
set { }
@@ -111,21 +111,21 @@
// Instance stored property
-// CHECK-LABEL: sil @_T017struct_resilience6MySizeV1wSifg : $@convention(method) (@in_guaranteed MySize) -> Int
-// CHECK-LABEL: sil @_T017struct_resilience6MySizeV1wSifs : $@convention(method) (Int, @inout MySize) -> ()
-// CHECK-LABEL: sil @_T017struct_resilience6MySizeV1wSifm : $@convention(method) (Builtin.RawPointer, @inout Builtin.UnsafeValueBuffer, @inout MySize) -> (Builtin.RawPointer, Optional<Builtin.RawPointer>)
+// CHECK-LABEL: sil @_T017struct_resilience6MySizeV1wSivg : $@convention(method) (@in_guaranteed MySize) -> Int
+// CHECK-LABEL: sil @_T017struct_resilience6MySizeV1wSivs : $@convention(method) (Int, @inout MySize) -> ()
+// CHECK-LABEL: sil @_T017struct_resilience6MySizeV1wSivm : $@convention(method) (Builtin.RawPointer, @inout Builtin.UnsafeValueBuffer, @inout MySize) -> (Builtin.RawPointer, Optional<Builtin.RawPointer>)
public var w: Int
// Read-only instance stored property
-// CHECK-LABEL: sil @_T017struct_resilience6MySizeV1hSifg : $@convention(method) (@in_guaranteed MySize) -> Int
+// CHECK-LABEL: sil @_T017struct_resilience6MySizeV1hSivg : $@convention(method) (@in_guaranteed MySize) -> Int
public let h: Int
// Static stored property
-// CHECK-LABEL: sil @_T017struct_resilience6MySizeV9copyrightSifgZ : $@convention(method) (@thin MySize.Type) -> Int
-// CHECK-LABEL: sil @_T017struct_resilience6MySizeV9copyrightSifsZ : $@convention(method) (Int, @thin MySize.Type) -> ()
-// CHECK-LABEL: sil @_T017struct_resilience6MySizeV9copyrightSifmZ : $@convention(method) (Builtin.RawPointer, @inout Builtin.UnsafeValueBuffer, @thin MySize.Type) -> (Builtin.RawPointer, Optional<Builtin.RawPointer>)
+// CHECK-LABEL: sil @_T017struct_resilience6MySizeV9copyrightSivgZ : $@convention(method) (@thin MySize.Type) -> Int
+// CHECK-LABEL: sil @_T017struct_resilience6MySizeV9copyrightSivsZ : $@convention(method) (Int, @thin MySize.Type) -> ()
+// CHECK-LABEL: sil @_T017struct_resilience6MySizeV9copyrightSivmZ : $@convention(method) (Builtin.RawPointer, @inout Builtin.UnsafeValueBuffer, @thin MySize.Type) -> (Builtin.RawPointer, Optional<Builtin.RawPointer>)
public static var copyright: Int = 0
}
@@ -166,7 +166,7 @@
// CHECK: [[SELF:%.*]] = alloc_stack $MySize
// CHECK-NEXT: copy_addr %0 to [initialization] [[SELF]]
-// CHECK: [[GETTER:%.*]] = function_ref @_T017struct_resilience6MySizeV1wSifg
+// CHECK: [[GETTER:%.*]] = function_ref @_T017struct_resilience6MySizeV1wSivg
// CHECK-NEXT: [[RESULT:%.*]] = apply [[GETTER]]([[SELF]])
// CHECK-NEXT: destroy_addr [[SELF]]
// CHECK-NEXT: dealloc_stack [[SELF]]
@@ -179,7 +179,7 @@
@_transparent public func publicTransparentLocalFunction(_ s: MySize) -> () -> Int {
// CHECK-LABEL: sil shared [serialized] @_T017struct_resilience30publicTransparentLocalFunctionSiycAA6MySizeVFSiycfU_ : $@convention(thin) (@owned { var MySize }) -> Int
-// CHECK: function_ref @_T017struct_resilience6MySizeV1wSifg : $@convention(method) (@in_guaranteed MySize) -> Int
+// CHECK: function_ref @_T017struct_resilience6MySizeV1wSivg : $@convention(method) (@in_guaranteed MySize) -> Int
// CHECK: return {{.*}} : $Int
return { s.w }
@@ -209,7 +209,7 @@
// CHECK: [[SELF:%.*]] = alloc_stack $MySize
// CHECK-NEXT: copy_addr %0 to [initialization] [[SELF]]
-// CHECK: [[GETTER:%.*]] = function_ref @_T017struct_resilience6MySizeV1wSifg
+// CHECK: [[GETTER:%.*]] = function_ref @_T017struct_resilience6MySizeV1wSivg
// CHECK-NEXT: [[RESULT:%.*]] = apply [[GETTER]]([[SELF]])
// CHECK-NEXT: destroy_addr [[SELF]]
// CHECK-NEXT: dealloc_stack [[SELF]]
@@ -236,8 +236,8 @@
@_transparent func useVersionedResilientStruct(_ s: VersionedResilientStruct)
-> VersionedResilientStruct {
// CHECK: function_ref @_T017struct_resilience24VersionedResilientStructVACSi1x_Si1ytcfC
- // CHECK: function_ref @_T017struct_resilience24VersionedResilientStructV1ySifg
- // CHECK: function_ref @_T017struct_resilience24VersionedResilientStructV1xSifg
+ // CHECK: function_ref @_T017struct_resilience24VersionedResilientStructV1ySivg
+ // CHECK: function_ref @_T017struct_resilience24VersionedResilientStructV1xSivg
return VersionedResilientStruct(x: s.y, y: s.x)
}
diff --git a/test/SILGen/super.swift b/test/SILGen/super.swift
index 4b23295..7352f46 100644
--- a/test/SILGen/super.swift
+++ b/test/SILGen/super.swift
@@ -31,11 +31,11 @@
}
public class Child : Parent {
- // CHECK-LABEL: sil @_T05super5ChildC8propertySSfg : $@convention(method) (@guaranteed Child) -> @owned String {
+ // CHECK-LABEL: sil @_T05super5ChildC8propertySSvg : $@convention(method) (@guaranteed Child) -> @owned String {
// CHECK: bb0([[SELF:%.*]] : $Child):
// CHECK: [[SELF_COPY:%.*]] = copy_value [[SELF]]
// CHECK: [[CASTED_SELF_COPY:%[0-9]+]] = upcast [[SELF_COPY]] : $Child to $Parent
- // CHECK: [[SUPER_METHOD:%[0-9]+]] = function_ref @_T05super6ParentC8propertySSfg : $@convention(method) (@guaranteed Parent) -> @owned String
+ // CHECK: [[SUPER_METHOD:%[0-9]+]] = function_ref @_T05super6ParentC8propertySSvg : $@convention(method) (@guaranteed Parent) -> @owned String
// CHECK: [[RESULT:%.*]] = apply [[SUPER_METHOD]]([[CASTED_SELF_COPY]])
// CHECK: destroy_value [[CASTED_SELF_COPY]]
// CHECK: return [[RESULT]]
@@ -43,11 +43,11 @@
return super.property
}
- // CHECK-LABEL: sil @_T05super5ChildC13otherPropertySSfg : $@convention(method) (@guaranteed Child) -> @owned String {
+ // CHECK-LABEL: sil @_T05super5ChildC13otherPropertySSvg : $@convention(method) (@guaranteed Child) -> @owned String {
// CHECK: bb0([[SELF:%.*]] : $Child):
// CHECK: [[COPIED_SELF:%.*]] = copy_value [[SELF]]
// CHECK: [[CASTED_SELF_COPY:%[0-9]+]] = upcast [[COPIED_SELF]] : $Child to $Parent
- // CHECK: [[SUPER_METHOD:%[0-9]+]] = function_ref @_T05super6ParentC13finalPropertySSfg
+ // CHECK: [[SUPER_METHOD:%[0-9]+]] = function_ref @_T05super6ParentC13finalPropertySSvg
// CHECK: [[RESULT:%.*]] = apply [[SUPER_METHOD]]([[CASTED_SELF_COPY]])
// CHECK: destroy_value [[CASTED_SELF_COPY]]
// CHECK: return [[RESULT]]
diff --git a/test/SILGen/toplevel.swift b/test/SILGen/toplevel.swift
index b88968b..3b021b0 100644
--- a/test/SILGen/toplevel.swift
+++ b/test/SILGen/toplevel.swift
@@ -12,7 +12,7 @@
// -- initialize x
// CHECK: alloc_global @_T08toplevel1xSiv
-// CHECK: [[X:%[0-9]+]] = global_addr @_T08toplevel1xSiv : $*Int
+// CHECK: [[X:%[0-9]+]] = global_addr @_T08toplevel1xSivp : $*Int
// CHECK: integer_literal $Builtin.Int2048, 999
// CHECK: store {{.*}} to [trivial] [[X]]
@@ -35,7 +35,7 @@
// <rdar://problem/19770775> Deferred initialization of let bindings rejected at top level in playground
// CHECK: alloc_global @_T08toplevel5countSiv
-// CHECK: [[COUNTADDR:%[0-9]+]] = global_addr @_T08toplevel5countSiv : $*Int
+// CHECK: [[COUNTADDR:%[0-9]+]] = global_addr @_T08toplevel5countSivp : $*Int
// CHECK-NEXT: [[COUNTMUI:%[0-9]+]] = mark_uninitialized [var] [[COUNTADDR]] : $*Int
let count: Int
// CHECK: cond_br
@@ -64,7 +64,7 @@
// -- assign y
// CHECK: alloc_global @_T08toplevel1ySiv
-// CHECK: [[Y1:%[0-9]+]] = global_addr @_T08toplevel1ySiv : $*Int
+// CHECK: [[Y1:%[0-9]+]] = global_addr @_T08toplevel1ySivp : $*Int
// CHECK: [[Y:%[0-9]+]] = mark_uninitialized [var] [[Y1]]
// CHECK: [[WRITE:%.*]] = begin_access [modify] [dynamic] [[Y]]
// CHECK: assign {{.*}} to [[WRITE]]
@@ -117,7 +117,7 @@
// CHECK: sil hidden @_T08toplevel13testGlobalCSESiyF
// CHECK-NOT: global_addr
-// CHECK: %0 = global_addr @_T08toplevel1xSiv : $*Int
+// CHECK: %0 = global_addr @_T08toplevel1xSivp : $*Int
// CHECK-NOT: global_addr
// CHECK: return
func testGlobalCSE() -> Int {
diff --git a/test/SILGen/transparent_attribute.swift b/test/SILGen/transparent_attribute.swift
index a7f432e..8174a77 100644
--- a/test/SILGen/transparent_attribute.swift
+++ b/test/SILGen/transparent_attribute.swift
@@ -72,13 +72,13 @@
var m1 : MySt = x1
var m2 : MySt = x2
// CHECK-APPLY: sil hidden @_T021transparent_attribute12testPropertyyAA4MyStV1z_tF
- // CHECK: function_ref @_T021transparent_attribute2x1AA4MyStVfs
+ // CHECK: function_ref @_T021transparent_attribute2x1AA4MyStVvs
// CHECK-NEXT: apply
- // CHECK: function_ref @_T021transparent_attribute2x2AA4MyStVfs
+ // CHECK: function_ref @_T021transparent_attribute2x2AA4MyStVvs
// CHECK-NEXT: apply
- // CHECK: function_ref @_T021transparent_attribute2x1AA4MyStVfg
+ // CHECK: function_ref @_T021transparent_attribute2x1AA4MyStVvg
// CHECK-NEXT: apply
- // CHECK: function_ref @_T021transparent_attribute2x2AA4MyStVfg
+ // CHECK: function_ref @_T021transparent_attribute2x2AA4MyStVvg
// CHECK-NEXT: apply
}
@@ -122,9 +122,9 @@
// CHECK: apply [[INIT]]
// CHECK: [[TR1:%[0-9]+]] = function_ref @_T021transparent_attribute14MyTranspStructV3tr1{{[_0-9a-zA-Z]*}}F
// CHECK: apply [[TR1]]
- // CHECK: [[TR2:%[0-9]+]] = function_ref @_T021transparent_attribute14MyTranspStructV3tr2AA0C2StVfg
+ // CHECK: [[TR2:%[0-9]+]] = function_ref @_T021transparent_attribute14MyTranspStructV3tr2AA0C2StVvg
// CHECK: apply [[TR2]]
- // CHECK: [[TR3:%[0-9]+]] = function_ref @_T021transparent_attribute14MyTranspStructV3tr3AA0C2StVfg
+ // CHECK: [[TR3:%[0-9]+]] = function_ref @_T021transparent_attribute14MyTranspStructV3tr3AA0C2StVvg
// CHECK: apply [[TR3]]
}
@@ -159,7 +159,7 @@
func testVarDeclFoo () {
var z: Int = max
// CHECK-APPLY: sil hidden @_T021transparent_attribute11testVarDeclV0cdE3Foo{{[_0-9a-zA-Z]*}}F
- // CHECK: [[TR4:%[0-9]+]] = function_ref @_T021transparent_attribute11testVarDeclV3maxSifg
+ // CHECK: [[TR4:%[0-9]+]] = function_ref @_T021transparent_attribute11testVarDeclV3maxSivg
// CHECK: apply [[TR4]]
}
}
@@ -169,7 +169,7 @@
func testVarDeclShortenedSyntaxfoo () {
var z: Int = testVarDeclShortenedSyntax.max
// CHECK-APPLY: sil hidden @_T021transparent_attribute26testVarDeclShortenedSyntaxV0cdeF9Syntaxfoo{{[_0-9a-zA-Z]*}}F
- // CHECK: [[TR5:%[0-9]+]] = function_ref @_T021transparent_attribute26testVarDeclShortenedSyntaxV3maxSifgZ
+ // CHECK: [[TR5:%[0-9]+]] = function_ref @_T021transparent_attribute26testVarDeclShortenedSyntaxV3maxSivgZ
// CHECK: apply [[TR5]]
}
};
@@ -179,7 +179,7 @@
return 0xFF
}
}
-// CHECK: sil hidden [transparent] @_T021transparent_attribute0A11OnGlobalVarSifg
+// CHECK: sil hidden [transparent] @_T021transparent_attribute0A11OnGlobalVarSivg
// Local functions in transparent context are fragile.
@_transparent public func foo() {
diff --git a/test/SILGen/tsan_instrumentation.swift b/test/SILGen/tsan_instrumentation.swift
index 06f1fc6..2bf6ec0 100644
--- a/test/SILGen/tsan_instrumentation.swift
+++ b/test/SILGen/tsan_instrumentation.swift
@@ -17,7 +17,7 @@
var gClass = MyClass()
// CHECK-LABEL: sil hidden @_T020tsan_instrumentation17inoutGlobalStructyyF : $@convention(thin) () -> () {
-// CHECK: [[GLOBAL_ADDR:%.*]] = global_addr @_T020tsan_instrumentation7gStructAA02MyC0Vv : $*MyStruct
+// CHECK: [[GLOBAL_ADDR:%.*]] = global_addr @_T020tsan_instrumentation7gStructAA02MyC0Vvp : $*MyStruct
// CHECK: [[TAKES_INOUT_FUNC:%.*]] = function_ref @_T020tsan_instrumentation10takesInoutyAA8MyStructVzF : $@convention(thin) (@inout MyStruct) -> ()
// CHECK: [[WRITE:%.*]] = begin_access [modify] [dynamic] [[GLOBAL_ADDR]] : $*MyStruct
// CHECK: {{%.*}} = builtin "tsanInoutAccess"([[WRITE]] : $*MyStruct) : $()
@@ -28,7 +28,7 @@
// CHECK-LABEL: sil hidden @_T020tsan_instrumentation31inoutGlobalStructStoredPropertyyyF : $@convention(thin) () -> () {
-// CHECK: [[GLOBAL_ADDR:%.*]] = global_addr @_T020tsan_instrumentation7gStructAA02MyC0Vv : $*MyStruct
+// CHECK: [[GLOBAL_ADDR:%.*]] = global_addr @_T020tsan_instrumentation7gStructAA02MyC0Vvp : $*MyStruct
// CHECK: [[TAKES_INOUT_FUNC:%.*]] = function_ref @_T020tsan_instrumentation10takesInoutySizF : $@convention(thin) (@inout Int) -> ()
// CHECK: [[WRITE:%.*]] = begin_access [modify] [dynamic] [[GLOBAL_ADDR]] : $*MyStruct
// CHECK: {{%.*}} = builtin "tsanInoutAccess"([[WRITE]] : $*MyStruct) : $()
@@ -42,7 +42,7 @@
}
// CHECK-LABEL: sil hidden @_T020tsan_instrumentation30inoutGlobalClassStoredPropertyyyF : $@convention(thin) () -> () {
-// CHECK: [[GLOBAL_ADDR:%.*]] = global_addr @_T020tsan_instrumentation6gClassAA02MyC0Cv : $*MyClass
+// CHECK: [[GLOBAL_ADDR:%.*]] = global_addr @_T020tsan_instrumentation6gClassAA02MyC0Cvp : $*MyClass
// CHECK: [[TAKES_INOUT_FUNC:%.*]] = function_ref @_T020tsan_instrumentation10takesInoutySizF : $@convention(thin) (@inout Int) -> ()
// CHECK: [[READ:%.*]] = begin_access [read] [dynamic] [[GLOBAL_ADDR]] : $*MyClass
// CHECK: [[LOADED_CLASS:%.*]] = load [copy] [[READ]] : $*MyClass
diff --git a/test/SILGen/witnesses.swift b/test/SILGen/witnesses.swift
index c0f9f1c..49b21ce 100644
--- a/test/SILGen/witnesses.swift
+++ b/test/SILGen/witnesses.swift
@@ -319,9 +319,9 @@
}
struct ImmutableModel: ReadOnlyRequirement {
- // CHECK-LABEL: sil private [transparent] [thunk] @_T09witnesses14ImmutableModelVAA19ReadOnlyRequirementA2aDP4propSSfgTW : $@convention(witness_method) (@in_guaranteed ImmutableModel) -> @owned String
+ // CHECK-LABEL: sil private [transparent] [thunk] @_T09witnesses14ImmutableModelVAA19ReadOnlyRequirementA2aDP4propSSvgTW : $@convention(witness_method) (@in_guaranteed ImmutableModel) -> @owned String
let prop: String = "a"
- // CHECK-LABEL: sil private [transparent] [thunk] @_T09witnesses14ImmutableModelVAA19ReadOnlyRequirementA2aDP4propSSfgZTW : $@convention(witness_method) (@thick ImmutableModel.Type) -> @owned String
+ // CHECK-LABEL: sil private [transparent] [thunk] @_T09witnesses14ImmutableModelVAA19ReadOnlyRequirementA2aDP4propSSvgZTW : $@convention(witness_method) (@thick ImmutableModel.Type) -> @owned String
static let prop: String = "b"
}
@@ -462,7 +462,7 @@
// If the witness is in a base class of the conforming class, make sure we have a bit_cast in there:
- // CHECK-LABEL: sil private [transparent] [thunk] @_T09witnesses34PropertyRequirementWitnessFromBaseCAA0bC0A2aDP5widthSifmTW : {{.*}} {
+ // CHECK-LABEL: sil private [transparent] [thunk] @_T09witnesses34PropertyRequirementWitnessFromBaseCAA0bC0A2aDP5widthSivmTW : {{.*}} {
// CHECK: bb0({{.*}} : @trivial $Builtin.RawPointer, {{.*}} : @trivial $*Builtin.UnsafeValueBuffer, [[ARG2:%.*]] : @trivial $*PropertyRequirementWitnessFromBase):
// CHECK-NEXT: [[ARG2_LOADED:%[0-9][0-9]*]] = load [copy] [[ARG2]]
// CHECK-NEXT: [[CAST_ARG2_LOADED:%[0-9][0-9]*]] = upcast [[ARG2_LOADED]] : $PropertyRequirementWitnessFromBase to $PropertyRequirementBase
@@ -476,16 +476,16 @@
// CHECK-NEXT: destroy_value [[CAST_ARG2_LOADED]]
// CHECK-NEXT: return [[TUPLE]]
- // CHECK-LABEL: sil private [transparent] [thunk] @_T09witnesses34PropertyRequirementWitnessFromBaseCAA0bC0A2aDP6heightSifmZTW : {{.*}} {
+ // CHECK-LABEL: sil private [transparent] [thunk] @_T09witnesses34PropertyRequirementWitnessFromBaseCAA0bC0A2aDP6heightSivmZTW : {{.*}} {
// CHECK: [[OBJ:%.*]] = upcast %2 : $@thick PropertyRequirementWitnessFromBase.Type to $@thick PropertyRequirementBase.Type
- // CHECK: [[METH:%.*]] = function_ref @_T09witnesses23PropertyRequirementBaseC6heightSifmZ
+ // CHECK: [[METH:%.*]] = function_ref @_T09witnesses23PropertyRequirementBaseC6heightSivmZ
// CHECK-NEXT: [[RES:%.*]] = apply [[METH]]
// CHECK-NEXT: [[CAR:%.*]] = tuple_extract [[RES]] : $({{.*}}), 0
// CHECK-NEXT: [[CADR:%.*]] = tuple_extract [[RES]] : $({{.*}}), 1
// CHECK-NEXT: [[TUPLE:%.*]] = tuple ([[CAR]] : {{.*}}, [[CADR]] : {{.*}})
// CHECK-NEXT: return [[TUPLE]]
- // CHECK-LABEL: sil private [transparent] [thunk] @_T09witnesses34PropertyRequirementWitnessFromBaseCAA0bC0A2aDP5depthSifmTW
+ // CHECK-LABEL: sil private [transparent] [thunk] @_T09witnesses34PropertyRequirementWitnessFromBaseCAA0bC0A2aDP5depthSivmTW
// CHECK: bb0({{.*}} : @trivial $Builtin.RawPointer, {{.*}} : @trivial $*Builtin.UnsafeValueBuffer, [[ARG2:%.*]] : @trivial $*PropertyRequirementWitnessFromBase):
// CHECK: [[ARG2_LOADED:%[0-9][0-9]*]] = load [copy] [[ARG2]]
// CHECK: [[METH:%.*]] = class_method [[ARG2_LOADED]] : $PropertyRequirementWitnessFromBase, #PropertyRequirementWitnessFromBase.depth!materializeForSet.1
diff --git a/test/SILGen/writeback.swift b/test/SILGen/writeback.swift
index b4f3ba9..5bc17f3 100644
--- a/test/SILGen/writeback.swift
+++ b/test/SILGen/writeback.swift
@@ -45,12 +45,12 @@
x.foo()
// CHECK: [[FOO:%.*]] = function_ref @_T09writeback3FooV3foo{{[_0-9a-zA-Z]*}}F : $@convention(method) (@inout Foo) -> ()
// CHECK: [[X_TEMP:%.*]] = alloc_stack $Foo
-// CHECK: [[GET_X:%.*]] = function_ref @_T09writeback1xAA3FooVfg : $@convention(thin) () -> Foo
+// CHECK: [[GET_X:%.*]] = function_ref @_T09writeback1xAA3FooVvg : $@convention(thin) () -> Foo
// CHECK: [[X:%.*]] = apply [[GET_X]]() : $@convention(thin) () -> Foo
// CHECK: store [[X]] to [trivial] [[X_TEMP]]
// CHECK: apply [[FOO]]([[X_TEMP]]) : $@convention(method) (@inout Foo) -> ()
// CHECK: [[X1:%.*]] = load [trivial] [[X_TEMP]] : $*Foo
-// CHECK: [[SET_X:%.*]] = function_ref @_T09writeback1xAA3FooVfs : $@convention(thin) (Foo) -> ()
+// CHECK: [[SET_X:%.*]] = function_ref @_T09writeback1xAA3FooVvs : $@convention(thin) (Foo) -> ()
// CHECK: apply [[SET_X]]([[X1]]) : $@convention(thin) (Foo) -> ()
// CHECK: dealloc_stack [[X_TEMP]] : $*Foo
@@ -58,12 +58,12 @@
bar(x: &x)
// CHECK: [[BAR:%.*]] = function_ref @_T09writeback3baryAA3FooVz1x_tF : $@convention(thin) (@inout Foo) -> ()
// CHECK: [[X_TEMP:%.*]] = alloc_stack $Foo
-// CHECK: [[GET_X:%.*]] = function_ref @_T09writeback1xAA3FooVfg : $@convention(thin) () -> Foo
+// CHECK: [[GET_X:%.*]] = function_ref @_T09writeback1xAA3FooVvg : $@convention(thin) () -> Foo
// CHECK: [[X:%.*]] = apply [[GET_X]]() : $@convention(thin) () -> Foo
// CHECK: store [[X]] to [trivial] [[X_TEMP]] : $*Foo
// CHECK: apply [[BAR]]([[X_TEMP]]) : $@convention(thin) (@inout Foo) -> ()
// CHECK: [[X1:%.*]] = load [trivial] [[X_TEMP]] : $*Foo
-// CHECK: [[SET_X:%.*]] = function_ref @_T09writeback1xAA3FooVfs : $@convention(thin) (Foo) -> ()
+// CHECK: [[SET_X:%.*]] = function_ref @_T09writeback1xAA3FooVvs : $@convention(thin) (Foo) -> ()
// CHECK: apply [[SET_X]]([[X1]]) : $@convention(thin) (Foo) -> ()
// CHECK: dealloc_stack [[X_TEMP]] : $*Foo
@@ -72,10 +72,10 @@
// No writeback for pass-by-value argument
zang(x: x)
// CHECK: function_ref @_T09writeback4zangyAA3FooV1x_tF : $@convention(thin) (Foo) -> ()
-// CHECK-NOT: @_T09writeback1xAA3FooVfs
+// CHECK-NOT: @_T09writeback1xAA3FooVvs
zang(x: readonly)
// CHECK: function_ref @_T09writeback4zangyAA3FooV1x_tF : $@convention(thin) (Foo) -> ()
-// CHECK-NOT: @_T09writeback8readonlyAA3FooVfs
+// CHECK-NOT: @_T09writeback8readonlyAA3FooVvs
func zung() -> Int { return 0 }
@@ -84,13 +84,13 @@
// CHECK: [[BAR:%.*]] = function_ref @_T09writeback3baryAA3FooVz1x_tF : $@convention(thin) (@inout Foo) -> ()
// CHECK: [[ZUNG:%.*]] = function_ref @_T09writeback4zungSiyF : $@convention(thin) () -> Int
// CHECK: [[INDEX:%.*]] = apply [[ZUNG]]() : $@convention(thin) () -> Int
-// CHECK: [[GET_X:%.*]] = function_ref @_T09writeback1xAA3FooVfg : $@convention(thin) () -> Foo
-// CHECK: [[GET_SUBSCRIPT:%.*]] = function_ref @_T09writeback3FooV9subscript{{[_0-9a-zA-Z]*}}fg : $@convention(method) (Int, Foo) -> Foo
+// CHECK: [[GET_X:%.*]] = function_ref @_T09writeback1xAA3FooVvg : $@convention(thin) () -> Foo
+// CHECK: [[GET_SUBSCRIPT:%.*]] = function_ref @_T09writeback3FooV{{[_0-9a-zA-Z]*}}ig : $@convention(method) (Int, Foo) -> Foo
// CHECK: apply [[GET_SUBSCRIPT]]([[INDEX]], {{%.*}}) : $@convention(method) (Int, Foo) -> Foo
// CHECK: apply [[BAR]]({{%.*}}) : $@convention(thin) (@inout Foo) -> ()
-// CHECK: [[SET_SUBSCRIPT:%.*]] = function_ref @_T09writeback3FooV9subscript{{[_0-9a-zA-Z]*}}fs : $@convention(method) (Foo, Int, @inout Foo) -> ()
+// CHECK: [[SET_SUBSCRIPT:%.*]] = function_ref @_T09writeback3FooV{{[_0-9a-zA-Z]*}}is : $@convention(method) (Foo, Int, @inout Foo) -> ()
// CHECK: apply [[SET_SUBSCRIPT]]({{%.*}}, [[INDEX]], {{%.*}}) : $@convention(method) (Foo, Int, @inout Foo) -> ()
-// CHECK: function_ref @_T09writeback1xAA3FooVfs : $@convention(thin) (Foo) -> ()
+// CHECK: function_ref @_T09writeback1xAA3FooVvs : $@convention(thin) (Foo) -> ()
protocol Fungible {}
extension Foo : Fungible {}
@@ -107,10 +107,10 @@
funge(x: &addressOnly)
// CHECK: [[FUNGE:%.*]] = function_ref @_T09writeback5fungeyAA8Fungible_pz1x_tF : $@convention(thin) (@inout Fungible) -> ()
// CHECK: [[TEMP:%.*]] = alloc_stack $Fungible
-// CHECK: [[GET:%.*]] = function_ref @_T09writeback11addressOnlyAA8Fungible_pfg : $@convention(thin) () -> @out Fungible
+// CHECK: [[GET:%.*]] = function_ref @_T09writeback11addressOnlyAA8Fungible_pvg : $@convention(thin) () -> @out Fungible
// CHECK: apply [[GET]]([[TEMP]]) : $@convention(thin) () -> @out Fungible
// CHECK: apply [[FUNGE]]([[TEMP]]) : $@convention(thin) (@inout Fungible) -> ()
-// CHECK: [[SET:%.*]] = function_ref @_T09writeback11addressOnlyAA8Fungible_pfs : $@convention(thin) (@in Fungible) -> ()
+// CHECK: [[SET:%.*]] = function_ref @_T09writeback11addressOnlyAA8Fungible_pvs : $@convention(thin) (@in Fungible) -> ()
// CHECK: apply [[SET]]([[TEMP]]) : $@convention(thin) (@in Fungible) -> ()
// CHECK: dealloc_stack [[TEMP]] : $*Fungible
diff --git a/test/SILOptimizer/devirt_materializeForSet.swift b/test/SILOptimizer/devirt_materializeForSet.swift
index fb6742c..d3edf2e 100644
--- a/test/SILOptimizer/devirt_materializeForSet.swift
+++ b/test/SILOptimizer/devirt_materializeForSet.swift
@@ -3,7 +3,7 @@
// Check that compiler does not crash on the devirtualization of materializeForSet methods
// and produces a correct code.
-// CHECK-LABEL: sil shared [transparent] [serialized] [thunk] @_T024devirt_materializeForSet7BaseFooCAA0F0A2aDP3barSSfmTW
+// CHECK-LABEL: sil shared [transparent] [serialized] [thunk] @_T024devirt_materializeForSet7BaseFooCAA0F0A2aDP3barSSvmTW
// CHECK: checked_cast_br [exact] %{{.*}} : $BaseFoo to $ChildFoo
// CHECK: thin_function_to_pointer %{{.*}} : $@convention(method) (Builtin.RawPointer, @inout Builtin.UnsafeValueBuffer, @inout ChildFoo, @thick ChildFoo.Type) -> () to $Builtin.RawPointer
// CHECK: enum $Optional<Builtin.RawPointer>, #Optional.some!enumelt.1, %{{.*}} : $Builtin.RawPointer
diff --git a/test/SILOptimizer/mandatory_inlining.sil b/test/SILOptimizer/mandatory_inlining.sil
index 1f69fb2..35e92c4 100644
--- a/test/SILOptimizer/mandatory_inlining.sil
+++ b/test/SILOptimizer/mandatory_inlining.sil
@@ -22,7 +22,14 @@
}
sil @plus : $@convention(thin) (Int64, Int64) -> Int64
+sil @nativeobject_plus : $@convention(thin) (@owned Builtin.NativeObject, @owned Builtin.NativeObject) -> @owned Builtin.NativeObject
+sil @partial_apply_user : $@convention(thin) (@owned @callee_owned (@owned Builtin.NativeObject) -> @owned Builtin.NativeObject) -> ()
sil @fromLiteral : $@convention(thin) (Builtin.Int128, @thin Int64.Type) -> Int64
+sil @use_nativeobject : $@convention(thin) (@guaranteed Builtin.NativeObject) -> ()
+
+//////////////////////////////////////
+// Multiple Inline in a Block Tests //
+//////////////////////////////////////
// CHECK-LABEL: sil [transparent] @test_add : $@convention(thin) (Int64) -> Int64 {
sil [transparent] @test_add : $@convention(thin) (Int64) -> Int64 {
@@ -166,6 +173,10 @@
return %19 : $Int64
}
+///////////////////////
+// Existential Tests //
+///////////////////////
+
protocol SomeProtocol {
}
@@ -204,11 +215,9 @@
%3 = return %2 : $@thick SomeProtocol.Type
}
-sil private @top_level_code : $() -> () {
-bb0:
- %0 = tuple ()
- return %0 : $()
-}
+////////////////////////
+// Control Flow Tests //
+////////////////////////
sil @get_logic_value : $@convention(method) (@inout Bool) -> Builtin.Int1
sil @add_floats : $@convention(thin) (Float32, Float32) -> Float32
@@ -387,6 +396,10 @@
return %21 : $Float
}
+///////////////////////////////////////
+// Recursion and Partial Apply Tests //
+///////////////////////////////////////
+
// CHECK-LABEL: [transparent] @test_recursive_foo : $@convention(thin) (Float) -> Float
sil [transparent] @test_recursive_foo : $@convention(thin) (Float) -> Float {
// CHECK-NOT: function_ref
@@ -449,6 +462,112 @@
return %7 : $Int64
}
+
+// CHECK-LABEL: [transparent] @test_recursive_nativeobject_foo : $@convention(thin) (@owned Builtin.NativeObject) -> @owned Builtin.NativeObject
+sil [transparent] @test_recursive_nativeobject_foo : $@convention(thin) (@owned Builtin.NativeObject) -> @owned Builtin.NativeObject {
+ // CHECK-NOT: function_ref
+ // CHECK-NOT: apply
+ // CHECK: return
+
+bb0(%0 : $Builtin.NativeObject):
+ %3 = function_ref @test_recursive_nativeobject_bar : $@convention(thin) (@owned Builtin.NativeObject) -> @owned Builtin.NativeObject
+ %5 = apply %3(%0) : $@convention(thin) (@owned Builtin.NativeObject) -> @owned Builtin.NativeObject
+ return %5 : $Builtin.NativeObject
+}
+
+// CHECK-LABEL: sil [transparent] @test_recursive_nativeobject_bar : $@convention(thin) (@owned Builtin.NativeObject) -> @owned Builtin.NativeObject
+sil [transparent] @test_recursive_nativeobject_bar : $@convention(thin) (@owned Builtin.NativeObject) -> @owned Builtin.NativeObject {
+ // CHECK-NOT: function_ref
+ // CHECK-NOT: apply
+ // CHECK: return
+
+bb0(%0 : $Builtin.NativeObject):
+ %3 = function_ref @test_recursive_nativeobject_baz : $@convention(thin) (@owned Builtin.NativeObject) -> @owned Builtin.NativeObject
+ %5 = apply %3(%0) : $@convention(thin) (@owned Builtin.NativeObject) -> @owned Builtin.NativeObject
+ return %5 : $Builtin.NativeObject
+}
+
+// CHECK-LABEL: sil [transparent] @test_recursive_nativeobject_baz : $@convention(thin) (@owned Builtin.NativeObject) -> @owned Builtin.NativeObject {
+// CHECK: bb0
+// CHECK-NEXT: return
+// CHECK: } // end sil function 'test_recursive_nativeobject_baz'
+sil [transparent] @test_recursive_nativeobject_baz : $@convention(thin) (@owned Builtin.NativeObject) -> @owned Builtin.NativeObject {
+bb0(%0 : $Builtin.NativeObject):
+ return %0 : $Builtin.NativeObject
+}
+
+sil [transparent] @test_partial_nativeobject_baz : $@convention(thin) (@owned Builtin.NativeObject, @owned Builtin.NativeObject) -> @owned Builtin.NativeObject {
+bb0(%0 : $Builtin.NativeObject, %1 : $Builtin.NativeObject):
+ %6 = function_ref @nativeobject_plus : $@convention(thin) (@owned Builtin.NativeObject, @owned Builtin.NativeObject) -> @owned Builtin.NativeObject
+ %7 = apply %6(%0, %1) : $@convention(thin) (@owned Builtin.NativeObject, @owned Builtin.NativeObject) -> @owned Builtin.NativeObject
+ return %7 : $Builtin.NativeObject
+}
+
+sil [transparent] @test_partial_nativeobject_bar : $@convention(thin) (@owned @callee_owned (@owned Builtin.NativeObject) -> @owned Builtin.NativeObject, @owned Builtin.NativeObject) -> @owned Builtin.NativeObject {
+bb0(%0 : $@callee_owned (@owned Builtin.NativeObject) -> @owned Builtin.NativeObject, %1 : $Builtin.NativeObject):
+ %7 = apply %0(%1) : $@callee_owned (@owned Builtin.NativeObject) -> @owned Builtin.NativeObject
+ return %7 : $Builtin.NativeObject
+}
+
+// CHECK-LABEL: sil [transparent] @test_partial_nativeobject_foo : $@convention(thin) (@owned Builtin.NativeObject) -> @owned Builtin.NativeObject {
+// CHECK: bb0([[ARG:%.*]] : $Builtin.NativeObject):
+// CHECK: [[FN:%.*]] = function_ref @test_partial_nativeobject_baz :
+// CHECK: br bb1
+//
+// CHECK: bb1:
+// CHECK: strong_retain [[ARG]]
+// CHECK: [[PAI:%.*]] = partial_apply [[FN]]([[ARG]])
+// CHECK: br bb2
+//
+// CHECK: bb2:
+// CHECK: strong_retain [[ARG]]
+// CHECK: strong_retain [[PAI]]
+// CHECK: br bb3
+//
+// CHECK: bb3:
+// CHECK: strong_retain [[ARG]]
+// CHECK: strong_release [[PAI]]
+// CHECK: [[FN2:%.*]] = function_ref @nativeobject_plus :
+// CHECK: [[RESULT:%.*]] = apply [[FN2]]([[ARG]], [[ARG]])
+//
+// CHECK: bb4:
+// CHECK: strong_retain [[PAI]]
+// CHECK: [[OPAQUE_FN:%.*]] = function_ref @partial_apply_user
+// CHECK: apply [[OPAQUE_FN]]([[PAI]])
+// CHECK: strong_release [[PAI]]
+// CHECK: strong_release [[ARG]]
+// CHECK: return [[RESULT]]
+// CHECK: } // end sil function 'test_partial_nativeobject_foo'
+sil [transparent] @test_partial_nativeobject_foo : $@convention(thin) (@owned Builtin.NativeObject) -> @owned Builtin.NativeObject {
+bb0(%0 : $Builtin.NativeObject):
+ %2 = function_ref @test_partial_nativeobject_bar : $@convention(thin) (@owned @callee_owned (@owned Builtin.NativeObject) -> @owned Builtin.NativeObject, @owned Builtin.NativeObject) -> @owned Builtin.NativeObject
+ %3 = function_ref @test_partial_nativeobject_baz : $@convention(thin) (@owned Builtin.NativeObject, @owned Builtin.NativeObject) -> @owned Builtin.NativeObject
+ br bb1
+
+bb1:
+ strong_retain %0 : $Builtin.NativeObject
+ %5 = partial_apply %3(%0) : $@convention(thin) (@owned Builtin.NativeObject, @owned Builtin.NativeObject) -> @owned Builtin.NativeObject
+ br bb2
+
+bb2:
+ strong_retain %0 : $Builtin.NativeObject
+ strong_retain %5 : $@callee_owned (@owned Builtin.NativeObject) -> @owned Builtin.NativeObject
+ %13 = apply %2(%5, %0) : $@convention(thin) (@owned @callee_owned (@owned Builtin.NativeObject) -> @owned Builtin.NativeObject, @owned Builtin.NativeObject) -> @owned Builtin.NativeObject
+ br bb3
+
+bb3:
+ strong_retain %5 : $@callee_owned (@owned Builtin.NativeObject) -> @owned Builtin.NativeObject
+ %15 = function_ref @partial_apply_user : $@convention(thin) (@owned @callee_owned (@owned Builtin.NativeObject) -> @owned Builtin.NativeObject) -> ()
+ apply %15(%5) : $@convention(thin) (@owned @callee_owned (@owned Builtin.NativeObject) -> @owned Builtin.NativeObject) -> ()
+ strong_release %5 : $@callee_owned (@owned Builtin.NativeObject) -> @owned Builtin.NativeObject
+ strong_release %0 : $Builtin.NativeObject
+ return %13 : $Builtin.NativeObject
+}
+
+///////////////////////
+// Autoclosure Tests //
+///////////////////////
+
sil @true_getter : $@convention(thin) () -> Bool
sil [transparent] @short_circuit_or : $@convention(thin) (Bool, @callee_owned () -> Bool) -> Bool {
diff --git a/test/SILOptimizer/mandatory_inlining.swift b/test/SILOptimizer/mandatory_inlining.swift
index f99fa1b..9f3ddac 100644
--- a/test/SILOptimizer/mandatory_inlining.swift
+++ b/test/SILOptimizer/mandatory_inlining.swift
@@ -1,4 +1,4 @@
-// RUN: %target-swift-frontend -primary-file %s -emit-sil -o - -verify | %FileCheck %s
+// RUN: %target-swift-frontend -enable-sil-ownership -sil-verify-all -primary-file %s -emit-sil -o - -verify | %FileCheck %s
// These tests are deliberately shallow, because I do not want to depend on the
// specifics of SIL generation, which might change for reasons unrelated to this
diff --git a/test/SILOptimizer/mandatory_inlining_circular.swift b/test/SILOptimizer/mandatory_inlining_circular.swift
index c4ede7e..d544f6a 100644
--- a/test/SILOptimizer/mandatory_inlining_circular.swift
+++ b/test/SILOptimizer/mandatory_inlining_circular.swift
@@ -1,4 +1,4 @@
-// RUN: %target-swift-frontend -emit-sil %s -o /dev/null -verify
+// RUN: %target-swift-frontend -enable-sil-ownership -sil-verify-all -emit-sil %s -o /dev/null -verify
@_transparent func waldo(_ x: Double) -> Double {
return fred(x); // expected-error {{inlining 'transparent' functions forms circular loop}} expected-note 1 {{while inlining here}}
diff --git a/test/SILOptimizer/mandatory_inlining_devirt.swift b/test/SILOptimizer/mandatory_inlining_devirt.swift
index 9c57435..f4f2af6 100644
--- a/test/SILOptimizer/mandatory_inlining_devirt.swift
+++ b/test/SILOptimizer/mandatory_inlining_devirt.swift
@@ -1,4 +1,4 @@
-// RUN: %target-swift-frontend %s -module-name test -emit-sil -o - -verify | %FileCheck %s
+// RUN: %target-swift-frontend -enable-sil-ownership -sil-verify-all %s -module-name test -emit-sil -o - -verify | %FileCheck %s
// Constructor calls are dispatched dynamically for open classes, even if
diff --git a/test/SILOptimizer/mandatory_nil_comparison_inlining.swift b/test/SILOptimizer/mandatory_nil_comparison_inlining.swift
index 0d71590..425d4a6 100644
--- a/test/SILOptimizer/mandatory_nil_comparison_inlining.swift
+++ b/test/SILOptimizer/mandatory_nil_comparison_inlining.swift
@@ -1,4 +1,4 @@
-// RUN: %target-swift-frontend -primary-file %s -module-name=test -emit-sil -o - -verify | %FileCheck %s
+// RUN: %target-swift-frontend -enable-sil-ownership -sil-verify-all -primary-file %s -module-name=test -emit-sil -o - -verify | %FileCheck %s
// CHECK-LABEL: sil {{.*}} @{{.*}}generic_func
diff --git a/test/SILOptimizer/optimizer_counters.sil b/test/SILOptimizer/optimizer_counters.sil
new file mode 100644
index 0000000..05bc872
--- /dev/null
+++ b/test/SILOptimizer/optimizer_counters.sil
@@ -0,0 +1,101 @@
+// RUN: %target-sil-opt -assume-parsing-unqualified-ownership-sil -enable-sil-verify-all %s -O -sil-stats-modules 2>&1 | %FileCheck --check-prefix=CHECK-SIL-STATS-MODULES %s
+// RUN: %target-sil-opt -assume-parsing-unqualified-ownership-sil -enable-sil-verify-all %s -O -sil-stats-functions 2>&1 | %FileCheck --check-prefix=CHECK-SIL-STATS-FUNCTIONS %s
+// RUN: %target-sil-opt -assume-parsing-unqualified-ownership-sil -enable-sil-verify-all %s -O -sil-stats-dump-all 2>&1 | %FileCheck --check-prefix=CHECK-SIL-STATS-ALL %s
+// RUN: %target-sil-opt -assume-parsing-unqualified-ownership-sil -enable-sil-verify-all %s -O -sil-stats-modules -sil-stats-only-instructions=integer_literal,builtin 2>&1 | %FileCheck --check-prefix=CHECK-SIL-STATS-ONLY-INSTRUCTIONS %s
+// RUN: %target-sil-opt -assume-parsing-unqualified-ownership-sil -enable-sil-verify-all %s -O -sil-stats-functions -sil-stats-only-function=test_simple 2>&1 | %FileCheck --check-prefix=CHECK-SIL-STATS-ONLY-FUNCTION %s
+// RUN: %target-sil-opt -assume-parsing-unqualified-ownership-sil -enable-sil-verify-all %s -O -sil-stats-functions -sil-stats-only-functions=test 2>&1 | %FileCheck --check-prefix=CHECK-SIL-STATS-ONLY-FUNCTIONS %s
+
+
+// Test different modes of optimizer counters statistics collection.
+
+sil_stage canonical
+
+import Builtin
+import Swift
+
+sil @fatalError : $@convention(thin) () -> Never
+
+// Check that module level statistics are produced.
+//
+// CHECK-SIL-STATS-MODULES: module, inst, HighLevel+EarlyLoopOpt, PerformanceConstantPropagation, {{.*}}, 15, 12
+// CHECK-SIL-STATS-MODULES: module, block, HighLevel+EarlyLoopOpt, SimplifyCFG, {{.*}}, 6, 3
+// CHECK-SIL-STATS-MODULES: module, inst, HighLevel+EarlyLoopOpt, SimplifyCFG, {{.*}}, 12, 6
+
+// Check that module level statistics are produced.
+//
+// CHECK-SIL-STATS-FUNCTIONS: function_history, block,{{.*}}, test_multiply
+// CHECK-SIL-STATS-FUNCTIONS: function_history, inst,{{.*}}, test_multiply
+// CHECK-SIL-STATS-FUNCTIONS: function_history, block,{{.*}}, test_simple
+// CHECK-SIL-STATS-FUNCTIONS: function_history, inst,{{.*}}, test_simple
+// CHECK-SIL-STATS-FUNCTIONS: function_history, block,{{.*}}, another_simple_func
+// CHECK-SIL-STATS-FUNCTIONS: function_history, inst,{{.*}}, another_simple_func
+
+
+
+// Check that -sil-stats-all produces module and function level statistics.
+//
+// CHECK-SIL-STATS-ALL: module, block,
+// CHECK-SIL-STATS-ALL: function, inst
+
+// Check that -sil-stats-only-instructions=integer_literal,builtin produces stats about these instruction.
+//
+// CHECK-SIL-STATS-ONLY-INSTRUCTIONS: module, inst_integer_literal
+// CHECK-SIL-STATS-ONLY-INSTRUCTIONS: module, inst_builtin
+
+sil @test_multiply : $@convention(thin) () -> Builtin.Int64 {
+bb0:
+ %1 = integer_literal $Builtin.Int64, 10
+ %2 = integer_literal $Builtin.Int1, 0
+ %3 = builtin "umul_with_overflow_Int64"(%1 : $Builtin.Int64, %1 : $Builtin.Int64, %2 : $Builtin.Int1) : $(Builtin.Int64, Builtin.Int1)
+ %4 = tuple_extract %3 : $(Builtin.Int64, Builtin.Int1), 1
+ cond_br %4, bb1, bb2
+
+bb1:
+ %f = function_ref @fatalError : $@convention(thin) () -> Never
+ apply %f() : $@convention(thin) () -> Never
+ unreachable
+
+bb2:
+ %v = tuple_extract %3 : $(Builtin.Int64, Builtin.Int1), 0
+ br bb3 (%v : $Builtin.Int64)
+
+bb3(%r : $Builtin.Int64):
+ return %r: $Builtin.Int64
+}
+
+// Check that -sil-stats-only-function=test_simple produces stats only about test_simple
+//
+// CHECK-SIL-STATS-ONLY-FUNCTION-NOT: function_history, block,{{.*}}, test_multiply
+// CHECK-SIL-STATS-ONLY-FUNCTION-NOT: function_history, inst,{{.*}}, test_multiply
+// CHECK-SIL-STATS-ONLY-FUNCTION-NOT: function_history, block,{{.*}}, another_simple_func
+// CHECK-SIL-STATS-ONLY-FUNCTION-NOT: function_history, inst,{{.*}}, another_simple_func
+// CHECK-SIL-STATS-ONLY-FUNCTION: function_history, block,{{.*}}, test_simple
+// CHECK-SIL-STATS-ONLY-FUNCTION: function_history, inst,{{.*}}, test_simple
+// CHECK-SIL-STATS-ONLY-FUNCTION-NOT: function_history, block,{{.*}}, test_multiply
+// CHECK-SIL-STATS-ONLY-FUNCTION-NOT: function_history, inst,{{.*}}, test_multiply
+// CHECK-SIL-STATS-ONLY-FUNCTION-NOT: function_history, block,{{.*}}, another_simple_func
+// CHECK-SIL-STATS-ONLY-FUNCTION-NOT: function_history, inst,{{.*}}, another_simple_func
+
+sil @test_simple : $@convention(thin) () -> Builtin.Int64 {
+ %0 = integer_literal $Builtin.Int64, 10
+ return %0 : $Builtin.Int64
+}
+
+sil @another_simple_func : $@convention(thin) () -> Builtin.Int64 {
+ %0 = integer_literal $Builtin.Int64, 10
+ return %0 : $Builtin.Int64
+}
+
+// Check that -sil-stats-only-functions=test produces stats only about functions,
+// whose name contains "test"
+//
+// CHECK-SIL-STATS-ONLY-FUNCTIONS-NOT: function_history, block,{{.*}}, another_simple_func
+// CHECK-SIL-STATS-ONLY-FUNCTIONS-NOT: function_history, inst,{{.*}}, another_simple_func
+// CHECK-SIL-STATS-ONLY-FUNCTIONS: function_history, block,{{.*}}, test_multiply
+// CHECK-SIL-STATS-ONLY-FUNCTIONS: function_history, inst,{{.*}}, test_multiply
+// CHECK-SIL-STATS-ONLY-FUNCTIONS: function_history, block,{{.*}}, test_simple
+// CHECK-SIL-STATS-ONLY-FUNCTIONS: function_history, inst,{{.*}}, test_simple
+// CHECK-SIL-STATS-ONLY-FUNCTIONS-NOT: function_history, block,{{.*}}, another_simple_func
+// CHECK-SIL-STATS-ONLY-FUNCTIONS-NOT: function_history, inst,{{.*}}, another_simple_func
+
+
diff --git a/test/SILOptimizer/outliner.swift b/test/SILOptimizer/outliner.swift
index 805255a..c389480 100644
--- a/test/SILOptimizer/outliner.swift
+++ b/test/SILOptimizer/outliner.swift
@@ -13,7 +13,7 @@
gizmo = Gizmo()
}
// CHECK-LABEL: sil @_T08outliner7MyGizmoC11usePropertyyyF
- // CHECK: [[FUN:%.*]] = function_ref @_T0So5GizmoC14stringPropertySQySSGfgToTeab_
+ // CHECK: [[FUN:%.*]] = function_ref @_T0So5GizmoC14stringPropertySQySSGvgToTeab_
// CHECK: apply [[FUN]]({{.*}}) : $@convention(thin) (@in_guaranteed Gizmo) -> @owned Optional<String>
// CHECK-NOT: return
// CHECK: apply [[FUN]]({{.*}}) : $@convention(thin) (@in_guaranteed Gizmo) -> @owned Optional<String>
@@ -25,10 +25,10 @@
}
// CHECK-LABEL: sil @_T08outliner13testOutliningyyF
-// CHECK: [[FUN:%.*]] = function_ref @_T0So5GizmoC14stringPropertySQySSGfgToTepb_
+// CHECK: [[FUN:%.*]] = function_ref @_T0So5GizmoC14stringPropertySQySSGvgToTepb_
// CHECK: apply [[FUN]](%{{.*}}) : $@convention(thin) (Gizmo) -> @owned Optional<String>
// CHECK: apply [[FUN]](%{{.*}}) : $@convention(thin) (Gizmo) -> @owned Optional<String>
-// CHECK: [[FUN:%.*]] = function_ref @_T0So5GizmoC14stringPropertySQySSGfsToTembnn_
+// CHECK: [[FUN:%.*]] = function_ref @_T0So5GizmoC14stringPropertySQySSGvsToTembnn_
// CHECK: apply [[FUN]]({{.*}}) : $@convention(thin) (@owned String, Gizmo) -> ()
// CHECK: apply [[FUN]]({{.*}}) : $@convention(thin) (@owned String, Gizmo) -> ()
// CHECK: [[FUN:%.*]] = function_ref @_T0So5GizmoC12modifyStringSQySSGAD_Si10withNumberSQyypG0D6FoobartFToTembnnnb_
@@ -53,7 +53,7 @@
gizmo.doSomething(arr)
}
-// CHECK-LABEL: sil shared [serializable] [noinline] @_T0So5GizmoC14stringPropertySQySSGfgToTeab_ : $@convention(thin) (@in_guaranteed Gizmo) -> @owned Optional<String>
+// CHECK-LABEL: sil shared [serializable] [noinline] @_T0So5GizmoC14stringPropertySQySSGvgToTeab_ : $@convention(thin) (@in_guaranteed Gizmo) -> @owned Optional<String>
// CHECK: bb0(%0 : $*Gizmo):
// CHECK: %1 = load %0 : $*Gizmo
// CHECK: %2 = class_method [volatile] %1 : $Gizmo, #Gizmo.stringProperty!getter.1.foreign : (Gizmo) -> () -> String!
@@ -71,7 +71,7 @@
// CHECK: bb3(%13 : $Optional<String>):
// CHECK: return %13 : $Optional<String>
-// CHECK-LABEL: sil shared [serializable] [noinline] @_T0So5GizmoC14stringPropertySQySSGfgToTepb_ : $@convention(thin) (Gizmo) -> @owned Optional<String>
+// CHECK-LABEL: sil shared [serializable] [noinline] @_T0So5GizmoC14stringPropertySQySSGvgToTepb_ : $@convention(thin) (Gizmo) -> @owned Optional<String>
// CHECK: bb0(%0 : $Gizmo):
// CHECK: %1 = class_method [volatile] %0 : $Gizmo, #Gizmo.stringProperty!getter.1.foreign : (Gizmo) -> () -> String!
// CHECK: %2 = apply %1(%0) : $@convention(objc_method) (Gizmo) -> @autoreleased Optional<NSString>
@@ -88,7 +88,7 @@
// CHECK:bb3(%12 : $Optional<String>):
// CHECK: return %12 : $Optional<String>
-// CHECK-LABEL: sil shared [serializable] [noinline] @_T0So5GizmoC14stringPropertySQySSGfsToTembnn_ : $@convention(thin) (@owned String, Gizmo) -> () {
+// CHECK-LABEL: sil shared [serializable] [noinline] @_T0So5GizmoC14stringPropertySQySSGvsToTembnn_ : $@convention(thin) (@owned String, Gizmo) -> () {
// CHECK: bb0(%0 : $String, %1 : $Gizmo):
// CHECK: %2 = class_method [volatile] %1 : $Gizmo, #Gizmo.stringProperty!setter.1.foreign : (Gizmo) -> (String!) -> ()
// CHECK: %3 = function_ref @_T0SS10FoundationE19_bridgeToObjectiveCSo8NSStringCyF : $@convention(method) (@guaranteed String) -> @owned NSString
diff --git a/test/SILOptimizer/prespecialize.swift b/test/SILOptimizer/prespecialize.swift
index 3346704..022fd00 100644
--- a/test/SILOptimizer/prespecialize.swift
+++ b/test/SILOptimizer/prespecialize.swift
@@ -17,7 +17,7 @@
// CHECK: function_ref @_T0s16IndexingIteratorV4next7ElementQzSgyFs14CountableRangeVySiG_Tgq5
//
// Look for generic specialization <Swift.Int> of Swift.Array.subscript.getter : (Swift.Int) -> A
-// CHECK: function_ref {{@_T0Sa9subscriptxSicfgSi_Tgq5|@_TTSg5Si___TFSaap9subscriptFSix}}
+// CHECK: function_ref {{@_T0SaxSicigSi_Tgq5|@_TTSg5Si___TFSaap9subscriptFSix}}
// CHECK: return
@inline(never)
public func test(_ a: inout [Int], size: Int) {
diff --git a/test/Sema/accessibility_private.swift b/test/Sema/accessibility_private.swift
index c78b4b3..33a6370 100644
--- a/test/Sema/accessibility_private.swift
+++ b/test/Sema/accessibility_private.swift
@@ -69,7 +69,6 @@
_ = Container.PrivateInner()
}
- // FIXME: Why do these errors happen twice?
var extensionInner: PrivateInner? { return nil } // expected-error {{property must be declared private because its type uses a private type}}
var extensionInnerQualified: Container.PrivateInner? { return nil } // expected-error {{property must be declared private because its type uses a private type}}
}
@@ -86,9 +85,8 @@
_ = Container.PrivateInner()
}
- // FIXME: Why do these errors happen twice?
// FIXME: Unqualified lookup won't look into Container from here.
- var inner: PrivateInner? { return nil } // expected-error 2 {{use of undeclared type 'PrivateInner'}}
+ var inner: PrivateInner? { return nil } // expected-error {{use of undeclared type 'PrivateInner'}}
var innerQualified: Container.PrivateInner? { return nil } // expected-error {{invalid redeclaration of 'innerQualified'}} expected-error {{property must be declared private because its type uses a private type}}
}
diff --git a/test/Sema/circular_decl_checking.swift b/test/Sema/circular_decl_checking.swift
index d7b9fa8..aa896cf 100644
--- a/test/Sema/circular_decl_checking.swift
+++ b/test/Sema/circular_decl_checking.swift
@@ -27,7 +27,7 @@
var HasProp: HasProp {
return HasProp() // expected-error {{cannot call value of non-function type 'HasProp'}}{{19-21=}}
}
- var SomethingElse: SomethingElse? { // expected-error 2 {{use of undeclared type 'SomethingElse'}}
+ var SomethingElse: SomethingElse? { // expected-error {{use of undeclared type 'SomethingElse'}}
return nil
}
}
@@ -40,7 +40,7 @@
func TopLevelFunc(x: TopLevelFunc) -> TopLevelFunc { return x } // expected-error 2 {{use of undeclared type 'TopLevelFunc'}}'
func TopLevelGenericFunc<TopLevelGenericFunc : TopLevelGenericFunc>(x: TopLevelGenericFunc) -> TopLevelGenericFunc { return x } // expected-error {{inheritance from non-protocol, non-class type 'TopLevelGenericFunc'}}
func TopLevelGenericFunc2<T : TopLevelGenericFunc2>(x: T) -> T { return x} // expected-error {{use of undeclared type 'TopLevelGenericFunc2'}}
-var TopLevelVar: TopLevelVar? { return nil } // expected-error 2 {{use of undeclared type 'TopLevelVar'}}
+var TopLevelVar: TopLevelVar? { return nil } // expected-error {{use of undeclared type 'TopLevelVar'}}
// FIXME: The first error is redundant, isn't correct in what it states, and
diff --git a/test/Sema/deprecation_osx.swift b/test/Sema/deprecation_osx.swift
index 98ca77e..87d3fdb 100644
--- a/test/Sema/deprecation_osx.swift
+++ b/test/Sema/deprecation_osx.swift
@@ -83,9 +83,7 @@
}
}
- // We really shouldn't be emitting three warnings here. It looks like
- // we are emitting one for each of the setter and getter, as well.
- var unannotatedPropertyDeprecatedIn10_51 : ClassDeprecatedIn10_51 { // expected-warning 3{{ClassDeprecatedIn10_51' was deprecated in OS X 10.51}}
+ var unannotatedPropertyDeprecatedIn10_51 : ClassDeprecatedIn10_51 { // expected-warning {{ClassDeprecatedIn10_51' was deprecated in OS X 10.51}}
get {
return ClassDeprecatedIn10_51() // expected-warning {{ClassDeprecatedIn10_51' was deprecated in OS X 10.51}}
}
diff --git a/test/Serialization/Recovery/typedefs.swift b/test/Serialization/Recovery/typedefs.swift
index 89970ef..a8d8ed0 100644
--- a/test/Serialization/Recovery/typedefs.swift
+++ b/test/Serialization/Recovery/typedefs.swift
@@ -21,9 +21,9 @@
// CHECK-SIL-LABEL: sil hidden @_T08typedefs11testSymbolsyyF
func testSymbols() {
// Check that the symbols are not using 'Bool'.
- // CHECK-SIL: function_ref @_T03Lib1xs5Int32Vfau
+ // CHECK-SIL: function_ref @_T03Lib1xs5Int32Vvau
_ = Lib.x
- // CHECK-SIL: function_ref @_T03Lib9usesAssocs5Int32VSgfau
+ // CHECK-SIL: function_ref @_T03Lib9usesAssocs5Int32VSgvau
_ = Lib.usesAssoc
} // CHECK-SIL: end sil function '_T08typedefs11testSymbolsyyF'
diff --git a/test/Serialization/always_inline.swift b/test/Serialization/always_inline.swift
index e4af1e6..a0269db 100644
--- a/test/Serialization/always_inline.swift
+++ b/test/Serialization/always_inline.swift
@@ -8,7 +8,7 @@
import def_always_inline
// SIL-LABEL: sil @main
-// SIL: [[RAW:%.+]] = global_addr @_T013always_inline3rawSbv : $*Bool
+// SIL: [[RAW:%.+]] = global_addr @_T013always_inline3rawSbvp : $*Bool
// SIL: [[FUNC:%.+]] = function_ref @_T017def_always_inline16testAlwaysInlineS2b1x_tF : $@convention(thin) (Bool) -> Bool
// SIL: [[RESULT:%.+]] = apply [[FUNC]]({{%.+}}) : $@convention(thin) (Bool) -> Bool
// SIL: store [[RESULT]] to [trivial] [[RAW]] : $*Bool
diff --git a/test/Serialization/function.swift b/test/Serialization/function.swift
index 982b74b..3cad990 100644
--- a/test/Serialization/function.swift
+++ b/test/Serialization/function.swift
@@ -13,7 +13,7 @@
}
// SIL: sil @main
-// SIL: [[RAW:%.+]] = global_addr @_T08function3rawSiv : $*Int
+// SIL: [[RAW:%.+]] = global_addr @_T08function3rawSivp : $*Int
// SIL: [[ZERO:%.+]] = function_ref @_T08def_func7getZeroSiyF : $@convention(thin) () -> Int
// SIL: [[RESULT:%.+]] = apply [[ZERO]]() : $@convention(thin) () -> Int
// SIL: store [[RESULT]] to [trivial] [[RAW]] : $*Int
diff --git a/test/Serialization/global_init.swift b/test/Serialization/global_init.swift
index e341f33..88f659f 100644
--- a/test/Serialization/global_init.swift
+++ b/test/Serialization/global_init.swift
@@ -18,8 +18,8 @@
// CHECK: let MyConst: Int
// CHECK: var MyVar: Int
-// CHECK-DAG: sil hidden [serialized] [global_init] @_T011global_init7MyConstSifau : $@convention(thin) () -> Builtin.RawPointer
-// CHECK-DAG: sil hidden [serialized] [global_init] @_T011global_init5MyVarSifau : $@convention(thin) () -> Builtin.RawPointer
+// CHECK-DAG: sil hidden [serialized] [global_init] @_T011global_init7MyConstSivau : $@convention(thin) () -> Builtin.RawPointer
+// CHECK-DAG: sil hidden [serialized] [global_init] @_T011global_init5MyVarSivau : $@convention(thin) () -> Builtin.RawPointer
func getGlobals() -> Int {
return MyVar + MyConst
diff --git a/test/Serialization/noinline.swift b/test/Serialization/noinline.swift
index 1f1a974..46c448f 100644
--- a/test/Serialization/noinline.swift
+++ b/test/Serialization/noinline.swift
@@ -8,7 +8,7 @@
import def_noinline
// SIL-LABEL: sil @main
-// SIL: [[RAW:%.+]] = global_addr @_T08noinline3rawSbv : $*Bool
+// SIL: [[RAW:%.+]] = global_addr @_T08noinline3rawSbvp : $*Bool
// SIL: [[FUNC:%.+]] = function_ref @_T012def_noinline12testNoinlineS2b1x_tF : $@convention(thin) (Bool) -> Bool
// SIL: [[RESULT:%.+]] = apply [[FUNC]]({{%.+}}) : $@convention(thin) (Bool) -> Bool
// SIL: store [[RESULT]] to [trivial] [[RAW]] : $*Bool
diff --git a/test/Serialization/transparent.swift b/test/Serialization/transparent.swift
index 7932fbb..73e90d6 100644
--- a/test/Serialization/transparent.swift
+++ b/test/Serialization/transparent.swift
@@ -8,13 +8,13 @@
import def_transparent
// SIL-LABEL: sil @main : $@convention(c) (Int32, UnsafeMutablePointer<Optional<UnsafeMutablePointer<Int8>>>) -> Int32 {
-// SIL: [[RAW:%.+]] = global_addr @_T011transparent3rawSbv : $*Bool
+// SIL: [[RAW:%.+]] = global_addr @_T011transparent3rawSbvp : $*Bool
// SIL: [[FUNC:%.+]] = function_ref @_T015def_transparent15testTransparentS2b1x_tF : $@convention(thin) (Bool) -> Bool
// SIL: [[RESULT:%.+]] = apply [[FUNC]]({{%.+}}) : $@convention(thin) (Bool) -> Bool
// SIL: store [[RESULT]] to [trivial] [[RAW]] : $*Bool
var raw = testTransparent(x: false)
-// SIL: [[TMP:%.+]] = global_addr @_T011transparent3tmps5Int32Vv : $*Int32
+// SIL: [[TMP:%.+]] = global_addr @_T011transparent3tmps5Int32Vvp : $*Int32
// SIL: [[FUNC2:%.+]] = function_ref @_T015def_transparent11testBuiltins5Int32VyF : $@convention(thin) () -> Int32
// SIL: [[RESULT2:%.+]] = apply [[FUNC2]]() : $@convention(thin) () -> Int32
// SIL: store [[RESULT2]] to [trivial] [[TMP]] : $*Int32
@@ -53,7 +53,7 @@
// SIL-LABEL: sil public_external [transparent] [serialized] @_T015def_transparent7WrapperVACs5Int32V3Val_tcfC : $@convention(method) (Int32, @thin Wrapper.Type) -> Wrapper {
// SIL-LABEL: sil public_external [transparent] [serialized] @_T015def_transparent7WrapperV8getValue{{[_0-9a-zA-Z]*}}F : $@convention(method) (Wrapper) -> Int32 {
-// SIL-LABEL: sil public_external [transparent] [serialized] @_T015def_transparent7WrapperV10valueAgains5Int32Vfg : $@convention(method) (Wrapper) -> Int32 {
+// SIL-LABEL: sil public_external [transparent] [serialized] @_T015def_transparent7WrapperV10valueAgains5Int32Vvg : $@convention(method) (Wrapper) -> Int32 {
// SIL-LABEL: sil public_external [transparent] [serialized] @_T015def_transparent7WrapperV13getValueAgain{{[_0-9a-zA-Z]*}}F : $@convention(method) (Wrapper) -> Int32 {
func test_wrapper() {
var w = Wrapper(Val: 42)
diff --git a/test/SourceKit/CodeComplete/complete_member.swift.response b/test/SourceKit/CodeComplete/complete_member.swift.response
index 7f5bfe0..46ccf07 100644
--- a/test/SourceKit/CodeComplete/complete_member.swift.response
+++ b/test/SourceKit/CodeComplete/complete_member.swift.response
@@ -31,7 +31,7 @@
key.doc.brief: "fooInstanceVar Aaa. Bbb.",
key.context: source.codecompletion.context.thisclass,
key.num_bytes_to_erase: 0,
- key.associated_usrs: "s:15complete_member11FooProtocolP14fooInstanceVarSiv",
+ key.associated_usrs: "s:15complete_member11FooProtocolP14fooInstanceVarSivp",
key.modulename: "complete_member"
}
]
diff --git a/test/SourceKit/CursorInfo/cursor_info.swift b/test/SourceKit/CursorInfo/cursor_info.swift
index d6b0945..63c2d51 100644
--- a/test/SourceKit/CursorInfo/cursor_info.swift
+++ b/test/SourceKit/CursorInfo/cursor_info.swift
@@ -220,7 +220,7 @@
// RUN: %sourcekitd-test -req=cursor -pos=9:8 %s -- -F %S/../Inputs/libIDE-mock-sdk %mcp_opt %s | %FileCheck -check-prefix=CHECK1 %s
// CHECK1: source.lang.swift.ref.var.global (4:5-4:9)
// CHECK1-NEXT: glob
-// CHECK1-NEXT: s:11cursor_info4globSiv{{$}}
+// CHECK1-NEXT: s:11cursor_info4globSivp{{$}}
// CHECK1-NEXT: Int
// FIXME(integers): Disabling the checks. See <rdar://problem/31207310>
@@ -239,7 +239,7 @@
// RUN: %sourcekitd-test -req=cursor -pos=9:12 %s -- -F %S/../Inputs/libIDE-mock-sdk -I %t.tmp %mcp_opt %s | %FileCheck -check-prefix=CHECK3 %s
// CHECK3: source.lang.swift.ref.var.local (8:12-8:13)
// CHECK3-NEXT: x{{$}}
-// CHECK3-NEXT: s:11cursor_info3gooySiF1xL_Siv{{$}}
+// CHECK3-NEXT: s:11cursor_info3gooySiF1xL_Sivp{{$}}
// CHECK3-NEXT: Int{{$}}
// CHECK3-NEXT: _T0SiD
// CHECK3-NEXT: <Declaration>let x: <Type usr="s:Si">Int</Type></Declaration>
diff --git a/test/SourceKit/CursorInfo/cursor_usr.swift b/test/SourceKit/CursorInfo/cursor_usr.swift
index bfc6f7b..b707065 100644
--- a/test/SourceKit/CursorInfo/cursor_usr.swift
+++ b/test/SourceKit/CursorInfo/cursor_usr.swift
@@ -14,7 +14,7 @@
// Sanity check that we have identical responses when things work.
// RUN: %sourcekitd-test -req=cursor -pos=5:5 %s -- -I %t -F %S/../Inputs/libIDE-mock-sdk %mcp_opt %s > %t.from_offset.txt
-// RUN: %sourcekitd-test -req=cursor -usr "s:10cursor_usr6globalSiv" %s -- -I %t -F %S/../Inputs/libIDE-mock-sdk %mcp_opt %s > %t.from_usr.txt
+// RUN: %sourcekitd-test -req=cursor -usr "s:10cursor_usr6globalSivp" %s -- -I %t -F %S/../Inputs/libIDE-mock-sdk %mcp_opt %s > %t.from_usr.txt
// RUN: %FileCheck %s -check-prefix=CHECK_SANITY1 < %t.from_offset.txt
// RUN: %FileCheck %s -check-prefix=CHECK_SANITY1 < %t.from_usr.txt
// RUN: diff -u %t.from_usr.txt %t.from_offset.txt
@@ -29,13 +29,13 @@
// Bogus USR.
// RUN: %sourcekitd-test -req=cursor -usr "s:blahblahblah" %s -- -I %t -F %S/../Inputs/libIDE-mock-sdk %mcp_opt %s | %FileCheck %s -check-prefix=EMPTY
// Missing s: prefix.
-// RUN: %sourcekitd-test -req=cursor -usr "10cursor_usr6globalSiv" %s -- -I %t -F %S/../Inputs/libIDE-mock-sdk %mcp_opt %s | %FileCheck %s -check-prefix=EMPTY
+// RUN: %sourcekitd-test -req=cursor -usr "10cursor_usr6globalSivp" %s -- -I %t -F %S/../Inputs/libIDE-mock-sdk %mcp_opt %s | %FileCheck %s -check-prefix=EMPTY
// FIXME: no support for clang USRs.
// RUN: %sourcekitd-test -req=cursor -usr "c:@S@FooStruct1" %s -- -I %t -F %S/../Inputs/libIDE-mock-sdk %mcp_opt %s | %FileCheck %s -check-prefix=EMPTY
// EMPTY: <empty cursor info>
// FIXME: missing symbol shows up as some other part of the USR (the type here).
-// RUN: %sourcekitd-test -req=cursor -usr "s:10cursor_usr11global_noneSiv" %s -- -I %t -F %S/../Inputs/libIDE-mock-sdk %mcp_opt %s | %FileCheck %s -check-prefix=SHOULD_BE_EMPTY
+// RUN: %sourcekitd-test -req=cursor -usr "s:10cursor_usr11global_noneSivp" %s -- -I %t -F %S/../Inputs/libIDE-mock-sdk %mcp_opt %s | %FileCheck %s -check-prefix=SHOULD_BE_EMPTY
// SHOULD_BE_EMPTY: source.lang.swift.decl.struct ()
// SHOULD_BE_EMPTY: Int
diff --git a/test/SourceKit/DocSupport/doc_clang_module.swift.response b/test/SourceKit/DocSupport/doc_clang_module.swift.response
index 66d3240..b6465b3 100644
--- a/test/SourceKit/DocSupport/doc_clang_module.swift.response
+++ b/test/SourceKit/DocSupport/doc_clang_module.swift.response
@@ -4921,7 +4921,7 @@
{
key.kind: source.lang.swift.decl.var.instance,
key.name: "rawValue",
- key.usr: "s:SC8FooEnum1V8rawValues6UInt32Vv",
+ key.usr: "s:SC8FooEnum1V8rawValues6UInt32Vvp",
key.offset: 156,
key.length: 20,
key.fully_annotated_decl: "<decl.var.instance><syntaxtype.keyword>var</syntaxtype.keyword> <decl.name>rawValue</decl.name>: <decl.var.type><ref.struct usr=\"s:s6UInt32V\">UInt32</ref.struct></decl.var.type></decl.var.instance>",
@@ -4929,12 +4929,12 @@
{
key.kind: source.lang.swift.ref.var.instance,
key.name: "rawValue",
- key.usr: "s:s16RawRepresentableP8rawValue0aD0Qzv"
+ key.usr: "s:s16RawRepresentableP8rawValue0aD0Qzvp"
},
{
key.kind: source.lang.swift.ref.var.instance,
key.name: "rawValue",
- key.usr: "s:s16RawRepresentableP8rawValue0aD0Qzv"
+ key.usr: "s:s16RawRepresentableP8rawValue0aD0Qzvp"
}
]
},
@@ -5044,7 +5044,7 @@
{
key.kind: source.lang.swift.decl.var.instance,
key.name: "rawValue",
- key.usr: "s:SC8FooEnum2V8rawValues6UInt32Vv",
+ key.usr: "s:SC8FooEnum2V8rawValues6UInt32Vvp",
key.offset: 393,
key.length: 20,
key.fully_annotated_decl: "<decl.var.instance><syntaxtype.keyword>var</syntaxtype.keyword> <decl.name>rawValue</decl.name>: <decl.var.type><ref.struct usr=\"s:s6UInt32V\">UInt32</ref.struct></decl.var.type></decl.var.instance>",
@@ -5052,12 +5052,12 @@
{
key.kind: source.lang.swift.ref.var.instance,
key.name: "rawValue",
- key.usr: "s:s16RawRepresentableP8rawValue0aD0Qzv"
+ key.usr: "s:s16RawRepresentableP8rawValue0aD0Qzvp"
},
{
key.kind: source.lang.swift.ref.var.instance,
key.name: "rawValue",
- key.usr: "s:s16RawRepresentableP8rawValue0aD0Qzv"
+ key.usr: "s:s16RawRepresentableP8rawValue0aD0Qzvp"
}
]
},
@@ -5174,7 +5174,7 @@
{
key.kind: source.lang.swift.decl.var.instance,
key.name: "rawValue",
- key.usr: "s:SC8FooEnum3V8rawValues6UInt32Vv",
+ key.usr: "s:SC8FooEnum3V8rawValues6UInt32Vvp",
key.offset: 662,
key.length: 20,
key.fully_annotated_decl: "<decl.var.instance><syntaxtype.keyword>var</syntaxtype.keyword> <decl.name>rawValue</decl.name>: <decl.var.type><ref.struct usr=\"s:s6UInt32V\">UInt32</ref.struct></decl.var.type></decl.var.instance>",
@@ -5182,12 +5182,12 @@
{
key.kind: source.lang.swift.ref.var.instance,
key.name: "rawValue",
- key.usr: "s:s16RawRepresentableP8rawValue0aD0Qzv"
+ key.usr: "s:s16RawRepresentableP8rawValue0aD0Qzvp"
},
{
key.kind: source.lang.swift.ref.var.instance,
key.name: "rawValue",
- key.usr: "s:s16RawRepresentableP8rawValue0aD0Qzv"
+ key.usr: "s:s16RawRepresentableP8rawValue0aD0Qzvp"
}
]
},
@@ -5780,9 +5780,9 @@
{
key.kind: source.lang.swift.decl.var.instance,
key.name: "isEmpty",
- key.usr: "s:s10SetAlgebraPsE7isEmptySbv::SYNTHESIZED::c:@E@FooRuncingOptions",
- key.original_usr: "s:s10SetAlgebraPsE7isEmptySbv",
- key.doc.full_as_xml: "<Other><Name>isEmpty</Name><USR>s:s10SetAlgebraPsE7isEmptySbv</USR><Declaration>var isEmpty: Bool { get }</Declaration><CommentParts><Abstract><Para>A Boolean value that indicates whether the set has no elements.</Para></Abstract></CommentParts></Other>",
+ key.usr: "s:s10SetAlgebraPsE7isEmptySbvp::SYNTHESIZED::c:@E@FooRuncingOptions",
+ key.original_usr: "s:s10SetAlgebraPsE7isEmptySbvp",
+ key.doc.full_as_xml: "<Other><Name>isEmpty</Name><USR>s:s10SetAlgebraPsE7isEmptySbvp</USR><Declaration>var isEmpty: Bool { get }</Declaration><CommentParts><Abstract><Para>A Boolean value that indicates whether the set has no elements.</Para></Abstract></CommentParts></Other>",
key.offset: 2559,
key.length: 25,
key.fully_annotated_decl: "<decl.var.instance><syntaxtype.keyword>var</syntaxtype.keyword> <decl.name>isEmpty</decl.name>: <decl.var.type><ref.struct usr=\"s:Sb\">Bool</ref.struct></decl.var.type> { <syntaxtype.keyword>get</syntaxtype.keyword> }</decl.var.instance>"
@@ -7466,7 +7466,7 @@
{
key.kind: source.lang.swift.decl.var.instance,
key.name: "rawValue",
- key.usr: "s:SC11FooSubEnum1V8rawValues6UInt32Vv",
+ key.usr: "s:SC11FooSubEnum1V8rawValues6UInt32Vvp",
key.offset: 7353,
key.length: 20,
key.fully_annotated_decl: "<decl.var.instance><syntaxtype.keyword>var</syntaxtype.keyword> <decl.name>rawValue</decl.name>: <decl.var.type><ref.struct usr=\"s:s6UInt32V\">UInt32</ref.struct></decl.var.type></decl.var.instance>",
@@ -7474,12 +7474,12 @@
{
key.kind: source.lang.swift.ref.var.instance,
key.name: "rawValue",
- key.usr: "s:s16RawRepresentableP8rawValue0aD0Qzv"
+ key.usr: "s:s16RawRepresentableP8rawValue0aD0Qzvp"
},
{
key.kind: source.lang.swift.ref.var.instance,
key.name: "rawValue",
- key.usr: "s:s16RawRepresentableP8rawValue0aD0Qzv"
+ key.usr: "s:s16RawRepresentableP8rawValue0aD0Qzvp"
}
]
},
diff --git a/test/SourceKit/DocSupport/doc_error_domain.swift b/test/SourceKit/DocSupport/doc_error_domain.swift
index e3932bd..c961fef 100644
--- a/test/SourceKit/DocSupport/doc_error_domain.swift
+++ b/test/SourceKit/DocSupport/doc_error_domain.swift
@@ -28,5 +28,5 @@
// CHECK: key.kind: source.lang.swift.decl.var.static,
// CHECK-NEXT: key.name: "errFirst",
-// CHECK-NEXT: key.usr: "s:SC7MyErrorV8errFirstAB4CodeOvZ",
+// CHECK-NEXT: key.usr: "s:SC7MyErrorV8errFirstAB4CodeOvpZ",
// CHECK-NEXT: This is first error.
diff --git a/test/SourceKit/DocSupport/doc_source_file.swift.response b/test/SourceKit/DocSupport/doc_source_file.swift.response
index 9dcca14..123bf46 100644
--- a/test/SourceKit/DocSupport/doc_source_file.swift.response
+++ b/test/SourceKit/DocSupport/doc_source_file.swift.response
@@ -255,7 +255,7 @@
{
key.kind: source.lang.swift.ref.var.instance,
key.name: "instV",
- key.usr: "s:8__main__2CCC5instVAA3CC0Cv",
+ key.usr: "s:8__main__2CCC5instVAA3CC0Cvp",
key.offset: 267,
key.length: 5
},
@@ -499,7 +499,7 @@
{
key.kind: source.lang.swift.ref.var.global,
key.name: "globV",
- key.usr: "s:8__main__5globVSiv",
+ key.usr: "s:8__main__5globVSivp",
key.offset: 508,
key.length: 5
},
@@ -535,7 +535,7 @@
{
key.kind: source.lang.swift.ref.var.instance,
key.name: "instV",
- key.usr: "s:8__main__2CCC5instVAA3CC0Cv",
+ key.usr: "s:8__main__2CCC5instVAA3CC0Cvp",
key.offset: 530,
key.length: 5
},
@@ -1160,7 +1160,7 @@
{
key.kind: source.lang.swift.ref.var.instance,
key.name: "value",
- key.usr: "s:8__main__16ComputedPropertyC5valueSiv",
+ key.usr: "s:8__main__16ComputedPropertyC5valueSivp",
key.offset: 1293,
key.length: 5
},
@@ -1179,7 +1179,7 @@
{
key.kind: source.lang.swift.ref.var.instance,
key.name: "readOnly",
- key.usr: "s:8__main__16ComputedPropertyC8readOnlySiv",
+ key.usr: "s:8__main__16ComputedPropertyC8readOnlySivp",
key.offset: 1308,
key.length: 8
},
@@ -1192,7 +1192,7 @@
{
key.kind: source.lang.swift.ref.var.instance,
key.name: "value",
- key.usr: "s:8__main__16ComputedPropertyC5valueSiv",
+ key.usr: "s:8__main__16ComputedPropertyC5valueSivp",
key.offset: 1322,
key.length: 5
},
@@ -1211,7 +1211,7 @@
{
key.kind: source.lang.swift.ref.var.instance,
key.name: "value",
- key.usr: "s:8__main__16ComputedPropertyC5valueSiv",
+ key.usr: "s:8__main__16ComputedPropertyC5valueSivp",
key.offset: 1337,
key.length: 5
},
@@ -1242,7 +1242,7 @@
{
key.kind: source.lang.swift.ref.function.subscript,
key.name: "subscript(_:)",
- key.usr: "s:8__main__3CC2C9subscriptS2ici",
+ key.usr: "s:8__main__3CC2CS2icip",
key.offset: 1357,
key.length: 1
},
@@ -1254,7 +1254,7 @@
{
key.kind: source.lang.swift.ref.function.subscript,
key.name: "subscript(_:)",
- key.usr: "s:8__main__3CC2C9subscriptS2ici",
+ key.usr: "s:8__main__3CC2CS2icip",
key.offset: 1359,
key.length: 1
},
@@ -1267,7 +1267,7 @@
{
key.kind: source.lang.swift.ref.function.subscript,
key.name: "subscript(_:)",
- key.usr: "s:8__main__3CC2C9subscriptS2ici",
+ key.usr: "s:8__main__3CC2CS2icip",
key.offset: 1366,
key.length: 1
},
@@ -1279,7 +1279,7 @@
{
key.kind: source.lang.swift.ref.function.subscript,
key.name: "subscript(_:)",
- key.usr: "s:8__main__3CC2C9subscriptS2ici",
+ key.usr: "s:8__main__3CC2CS2icip",
key.offset: 1368,
key.length: 1
},
@@ -1298,7 +1298,7 @@
{
key.kind: source.lang.swift.ref.function.subscript,
key.name: "subscript(_:)",
- key.usr: "s:8__main__3CC2C9subscriptS2ici",
+ key.usr: "s:8__main__3CC2CS2icip",
key.offset: 1379,
key.length: 1
},
@@ -1310,7 +1310,7 @@
{
key.kind: source.lang.swift.ref.function.subscript,
key.name: "subscript(_:)",
- key.usr: "s:8__main__3CC2C9subscriptS2ici",
+ key.usr: "s:8__main__3CC2CS2icip",
key.offset: 1381,
key.length: 1
},
@@ -1393,7 +1393,7 @@
{
key.kind: source.lang.swift.ref.var.global,
key.name: "globReadOnly",
- key.usr: "s:8__main__12globReadOnlyAA2S2Vv",
+ key.usr: "s:8__main__12globReadOnlyAA2S2Vvp",
key.offset: 1496,
key.length: 12
},
@@ -1864,7 +1864,7 @@
{
key.kind: source.lang.swift.decl.var.global,
key.name: "globV",
- key.usr: "s:8__main__5globVSiv",
+ key.usr: "s:8__main__5globVSivp",
key.fully_annotated_decl: "<decl.var.global><syntaxtype.keyword>var</syntaxtype.keyword> <decl.name>globV</decl.name>: <decl.var.type><ref.struct usr=\"s:Si\">Int</ref.struct></decl.var.type></decl.var.global>"
},
{
@@ -1878,7 +1878,7 @@
{
key.kind: source.lang.swift.decl.var.instance,
key.name: "x",
- key.usr: "s:8__main__3CC0C1xSiv",
+ key.usr: "s:8__main__3CC0C1xSivp",
key.fully_annotated_decl: "<decl.var.instance><syntaxtype.keyword>var</syntaxtype.keyword> <decl.name>x</decl.name>: <decl.var.type><ref.struct usr=\"s:Si\">Int</ref.struct></decl.var.type></decl.var.instance>"
}
]
@@ -1894,7 +1894,7 @@
{
key.kind: source.lang.swift.decl.var.instance,
key.name: "instV",
- key.usr: "s:8__main__2CCC5instVAA3CC0Cv",
+ key.usr: "s:8__main__2CCC5instVAA3CC0Cvp",
key.fully_annotated_decl: "<decl.var.instance><syntaxtype.keyword>var</syntaxtype.keyword> <decl.name>instV</decl.name>: <decl.var.type><ref.class usr=\"s:8__main__3CC0C\">CC0</ref.class></decl.var.type></decl.var.instance>"
},
{
@@ -2157,12 +2157,12 @@
{
key.kind: source.lang.swift.decl.var.instance,
key.name: "extV",
- key.usr: "s:8__main__2CCC4extVSiv",
+ key.usr: "s:8__main__2CCC4extVSivp",
key.fully_annotated_decl: "<decl.var.instance><syntaxtype.keyword>var</syntaxtype.keyword> <decl.name>extV</decl.name>: <decl.var.type><ref.struct usr=\"s:Si\">Int</ref.struct></decl.var.type> { <syntaxtype.keyword>get</syntaxtype.keyword> }</decl.var.instance>"
},
{
key.kind: source.lang.swift.decl.function.accessor.getter,
- key.usr: "s:8__main__2CCC4extVSifg",
+ key.usr: "s:8__main__2CCC4extVSivg",
key.offset: 748,
key.length: 11,
key.fully_annotated_decl: "<decl.function.accessor.getter><decl.name>get</decl.name> {}</decl.function.accessor.getter>"
@@ -2187,7 +2187,7 @@
{
key.kind: source.lang.swift.decl.var.global,
key.name: "globV2",
- key.usr: "s:8__main__6globV2AA5SubCCCv",
+ key.usr: "s:8__main__6globV2AA5SubCCCvp",
key.fully_annotated_decl: "<decl.var.global><syntaxtype.keyword>var</syntaxtype.keyword> <decl.name>globV2</decl.name>: <decl.var.type><ref.class usr=\"s:8__main__5SubCCC\">SubCC</ref.class></decl.var.type></decl.var.global>"
},
{
@@ -2201,19 +2201,19 @@
{
key.kind: source.lang.swift.decl.var.instance,
key.name: "value",
- key.usr: "s:8__main__16ComputedPropertyC5valueSiv",
+ key.usr: "s:8__main__16ComputedPropertyC5valueSivp",
key.fully_annotated_decl: "<decl.var.instance><syntaxtype.keyword>var</syntaxtype.keyword> <decl.name>value</decl.name>: <decl.var.type><ref.struct usr=\"s:Si\">Int</ref.struct></decl.var.type> { <syntaxtype.keyword>get</syntaxtype.keyword> <syntaxtype.keyword>set</syntaxtype.keyword> }</decl.var.instance>"
},
{
key.kind: source.lang.swift.decl.function.accessor.getter,
- key.usr: "s:8__main__16ComputedPropertyC5valueSifg",
+ key.usr: "s:8__main__16ComputedPropertyC5valueSivg",
key.offset: 853,
key.length: 51,
key.fully_annotated_decl: "<decl.function.accessor.getter><decl.name>get</decl.name> {}</decl.function.accessor.getter>"
},
{
key.kind: source.lang.swift.decl.function.accessor.setter,
- key.usr: "s:8__main__16ComputedPropertyC5valueSifs",
+ key.usr: "s:8__main__16ComputedPropertyC5valueSivs",
key.offset: 910,
key.length: 49,
key.fully_annotated_decl: "<decl.function.accessor.setter><decl.name>set(newVal)</decl.name> {}</decl.function.accessor.setter>",
@@ -2229,12 +2229,12 @@
{
key.kind: source.lang.swift.decl.var.instance,
key.name: "readOnly",
- key.usr: "s:8__main__16ComputedPropertyC8readOnlySiv",
+ key.usr: "s:8__main__16ComputedPropertyC8readOnlySivp",
key.fully_annotated_decl: "<decl.var.instance><syntaxtype.keyword>var</syntaxtype.keyword> <decl.name>readOnly</decl.name>: <decl.var.type><ref.struct usr=\"s:Si\">Int</ref.struct></decl.var.type> { <syntaxtype.keyword>get</syntaxtype.keyword> }</decl.var.instance>"
},
{
key.kind: source.lang.swift.decl.function.accessor.getter,
- key.usr: "s:8__main__16ComputedPropertyC8readOnlySifg",
+ key.usr: "s:8__main__16ComputedPropertyC8readOnlySivg",
key.offset: 987,
key.length: 11,
key.fully_annotated_decl: "<decl.function.accessor.getter><decl.name>get</decl.name> {}</decl.function.accessor.getter>"
@@ -2334,7 +2334,7 @@
{
key.kind: source.lang.swift.decl.function.subscript,
key.name: "subscript(_:)",
- key.usr: "s:8__main__3CC2C9subscriptS2ici",
+ key.usr: "s:8__main__3CC2CS2icip",
key.offset: 1129,
key.length: 99,
key.fully_annotated_decl: "<decl.function.subscript><syntaxtype.keyword>subscript</syntaxtype.keyword>(<decl.var.parameter><decl.var.parameter.name>i</decl.var.parameter.name>: <decl.var.parameter.type><ref.struct usr=\"s:Si\">Int</ref.struct></decl.var.parameter.type></decl.var.parameter>) -> <decl.function.returntype><ref.struct usr=\"s:Si\">Int</ref.struct></decl.function.returntype> { <syntaxtype.keyword>get</syntaxtype.keyword> <syntaxtype.keyword>set</syntaxtype.keyword> }</decl.function.subscript>",
@@ -2350,14 +2350,14 @@
},
{
key.kind: source.lang.swift.decl.function.accessor.getter,
- key.usr: "s:8__main__3CC2C9subscriptS2icfg",
+ key.usr: "s:8__main__3CC2CS2icig",
key.offset: 1162,
key.length: 25,
key.fully_annotated_decl: "<decl.function.accessor.getter><decl.name>get</decl.name> {}</decl.function.accessor.getter>"
},
{
key.kind: source.lang.swift.decl.function.accessor.setter,
- key.usr: "s:8__main__3CC2C9subscriptS2icfs",
+ key.usr: "s:8__main__3CC2CS2icis",
key.offset: 1193,
key.length: 31,
key.fully_annotated_decl: "<decl.function.accessor.setter><decl.name>set(vvv)</decl.name> {}</decl.function.accessor.setter>",
@@ -2417,12 +2417,12 @@
{
key.kind: source.lang.swift.decl.var.global,
key.name: "globReadOnly",
- key.usr: "s:8__main__12globReadOnlyAA2S2Vv",
+ key.usr: "s:8__main__12globReadOnlyAA2S2Vvp",
key.fully_annotated_decl: "<decl.var.global><syntaxtype.keyword>var</syntaxtype.keyword> <decl.name>globReadOnly</decl.name>: <decl.var.type><ref.struct usr=\"s:8__main__2S2V\">S2</ref.struct></decl.var.type> { <syntaxtype.keyword>get</syntaxtype.keyword> }</decl.var.global>"
},
{
key.kind: source.lang.swift.decl.function.accessor.getter,
- key.usr: "s:8__main__12globReadOnlyAA2S2Vfg",
+ key.usr: "s:8__main__12globReadOnlyAA2S2Vvg",
key.offset: 1449,
key.length: 25,
key.fully_annotated_decl: "<decl.function.accessor.getter><decl.name>get</decl.name> {}</decl.function.accessor.getter>"
@@ -2545,12 +2545,12 @@
{
key.kind: source.lang.swift.decl.var.instance,
key.name: "p",
- key.usr: "s:8__main__5Prot2P1pSiv",
+ key.usr: "s:8__main__5Prot2P1pSivp",
key.fully_annotated_decl: "<decl.var.instance><syntaxtype.keyword>var</syntaxtype.keyword> <decl.name>p</decl.name>: <decl.var.type><ref.struct usr=\"s:Si\">Int</ref.struct></decl.var.type> { <syntaxtype.keyword>get</syntaxtype.keyword> }</decl.var.instance>"
},
{
key.kind: source.lang.swift.decl.function.accessor.getter,
- key.usr: "s:8__main__5Prot2P1pSifg",
+ key.usr: "s:8__main__5Prot2P1pSivg",
key.fully_annotated_decl: "<decl.function.accessor.getter><decl.name>get</decl.name> {}</decl.function.accessor.getter>"
},
{
@@ -2606,13 +2606,13 @@
{
key.kind: source.lang.swift.decl.var.instance,
key.name: "p",
- key.usr: "s:8__main__2S1V1pSiv",
+ key.usr: "s:8__main__2S1V1pSivp",
key.fully_annotated_decl: "<decl.var.instance><syntaxtype.keyword>var</syntaxtype.keyword> <decl.name>p</decl.name>: <decl.var.type><ref.struct usr=\"s:Si\">Int</ref.struct></decl.var.type></decl.var.instance>",
key.conforms: [
{
key.kind: source.lang.swift.ref.var.instance,
key.name: "p",
- key.usr: "s:8__main__5Prot2P1pSiv"
+ key.usr: "s:8__main__5Prot2P1pSivp"
}
]
},
diff --git a/test/SourceKit/DocSupport/doc_swift_module.swift.response b/test/SourceKit/DocSupport/doc_swift_module.swift.response
index eb5725a..32d9f9a 100644
--- a/test/SourceKit/DocSupport/doc_swift_module.swift.response
+++ b/test/SourceKit/DocSupport/doc_swift_module.swift.response
@@ -1204,7 +1204,7 @@
{
key.kind: source.lang.swift.decl.var.instance,
key.name: "p",
- key.usr: "s:4cake2C1C1pSiv",
+ key.usr: "s:4cake2C1C1pSivp",
key.offset: 78,
key.length: 10,
key.fully_annotated_decl: "<decl.var.instance><syntaxtype.keyword>var</syntaxtype.keyword> <decl.name>p</decl.name>: <decl.var.type><ref.struct usr=\"s:Si\">Int</ref.struct></decl.var.type></decl.var.instance>",
@@ -1212,12 +1212,12 @@
{
key.kind: source.lang.swift.ref.var.instance,
key.name: "p",
- key.usr: "s:4cake4ProtP1pSiv"
+ key.usr: "s:4cake4ProtP1pSivp"
},
{
key.kind: source.lang.swift.ref.var.instance,
key.name: "p",
- key.usr: "s:4cake4ProtP1pSiv"
+ key.usr: "s:4cake4ProtP1pSivp"
}
]
},
@@ -1244,7 +1244,7 @@
{
key.kind: source.lang.swift.decl.function.subscript,
key.name: "subscript(_:)",
- key.usr: "s:4cake2C1C9subscriptS2ici",
+ key.usr: "s:4cake2C1CS2icip",
key.offset: 110,
key.length: 38,
key.fully_annotated_decl: "<decl.function.subscript><syntaxtype.keyword>subscript</syntaxtype.keyword>(<decl.var.parameter><decl.var.parameter.name>index</decl.var.parameter.name>: <decl.var.parameter.type><ref.struct usr=\"s:Si\">Int</ref.struct></decl.var.parameter.type></decl.var.parameter>) -> <decl.function.returntype><ref.struct usr=\"s:Si\">Int</ref.struct></decl.function.returntype> { <syntaxtype.keyword>get</syntaxtype.keyword> }</decl.function.subscript>",
@@ -1261,7 +1261,7 @@
{
key.kind: source.lang.swift.decl.function.subscript,
key.name: "subscript(index:)",
- key.usr: "s:4cake2C1C9subscriptSiSf5index_tci",
+ key.usr: "s:4cake2C1CSiSf5index_tcip",
key.offset: 154,
key.length: 40,
key.fully_annotated_decl: "<decl.function.subscript><syntaxtype.keyword>subscript</syntaxtype.keyword>(<decl.var.parameter><decl.var.parameter.argument_label>index</decl.var.parameter.argument_label> <decl.var.parameter.name>i</decl.var.parameter.name>: <decl.var.parameter.type><ref.struct usr=\"s:Sf\">Float</ref.struct></decl.var.parameter.type></decl.var.parameter>) -> <decl.function.returntype><ref.struct usr=\"s:Si\">Int</ref.struct></decl.function.returntype> { <syntaxtype.keyword>get</syntaxtype.keyword> }</decl.function.subscript>",
@@ -1321,8 +1321,8 @@
{
key.kind: source.lang.swift.decl.function.subscript,
key.name: "subscript(_:)",
- key.usr: "s:4cake4ProtPAAE9subscriptS2ici::SYNTHESIZED::s:4cake2C1C",
- key.original_usr: "s:4cake4ProtPAAE9subscriptS2ici",
+ key.usr: "s:4cake4ProtPAAES2icip::SYNTHESIZED::s:4cake2C1C",
+ key.original_usr: "s:4cake4ProtPAAES2icip",
key.offset: 288,
key.length: 38,
key.fully_annotated_decl: "<decl.function.subscript><syntaxtype.keyword>subscript</syntaxtype.keyword>(<decl.var.parameter><decl.var.parameter.name>index</decl.var.parameter.name>: <decl.var.parameter.type><ref.struct usr=\"s:Si\">Int</ref.struct></decl.var.parameter.type></decl.var.parameter>) -> <decl.function.returntype><ref.struct usr=\"s:Si\">Int</ref.struct></decl.function.returntype> { <syntaxtype.keyword>get</syntaxtype.keyword> }</decl.function.subscript>",
@@ -1462,8 +1462,8 @@
{
key.kind: source.lang.swift.decl.function.subscript,
key.name: "subscript(_:)",
- key.usr: "s:4cake4ProtPAAE9subscriptS2ici::SYNTHESIZED::s:4cake2C2C",
- key.original_usr: "s:4cake4ProtPAAE9subscriptS2ici",
+ key.usr: "s:4cake4ProtPAAES2icip::SYNTHESIZED::s:4cake2C2C",
+ key.original_usr: "s:4cake4ProtPAAES2icip",
key.offset: 559,
key.length: 38,
key.fully_annotated_decl: "<decl.function.subscript><syntaxtype.keyword>subscript</syntaxtype.keyword>(<decl.var.parameter><decl.var.parameter.name>index</decl.var.parameter.name>: <decl.var.parameter.type><ref.struct usr=\"s:Si\">Int</ref.struct></decl.var.parameter.type></decl.var.parameter>) -> <decl.function.returntype><ref.struct usr=\"s:Si\">Int</ref.struct></decl.function.returntype> { <syntaxtype.keyword>get</syntaxtype.keyword> }</decl.function.subscript>",
@@ -1624,7 +1624,7 @@
{
key.kind: source.lang.swift.decl.var.instance,
key.name: "p",
- key.usr: "s:4cake4ProtP1pSiv",
+ key.usr: "s:4cake4ProtP1pSivp",
key.offset: 896,
key.length: 18,
key.fully_annotated_decl: "<decl.var.instance><syntaxtype.keyword>var</syntaxtype.keyword> <decl.name>p</decl.name>: <decl.var.type><ref.struct usr=\"s:Si\">Int</ref.struct></decl.var.type> { <syntaxtype.keyword>get</syntaxtype.keyword> }</decl.var.instance>"
@@ -1669,7 +1669,7 @@
{
key.kind: source.lang.swift.decl.function.subscript,
key.name: "subscript(_:)",
- key.usr: "s:4cake4ProtPAAE9subscriptS2ici",
+ key.usr: "s:4cake4ProtPAAES2icip",
key.offset: 990,
key.length: 38,
key.fully_annotated_decl: "<decl.function.subscript><syntaxtype.keyword>subscript</syntaxtype.keyword>(<decl.var.parameter><decl.var.parameter.name>index</decl.var.parameter.name>: <decl.var.parameter.type><ref.struct usr=\"s:Si\">Int</ref.struct></decl.var.parameter.type></decl.var.parameter>) -> <decl.function.returntype><ref.struct usr=\"s:Si\">Int</ref.struct></decl.function.returntype> { <syntaxtype.keyword>get</syntaxtype.keyword> }</decl.function.subscript>",
@@ -1771,7 +1771,7 @@
{
key.kind: source.lang.swift.decl.var.instance,
key.name: "b",
- key.usr: "s:4cake2S1V2S2V1bSiv",
+ key.usr: "s:4cake2S1V2S2V1bSivp",
key.offset: 1221,
key.length: 10,
key.fully_annotated_decl: "<decl.var.instance><syntaxtype.keyword>let</syntaxtype.keyword> <decl.name>b</decl.name>: <decl.var.type><ref.struct usr=\"s:Si\">Int</ref.struct></decl.var.type></decl.var.instance>"
diff --git a/test/SourceKit/DocSupport/doc_swift_module1.swift.response b/test/SourceKit/DocSupport/doc_swift_module1.swift.response
index 8a3ad15..2517292 100644
--- a/test/SourceKit/DocSupport/doc_swift_module1.swift.response
+++ b/test/SourceKit/DocSupport/doc_swift_module1.swift.response
@@ -455,7 +455,7 @@
{
key.kind: source.lang.swift.decl.var.instance,
key.name: "Ins",
- key.usr: "s:5cake12P1P3InsSiv",
+ key.usr: "s:5cake12P1P3InsSivp",
key.offset: 62,
key.length: 24,
key.fully_annotated_decl: "<decl.var.instance><syntaxtype.keyword>var</syntaxtype.keyword> <decl.name>Ins</decl.name>: <decl.var.type><ref.struct usr=\"s:Si\">Int</ref.struct></decl.var.type> { <syntaxtype.keyword>get</syntaxtype.keyword> <syntaxtype.keyword>set</syntaxtype.keyword> }</decl.var.instance>"
@@ -487,7 +487,7 @@
{
key.kind: source.lang.swift.decl.function.subscript,
key.name: "subscript(_:)",
- key.usr: "s:5cake12P1P9subscriptS2ici",
+ key.usr: "s:5cake12P1PS2icip",
key.offset: 127,
key.length: 38,
key.fully_annotated_decl: "<decl.function.subscript><syntaxtype.keyword>subscript</syntaxtype.keyword>(<decl.var.parameter><decl.var.parameter.name>a</decl.var.parameter.name>: <decl.var.parameter.type><ref.struct usr=\"s:Si\">Int</ref.struct></decl.var.parameter.type></decl.var.parameter>) -> <decl.function.returntype><ref.struct usr=\"s:Si\">Int</ref.struct></decl.function.returntype> { <syntaxtype.keyword>get</syntaxtype.keyword> <syntaxtype.keyword>set</syntaxtype.keyword> }</decl.function.subscript>",
@@ -566,8 +566,8 @@
{
key.kind: source.lang.swift.decl.var.instance,
key.name: "Ins",
- key.usr: "s:5cake12P2PAAE3InsSiv",
- key.default_implementation_of: "s:5cake12P1P3InsSiv",
+ key.usr: "s:5cake12P2PAAE3InsSivp",
+ key.default_implementation_of: "s:5cake12P1P3InsSivp",
key.offset: 288,
key.length: 12,
key.fully_annotated_decl: "<decl.var.instance><syntaxtype.keyword>var</syntaxtype.keyword> <decl.name>Ins</decl.name>: <decl.var.type><ref.struct usr=\"s:Si\">Int</ref.struct></decl.var.type> { <syntaxtype.keyword>get</syntaxtype.keyword> <syntaxtype.keyword>set</syntaxtype.keyword> }</decl.var.instance>"
@@ -600,8 +600,8 @@
{
key.kind: source.lang.swift.decl.function.subscript,
key.name: "subscript(_:)",
- key.usr: "s:5cake12P2PAAE9subscriptS2ici",
- key.default_implementation_of: "s:5cake12P1P9subscriptS2ici",
+ key.usr: "s:5cake12P2PAAES2icip",
+ key.default_implementation_of: "s:5cake12P1PS2icip",
key.offset: 341,
key.length: 26,
key.fully_annotated_decl: "<decl.function.subscript><syntaxtype.keyword>subscript</syntaxtype.keyword>(<decl.var.parameter><decl.var.parameter.name>a</decl.var.parameter.name>: <decl.var.parameter.type><ref.struct usr=\"s:Si\">Int</ref.struct></decl.var.parameter.type></decl.var.parameter>) -> <decl.function.returntype><ref.struct usr=\"s:Si\">Int</ref.struct></decl.function.returntype> { <syntaxtype.keyword>get</syntaxtype.keyword> <syntaxtype.keyword>set</syntaxtype.keyword> }</decl.function.subscript>",
diff --git a/test/SourceKit/Indexing/Inputs/cycle-depend/A.response b/test/SourceKit/Indexing/Inputs/cycle-depend/A.response
index 8e051a3..09d54b3 100644
--- a/test/SourceKit/Indexing/Inputs/cycle-depend/A.response
+++ b/test/SourceKit/Indexing/Inputs/cycle-depend/A.response
@@ -81,16 +81,16 @@
{
key.kind: source.lang.swift.decl.var.instance,
key.name: "x",
- key.usr: "s:1AAAC1x1BADCv",
+ key.usr: "s:1AAAC1x1BADCvp",
key.entities: [
{
key.kind: source.lang.swift.decl.function.accessor.getter,
- key.usr: "s:1AAAC1x1BADCfg",
+ key.usr: "s:1AAAC1x1BADCvg",
key.is_dynamic: 1
},
{
key.kind: source.lang.swift.decl.function.accessor.setter,
- key.usr: "s:1AAAC1x1BADCfs",
+ key.usr: "s:1AAAC1x1BADCvs",
key.is_dynamic: 1
}
]
diff --git a/test/SourceKit/Indexing/Inputs/implicit-vis/a.index.response b/test/SourceKit/Indexing/Inputs/implicit-vis/a.index.response
index 970dbad..6b05ecb 100644
--- a/test/SourceKit/Indexing/Inputs/implicit-vis/a.index.response
+++ b/test/SourceKit/Indexing/Inputs/implicit-vis/a.index.response
@@ -20,20 +20,20 @@
{
key.kind: source.lang.swift.decl.var.instance,
key.name: "b",
- key.usr: "s:12implicit_vis1AC1bAA1BCv",
+ key.usr: "s:12implicit_vis1AC1bAA1BCvp",
key.line: 2,
key.column: 6,
key.entities: [
{
key.kind: source.lang.swift.decl.function.accessor.getter,
- key.usr: "s:12implicit_vis1AC1bAA1BCfg",
+ key.usr: "s:12implicit_vis1AC1bAA1BCvg",
key.line: 2,
key.column: 6,
key.is_dynamic: 1
},
{
key.kind: source.lang.swift.decl.function.accessor.setter,
- key.usr: "s:12implicit_vis1AC1bAA1BCfs",
+ key.usr: "s:12implicit_vis1AC1bAA1BCvs",
key.line: 2,
key.column: 6,
key.is_dynamic: 1
diff --git a/test/SourceKit/Indexing/Inputs/implicit-vis/b.index.response b/test/SourceKit/Indexing/Inputs/implicit-vis/b.index.response
index 00b7732..bfee33d 100644
--- a/test/SourceKit/Indexing/Inputs/implicit-vis/b.index.response
+++ b/test/SourceKit/Indexing/Inputs/implicit-vis/b.index.response
@@ -20,20 +20,20 @@
{
key.kind: source.lang.swift.decl.var.instance,
key.name: "a",
- key.usr: "s:12implicit_vis1BC1aAA1ACv",
+ key.usr: "s:12implicit_vis1BC1aAA1ACvp",
key.line: 2,
key.column: 6,
key.entities: [
{
key.kind: source.lang.swift.decl.function.accessor.getter,
- key.usr: "s:12implicit_vis1BC1aAA1ACfg",
+ key.usr: "s:12implicit_vis1BC1aAA1ACvg",
key.line: 2,
key.column: 6,
key.is_dynamic: 1
},
{
key.kind: source.lang.swift.decl.function.accessor.setter,
- key.usr: "s:12implicit_vis1BC1aAA1ACfs",
+ key.usr: "s:12implicit_vis1BC1aAA1ACvs",
key.line: 2,
key.column: 6,
key.is_dynamic: 1
diff --git a/test/SourceKit/Indexing/Inputs/test_module.index.response b/test/SourceKit/Indexing/Inputs/test_module.index.response
index 2831a5a..b48864b 100644
--- a/test/SourceKit/Indexing/Inputs/test_module.index.response
+++ b/test/SourceKit/Indexing/Inputs/test_module.index.response
@@ -44,18 +44,18 @@
{
key.kind: source.lang.swift.decl.var.instance,
key.name: "value",
- key.usr: "s:11test_module16ComputedPropertyC5valueSiv",
+ key.usr: "s:11test_module16ComputedPropertyC5valueSivp",
key.entities: [
{
key.kind: source.lang.swift.decl.function.accessor.getter,
key.name: "getter:value",
- key.usr: "s:11test_module16ComputedPropertyC5valueSifg",
+ key.usr: "s:11test_module16ComputedPropertyC5valueSivg",
key.is_dynamic: 1
},
{
key.kind: source.lang.swift.decl.function.accessor.setter,
key.name: "setter:value",
- key.usr: "s:11test_module16ComputedPropertyC5valueSifs",
+ key.usr: "s:11test_module16ComputedPropertyC5valueSivs",
key.is_dynamic: 1
}
]
@@ -91,16 +91,16 @@
{
key.kind: source.lang.swift.decl.var.instance,
key.name: "x",
- key.usr: "s:11test_module7TwoIntsC1xSiv",
+ key.usr: "s:11test_module7TwoIntsC1xSivp",
key.entities: [
{
key.kind: source.lang.swift.decl.function.accessor.getter,
- key.usr: "s:11test_module7TwoIntsC1xSifg",
+ key.usr: "s:11test_module7TwoIntsC1xSivg",
key.is_dynamic: 1
},
{
key.kind: source.lang.swift.decl.function.accessor.setter,
- key.usr: "s:11test_module7TwoIntsC1xSifs",
+ key.usr: "s:11test_module7TwoIntsC1xSivs",
key.is_dynamic: 1
}
]
@@ -108,16 +108,16 @@
{
key.kind: source.lang.swift.decl.var.instance,
key.name: "y",
- key.usr: "s:11test_module7TwoIntsC1ySiv",
+ key.usr: "s:11test_module7TwoIntsC1ySivp",
key.entities: [
{
key.kind: source.lang.swift.decl.function.accessor.getter,
- key.usr: "s:11test_module7TwoIntsC1ySifg",
+ key.usr: "s:11test_module7TwoIntsC1ySivg",
key.is_dynamic: 1
},
{
key.kind: source.lang.swift.decl.function.accessor.setter,
- key.usr: "s:11test_module7TwoIntsC1ySifs",
+ key.usr: "s:11test_module7TwoIntsC1ySivs",
key.is_dynamic: 1
}
]
diff --git a/test/SourceKit/Indexing/index_bad_modulename.swift.response b/test/SourceKit/Indexing/index_bad_modulename.swift.response
index 72fb193..c014940 100644
--- a/test/SourceKit/Indexing/index_bad_modulename.swift.response
+++ b/test/SourceKit/Indexing/index_bad_modulename.swift.response
@@ -13,19 +13,19 @@
{
key.kind: source.lang.swift.decl.var.global,
key.name: "v",
- key.usr: "s:4main1vSo8NSObjectCSgv",
+ key.usr: "s:4main1vSo8NSObjectCSgvp",
key.line: 7,
key.column: 5,
key.entities: [
{
key.kind: source.lang.swift.decl.function.accessor.getter,
- key.usr: "s:4main1vSo8NSObjectCSgfg",
+ key.usr: "s:4main1vSo8NSObjectCSgvg",
key.line: 7,
key.column: 5
},
{
key.kind: source.lang.swift.decl.function.accessor.setter,
- key.usr: "s:4main1vSo8NSObjectCSgfs",
+ key.usr: "s:4main1vSo8NSObjectCSgvs",
key.line: 7,
key.column: 5
}
diff --git a/test/SourceKit/Indexing/index_big_array.swift.response b/test/SourceKit/Indexing/index_big_array.swift.response
index dfee985..bfb6141 100644
--- a/test/SourceKit/Indexing/index_big_array.swift.response
+++ b/test/SourceKit/Indexing/index_big_array.swift.response
@@ -13,19 +13,19 @@
{
key.kind: source.lang.swift.decl.var.global,
key.name: "gCubeVertexData",
- key.usr: "s:9big_array15gCubeVertexDataSaySfGv",
+ key.usr: "s:9big_array15gCubeVertexDataSaySfGvp",
key.line: 1,
key.column: 5,
key.entities: [
{
key.kind: source.lang.swift.decl.function.accessor.getter,
- key.usr: "s:9big_array15gCubeVertexDataSaySfGfg",
+ key.usr: "s:9big_array15gCubeVertexDataSaySfGvg",
key.line: 1,
key.column: 5
},
{
key.kind: source.lang.swift.decl.function.accessor.setter,
- key.usr: "s:9big_array15gCubeVertexDataSaySfGfs",
+ key.usr: "s:9big_array15gCubeVertexDataSaySfGvs",
key.line: 1,
key.column: 5
}
diff --git a/test/SourceKit/Indexing/index_constructors.swift.response b/test/SourceKit/Indexing/index_constructors.swift.response
index d6357ff..9565048 100644
--- a/test/SourceKit/Indexing/index_constructors.swift.response
+++ b/test/SourceKit/Indexing/index_constructors.swift.response
@@ -36,20 +36,20 @@
{
key.kind: source.lang.swift.decl.var.instance,
key.name: "name",
- key.usr: "s:18index_constructors11HorseObjectC4nameXev",
+ key.usr: "s:18index_constructors11HorseObjectC4nameXevp",
key.line: 7,
key.column: 7,
key.entities: [
{
key.kind: source.lang.swift.decl.function.accessor.getter,
- key.usr: "s:18index_constructors11HorseObjectC4nameXefg",
+ key.usr: "s:18index_constructors11HorseObjectC4nameXevg",
key.line: 7,
key.column: 7,
key.is_dynamic: 1
},
{
key.kind: source.lang.swift.decl.function.accessor.setter,
- key.usr: "s:18index_constructors11HorseObjectC4nameXefs",
+ key.usr: "s:18index_constructors11HorseObjectC4nameXevs",
key.line: 7,
key.column: 7,
key.is_dynamic: 1
diff --git a/test/SourceKit/Indexing/index_enum_case.swift.response b/test/SourceKit/Indexing/index_enum_case.swift.response
index a775b9d..c40c431 100644
--- a/test/SourceKit/Indexing/index_enum_case.swift.response
+++ b/test/SourceKit/Indexing/index_enum_case.swift.response
@@ -50,14 +50,14 @@
{
key.kind: source.lang.swift.decl.var.instance,
key.name: "text",
- key.usr: "s:15index_enum_case1EO4textSSv",
+ key.usr: "s:15index_enum_case1EO4textSSvp",
key.line: 8,
key.column: 9,
key.entities: [
{
key.kind: source.lang.swift.decl.function.accessor.getter,
key.name: "getter:text",
- key.usr: "s:15index_enum_case1EO4textSSfg",
+ key.usr: "s:15index_enum_case1EO4textSSvg",
key.line: 8,
key.column: 22,
key.entities: [
@@ -98,19 +98,19 @@
{
key.kind: source.lang.swift.decl.var.global,
key.name: "e",
- key.usr: "s:15index_enum_case1eAA1EOv",
+ key.usr: "s:15index_enum_case1eAA1EOvp",
key.line: 21,
key.column: 5,
key.entities: [
{
key.kind: source.lang.swift.decl.function.accessor.getter,
- key.usr: "s:15index_enum_case1eAA1EOfg",
+ key.usr: "s:15index_enum_case1eAA1EOvg",
key.line: 21,
key.column: 5
},
{
key.kind: source.lang.swift.decl.function.accessor.setter,
- key.usr: "s:15index_enum_case1eAA1EOfs",
+ key.usr: "s:15index_enum_case1eAA1EOvs",
key.line: 21,
key.column: 5
}
diff --git a/test/SourceKit/Indexing/index_forbid_typecheck.swift.response b/test/SourceKit/Indexing/index_forbid_typecheck.swift.response
index de1e272..5f2a565 100644
--- a/test/SourceKit/Indexing/index_forbid_typecheck.swift.response
+++ b/test/SourceKit/Indexing/index_forbid_typecheck.swift.response
@@ -13,19 +13,19 @@
{
key.kind: source.lang.swift.decl.var.global,
key.name: "globalPrim",
- key.usr: "s:18forbid_typecheck_210globalPrimSiv",
+ key.usr: "s:18forbid_typecheck_210globalPrimSivp",
key.line: 1,
key.column: 5,
key.entities: [
{
key.kind: source.lang.swift.decl.function.accessor.getter,
- key.usr: "s:18forbid_typecheck_210globalPrimSifg",
+ key.usr: "s:18forbid_typecheck_210globalPrimSivg",
key.line: 1,
key.column: 5
},
{
key.kind: source.lang.swift.decl.function.accessor.setter,
- key.usr: "s:18forbid_typecheck_210globalPrimSifs",
+ key.usr: "s:18forbid_typecheck_210globalPrimSivs",
key.line: 1,
key.column: 5
}
@@ -34,13 +34,13 @@
{
key.kind: source.lang.swift.ref.var.global,
key.name: "globalSec",
- key.usr: "s:18forbid_typecheck_29globalSecSiv",
+ key.usr: "s:18forbid_typecheck_29globalSecSivp",
key.line: 1,
key.column: 18,
key.entities: [
{
key.kind: source.lang.swift.ref.function.accessor.getter,
- key.usr: "s:18forbid_typecheck_29globalSecSifg",
+ key.usr: "s:18forbid_typecheck_29globalSecSivg",
key.line: 1,
key.column: 18
}
@@ -77,13 +77,13 @@
{
key.kind: source.lang.swift.ref.var.instance,
key.name: "member",
- key.usr: "s:18forbid_typecheck_26ClsSecC6memberSiv",
+ key.usr: "s:18forbid_typecheck_26ClsSecC6memberSivp",
key.line: 5,
key.column: 20,
key.entities: [
{
key.kind: source.lang.swift.ref.function.accessor.getter,
- key.usr: "s:18forbid_typecheck_26ClsSecC6memberSifg",
+ key.usr: "s:18forbid_typecheck_26ClsSecC6memberSivg",
key.line: 5,
key.column: 20,
key.receiver_usr: "s:18forbid_typecheck_26ClsSecC",
diff --git a/test/api-digester/Outputs/cake.json b/test/api-digester/Outputs/cake.json
index 07e05ee..efd732f 100644
--- a/test/api-digester/Outputs/cake.json
+++ b/test/api-digester/Outputs/cake.json
@@ -146,7 +146,7 @@
"name": "Ins",
"printedName": "Ins",
"declKind": "Var",
- "usr": "s:4cake2C1C3InsACSgXwv",
+ "usr": "s:4cake2C1C3InsACSgXwvp",
"location": "",
"moduleName": "cake",
"ownership": 1,
@@ -161,7 +161,7 @@
"name": "_",
"printedName": "_()",
"declKind": "Func",
- "usr": "s:4cake2C1C3InsACSgXwfg",
+ "usr": "s:4cake2C1C3InsACSgXwvg",
"location": "",
"moduleName": "cake",
"children": [
@@ -184,7 +184,7 @@
"name": "_",
"printedName": "_()",
"declKind": "Func",
- "usr": "s:4cake2C1C3InsACSgXwfs",
+ "usr": "s:4cake2C1C3InsACSgXwvs",
"location": "",
"moduleName": "cake",
"children": [
@@ -214,7 +214,7 @@
"name": "Ins2",
"printedName": "Ins2",
"declKind": "Var",
- "usr": "s:4cake2C1C4Ins2ACXov",
+ "usr": "s:4cake2C1C4Ins2ACXovp",
"location": "",
"moduleName": "cake",
"ownership": 2,
@@ -229,7 +229,7 @@
"name": "_",
"printedName": "_()",
"declKind": "Func",
- "usr": "s:4cake2C1C4Ins2ACXofg",
+ "usr": "s:4cake2C1C4Ins2ACXovg",
"location": "",
"moduleName": "cake",
"children": [
@@ -245,7 +245,7 @@
"name": "_",
"printedName": "_()",
"declKind": "Func",
- "usr": "s:4cake2C1C4Ins2ACXofs",
+ "usr": "s:4cake2C1C4Ins2ACXovs",
"location": "",
"moduleName": "cake",
"children": [
diff --git a/test/decl/protocol/req/associated_type_inference.swift b/test/decl/protocol/req/associated_type_inference.swift
index dc50669..6b2d656 100644
--- a/test/decl/protocol/req/associated_type_inference.swift
+++ b/test/decl/protocol/req/associated_type_inference.swift
@@ -184,7 +184,8 @@
struct XCollectionLikeP0b : CollectionLikeP0 {
// expected-error@-1 {{type 'XCollectionLikeP0b' does not conform to protocol 'CollectionLikeP0'}}
var startIndex: XCollectionLikeP0b.Index
- // expected-error@-1 {{'startIndex' used within its own type}}
+ // There was an error @-1 ("'startIndex' used within its own type"),
+ // but it disappeared and doesn't seem like much of a loss.
var startElement: XCollectionLikeP0b.Element
}
diff --git a/test/decl/protocol/special/coding/class_codable_excluded_optional_properties.swift b/test/decl/protocol/special/coding/class_codable_excluded_optional_properties.swift
new file mode 100644
index 0000000..1b2d1cc
--- /dev/null
+++ b/test/decl/protocol/special/coding/class_codable_excluded_optional_properties.swift
@@ -0,0 +1,64 @@
+// RUN: %target-typecheck-verify-swift
+
+class ClassWithNonExcludedLetMembers : Codable { // expected-error {{class 'ClassWithNonExcludedLetMembers' has no initializers}}
+ // expected-error@-1 {{type 'ClassWithNonExcludedLetMembers' does not conform to protocol 'Decodable'}}
+ // expected-error@-2 {{type 'ClassWithNonExcludedLetMembers' does not conform to protocol 'Encodable'}}
+
+ // Optional `let`s do not get an implicit nil assignment.
+ let p1: String? // expected-note {{stored property 'p1' without initial value prevents synthesized initializers}}
+ let p2: String! // expected-note {{stored property 'p2' without initial value prevents synthesized initializers}}
+
+ // AnyHashable does not conform to Codable.
+ let p3: AnyHashable? // expected-note {{stored property 'p3' without initial value prevents synthesized initializers}}
+ // expected-note@-1 {{cannot automatically synthesize 'Decodable' because 'AnyHashable?' does not conform to 'Decodable'}}
+ // expected-note@-2 {{cannot automatically synthesize 'Encodable' because 'AnyHashable?' does not conform to 'Encodable'}}
+ let p4: AnyHashable? // expected-note {{stored property 'p4' without initial value prevents synthesized initializers}}
+ // expected-note@-1 {{cannot automatically synthesize 'Decodable' because 'AnyHashable?' does not conform to 'Decodable'}}
+ // expected-note@-2 {{cannot automatically synthesize 'Encodable' because 'AnyHashable?' does not conform to 'Encodable'}}
+}
+
+class ClassWithExcludedLetMembers : Codable { // expected-error {{class 'ClassWithExcludedLetMembers' has no initializers}}
+ // expected-error@-1 {{type 'ClassWithExcludedLetMembers' does not conform to protocol 'Decodable'}}
+
+ // Optional `let`s do not get an implicit nil assignment.
+ let p1: String? // expected-note {{stored property 'p1' without initial value prevents synthesized initializers}}
+ let p2: String! // expected-note {{stored property 'p2' without initial value prevents synthesized initializers}}
+
+ // AnyHashable does not conform to Codable.
+ let p3: AnyHashable? // expected-note {{stored property 'p3' without initial value prevents synthesized initializers}}
+ // expected-note@-1 {{cannot automatically synthesize 'Decodable' because 'p3' does not have a matching CodingKey and does not have a default value}}
+ let p4: AnyHashable? // expected-note {{stored property 'p4' without initial value prevents synthesized initializers}}
+ // expected-note@-1 {{cannot automatically synthesize 'Decodable' because 'p4' does not have a matching CodingKey and does not have a default value}}
+
+ // Explicitly exclude non-Codable properties.
+ enum CodingKeys : String, CodingKey {
+ case p1, p2
+ }
+}
+
+class ClassWithNonExcludedVarMembers : Codable { // expected-error {{type 'ClassWithNonExcludedVarMembers' does not conform to protocol 'Decodable'}}
+ // expected-error@-1 {{type 'ClassWithNonExcludedVarMembers' does not conform to protocol 'Encodable'}}
+
+ var p1: String?
+ var p2: String!
+
+ // AnyHashable does not conform to Codable.
+ var p3: AnyHashable? // expected-note {{cannot automatically synthesize 'Decodable' because 'AnyHashable?' does not conform to 'Decodable'}}
+ // expected-note@-1 {{cannot automatically synthesize 'Encodable' because 'AnyHashable?' does not conform to 'Encodable'}}
+ var p4: AnyHashable! // expected-note {{cannot automatically synthesize 'Decodable' because 'AnyHashable!' does not conform to 'Decodable'}}
+ // expected-note@-1 {{cannot automatically synthesize 'Encodable' because 'AnyHashable!' does not conform to 'Encodable'}}
+}
+
+class ClassWithExcludedVarMembers : Codable {
+ var p1: String?
+ var p2: String!
+
+ // AnyHashable does not conform to Codable.
+ var p3: AnyHashable?
+ var p4: AnyHashable!
+
+ // Explicitly exclude non-Codable properties.
+ enum CodingKeys : String, CodingKey {
+ case p1, p2
+ }
+}
diff --git a/test/decl/protocol/special/coding/struct_codable_excluded_optional_properties.swift b/test/decl/protocol/special/coding/struct_codable_excluded_optional_properties.swift
new file mode 100644
index 0000000..84e9b9c
--- /dev/null
+++ b/test/decl/protocol/special/coding/struct_codable_excluded_optional_properties.swift
@@ -0,0 +1,69 @@
+// RUN: %target-typecheck-verify-swift
+
+struct StructWithNonExcludedLetMembers : Codable { // expected-error {{type 'StructWithNonExcludedLetMembers' does not conform to protocol 'Decodable'}}
+ // expected-error@-1 {{type 'StructWithNonExcludedLetMembers' does not conform to protocol 'Encodable'}}
+
+ // Suppress the memberwise initializer. Optional `let`s do not get an implicit nil assignment.
+ init() {}
+
+ let p1: String?
+ let p2: String!
+
+ // AnyHashable does not conform to Codable.
+ let p3: AnyHashable? // expected-note {{cannot automatically synthesize 'Decodable' because 'AnyHashable?' does not conform to 'Decodable'}}
+ // expected-note@-1 {{cannot automatically synthesize 'Encodable' because 'AnyHashable?' does not conform to 'Encodable'}}
+ let p4: AnyHashable! // expected-note {{cannot automatically synthesize 'Decodable' because 'AnyHashable!' does not conform to 'Decodable'}}
+ // expected-note@-1 {{cannot automatically synthesize 'Encodable' because 'AnyHashable!' does not conform to 'Encodable'}}
+}
+
+struct StructWithExcludedLetMembers : Codable { // expected-error {{type 'StructWithExcludedLetMembers' does not conform to protocol 'Decodable'}}
+
+ // Suppress the memberwise initializer. Optional `let`s do not get an implicit nil assignment.
+ init() {}
+
+ let p1: String?
+ let p2: String!
+
+ // AnyHashable does not conform to Codable.
+ let p3: AnyHashable? // expected-note {{cannot automatically synthesize 'Decodable' because 'p3' does not have a matching CodingKey and does not have a default value}}
+ let p4: AnyHashable! // expected-note {{cannot automatically synthesize 'Decodable' because 'p4' does not have a matching CodingKey and does not have a default value}}
+
+ // Explicitly exclude non-Codable properties.
+ enum CodingKeys : String, CodingKey {
+ case p1, p2
+ }
+}
+
+struct StructWithNonExcludedVarMembers : Codable { // expected-error {{type 'StructWithNonExcludedVarMembers' does not conform to protocol 'Decodable'}}
+ // expected-error@-1 {{type 'StructWithNonExcludedVarMembers' does not conform to protocol 'Encodable'}}
+
+ // Suppress the memberwise initializer.
+ init() {}
+
+ var p1: String?
+ var p2: String!
+
+ // AnyHashable does not conform to Codable.
+ var p3: AnyHashable? // expected-note {{cannot automatically synthesize 'Decodable' because 'AnyHashable?' does not conform to 'Decodable'}}
+ // expected-note@-1 {{cannot automatically synthesize 'Encodable' because 'AnyHashable?' does not conform to 'Encodable'}}
+ var p4: AnyHashable! // expected-note {{cannot automatically synthesize 'Decodable' because 'AnyHashable!' does not conform to 'Decodable'}}
+ // expected-note@-1 {{cannot automatically synthesize 'Encodable' because 'AnyHashable!' does not conform to 'Encodable'}}
+}
+
+struct StructWithExcludedVarMembers : Codable {
+
+ // Suppress the memberwise initializer.
+ init() {}
+
+ var p1: String?
+ var p2: String!
+
+ // AnyHashable does not conform to Codable.
+ var p3: AnyHashable?
+ var p4: AnyHashable!
+
+ // Explicitly exclude non-Codable properties.
+ enum CodingKeys : String, CodingKey {
+ case p1, p2
+ }
+}
diff --git a/test/decl/subscript/subscripting.swift b/test/decl/subscript/subscripting.swift
index 32058f5..294f2a4 100644
--- a/test/decl/subscript/subscripting.swift
+++ b/test/decl/subscript/subscripting.swift
@@ -71,14 +71,14 @@
}
struct Y2 {
- subscript(idx: Int) -> TypoType { // expected-error 3{{use of undeclared type 'TypoType'}}
+ subscript(idx: Int) -> TypoType { // expected-error {{use of undeclared type 'TypoType'}}
get { repeat {} while true }
set {}
}
}
class Y3 {
- subscript(idx: Int) -> TypoType { // expected-error 3{{use of undeclared type 'TypoType'}}
+ subscript(idx: Int) -> TypoType { // expected-error {{use of undeclared type 'TypoType'}}
get { repeat {} while true }
set {}
}
diff --git a/test/decl/var/properties.swift b/test/decl/var/properties.swift
index 2ddac05..a0b1f07 100644
--- a/test/decl/var/properties.swift
+++ b/test/decl/var/properties.swift
@@ -264,10 +264,9 @@
get {}
} = X() // expected-error {{expected expression}} expected-error {{consecutive statements on a line must be separated by ';'}} {{2-2=;}}
-// FIXME: Redundant error below
var x2 { // expected-error{{computed property must have an explicit type}} {{7-7=: <# Type #>}} expected-error{{type annotation missing in pattern}}
get {
- return _x // expected-error{{unexpected non-void return value in void function}}
+ return _x
}
}
diff --git a/test/lit.cfg b/test/lit.cfg
index c913fa1..7168a0c 100644
--- a/test/lit.cfg
+++ b/test/lit.cfg
@@ -83,10 +83,14 @@
commandPrefix + ['/usr/bin/sw_vers', '-buildVersion'])[0].rstrip()
return (name, vers, build)
+def darwin_get_ios_sim_vers():
+ sim_output = subprocess.check_output(['xcrun', 'simctl', 'list', 'runtimes'])
+ ios_version_str = re.findall(r'iOS \d+\.*\d*',sim_output)
+ return [float(v.strip('iOS')) for v in ios_version_str]
# Returns the "prefix" command that should be prepended to the command line to
# run an executable compiled for iOS or AppleTV simulator.
-def get_simulator_command(run_os, sdk_path):
+def get_simulator_command(run_os, run_cpu, sdk_path):
(name, vers, build) = darwin_get_sdk_version(sdk_path)
if run_os == 'ios':
# There are two binaries for the iOS simulator: 'sim' and 'simctl'.
@@ -101,6 +105,13 @@
(darwin_sdk_build_version_cmp("12H1", build) <= 0 and
darwin_sdk_build_version_cmp(build, "12H11") <= 0)):
return "sim"
+ elif run_cpu == "i386":
+ if min(darwin_get_ios_sim_vers()) > 10.3:
+ print("ERROR: Install iOS 10.3 or older simulator for 32bit testing")
+ print("INFO: Xcode -> Preferences -> Components -> Simulators")
+ sys.exit(1)
+ else:
+ return "simctl spawn 'iPhone 5'"
else:
return "simctl spawn 'iPhone 6'"
elif run_os == 'tvos':
@@ -631,7 +642,7 @@
# segmentation faults)
config.target_run = (
"%s %s " %
- (xcrun_prefix, get_simulator_command(run_os, config.variant_sdk)))
+ (xcrun_prefix, get_simulator_command(run_os, run_cpu, config.variant_sdk)))
(sw_vers_name, sw_vers_vers, sw_vers_build) = \
darwin_get_sdk_version(config.variant_sdk)
diff --git a/test/multifile/protocol-conformance-member.swift b/test/multifile/protocol-conformance-member.swift
index 0844396..c7cad0d 100644
--- a/test/multifile/protocol-conformance-member.swift
+++ b/test/multifile/protocol-conformance-member.swift
@@ -2,7 +2,7 @@
// RUN: %target-build-swift -emit-library %s %S/Inputs/protocol-conformance-member-helper.swift -o %t/libTest.dylib -module-name Test
// RUN: llvm-nm %t/libTest.dylib | %FileCheck %s
-// CHECK: _T04Test10CoolStructV10coolFactorSdfg
+// CHECK: _T04Test10CoolStructV10coolFactorSdvg
// SR-156: Make sure we synthesize getters for members used as protocol
// witnesses. Check that we link correctly; we don't care which file
diff --git a/test/stdlib/Runtime.swift.gyb b/test/stdlib/Runtime.swift.gyb
index 0e28256..667c4de 100644
--- a/test/stdlib/Runtime.swift.gyb
+++ b/test/stdlib/Runtime.swift.gyb
@@ -365,7 +365,7 @@
expectEqual("\0", _stdlib_demangleName("\0"))
expectEqual("Swift.Double", _stdlib_demangleName("_T0SdD"))
expectEqual("x.a : x.Foo<x.Foo<x.Foo<Swift.Int, Swift.Int>, x.Foo<Swift.Int, Swift.Int>>, x.Foo<x.Foo<Swift.Int, Swift.Int>, x.Foo<Swift.Int, Swift.Int>>>",
- _stdlib_demangleName("_T01x1aAA3FooCyADyADySiSiGADySiSiGGADyADySiSiGADySiSiGGGv"))
+ _stdlib_demangleName("_T01x1aAA3FooCyADyADySiSiGADySiSiGGADyADySiSiGADySiSiGGGvp"))
expectEqual("Foobar", _stdlib_demangleName("_T013__lldb_expr_46FoobarCD"))
}
diff --git a/tools/SourceKit/lib/SwiftLang/SwiftSourceDocInfo.cpp b/tools/SourceKit/lib/SwiftLang/SwiftSourceDocInfo.cpp
index 0c2a21a..7993900 100644
--- a/tools/SourceKit/lib/SwiftLang/SwiftSourceDocInfo.cpp
+++ b/tools/SourceKit/lib/SwiftLang/SwiftSourceDocInfo.cpp
@@ -1657,7 +1657,7 @@
SwiftArgs, OpArgs);
}
- IFaceGenRef->accessASTAsync([this, IFaceGenRef, Offset, Input, Receiver] {
+ IFaceGenRef->accessASTAsync([IFaceGenRef, Offset, Input, Receiver] {
SwiftInterfaceGenContext::ResolvedEntity Entity;
Entity = IFaceGenRef->resolveEntityForOffset(Offset);
if (Entity.isResolved()) {
diff --git a/tools/swift-ide-test/swift-ide-test.cpp b/tools/swift-ide-test/swift-ide-test.cpp
index 9e24914..e6f4d81 100644
--- a/tools/swift-ide-test/swift-ide-test.cpp
+++ b/tools/swift-ide-test/swift-ide-test.cpp
@@ -2669,6 +2669,7 @@
CompilerInvocation Invocation(InitInvok);
Invocation.addInputFilename(SourceFileName);
Invocation.getLangOptions().DisableAvailabilityChecking = false;
+ Invocation.getLangOptions().KeepTokensInSourceFile = true;
CompilerInstance CI;
diff --git a/tools/swift-refactor/swift-refactor.cpp b/tools/swift-refactor/swift-refactor.cpp
index 50dfb0d..78e550c 100644
--- a/tools/swift-refactor/swift-refactor.cpp
+++ b/tools/swift-refactor/swift-refactor.cpp
@@ -219,6 +219,7 @@
reinterpret_cast<void *>(&anchorForGetMainExecutable)));
Invocation.addInputFilename(options::SourceFilename);
Invocation.getLangOptions().AttachCommentsToDecls = true;
+ Invocation.getLangOptions().KeepTokensInSourceFile = true;
for (auto FileName : options::InputFilenames)
Invocation.addInputFilename(FileName);
diff --git a/unittests/AST/SourceLocTests.cpp b/unittests/AST/SourceLocTests.cpp
index 1ce40ec..908ddfe 100644
--- a/unittests/AST/SourceLocTests.cpp
+++ b/unittests/AST/SourceLocTests.cpp
@@ -23,7 +23,8 @@
void PrintTo(SourceLoc loc, std::ostream *os) {
*os << loc.getOpaquePointerValue();
if (loc.isValid())
- *os << " '" << *(char *)loc.getOpaquePointerValue() << "'";
+ *os << " '" << *static_cast<const char *>(loc.getOpaquePointerValue())
+ << "'";
}
void PrintTo(SourceRange range, std::ostream *os) {
diff --git a/unittests/runtime/Array.cpp b/unittests/runtime/Array.cpp
new file mode 100644
index 0000000..dbb8280
--- /dev/null
+++ b/unittests/runtime/Array.cpp
@@ -0,0 +1,318 @@
+//===------ Array.cpp - Array runtime function tests ----------------------===//
+//
+// This source file is part of the Swift.org open source project
+//
+// Copyright (c) 2014 - 2017 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/Runtime/Metadata.h"
+#include "swift/Runtime/HeapObject.h"
+#include "swift/Runtime/Concurrent.h"
+#include "swift/Runtime/HeapObject.h"
+#include "swift/Runtime/Metadata.h"
+#include "gtest/gtest.h"
+
+using namespace swift;
+
+namespace swift {
+ void installCommonValueWitnesses(ValueWitnessTable *vwtable);
+} // namespace swift
+
+
+static void initialize_pod_witness_table_size_uint32_t_stride_uint64_t(
+ ValueWitnessTable &testTable) {
+ testTable.size = sizeof(uint32_t);
+ testTable.flags = ValueWitnessFlags()
+ .withAlignment(alignof(ValueBuffer))
+ .withPOD(true)
+ .withBitwiseTakable(true)
+ .withInlineStorage(true);
+ testTable.stride = sizeof(uint64_t);
+ installCommonValueWitnesses(&testTable);
+}
+
+extern "C" void swift_arrayInitWithCopy(OpaqueValue *dest,
+ OpaqueValue *src, size_t count,
+ const Metadata *self);
+
+#define COPY_POD_TEST(kind) \
+ ValueWitnessTable pod_witnesses; \
+ initialize_pod_witness_table_size_uint32_t_stride_uint64_t(pod_witnesses); \
+ uint64_t srcArray[3] = {0, 1, 2}; \
+ uint64_t destArray[3] = {0x5A5A5A5AU, 0x5A5A5A5AU, 0x5A5A5A5AU}; \
+ FullOpaqueMetadata testMetadata = {{&pod_witnesses}, \
+ {{MetadataKind::Opaque}}}; \
+ Metadata *metadata = &testMetadata.base; \
+ swift_array##kind((OpaqueValue *)destArray, (OpaqueValue *)srcArray, 3, \
+ metadata); \
+ EXPECT_EQ(destArray[0], 0u); \
+ EXPECT_EQ(destArray[1], 1u); \
+ EXPECT_EQ(destArray[2], 2u); \
+ \
+ EXPECT_EQ(srcArray[0], 0u); \
+ EXPECT_EQ(srcArray[1], 1u); \
+ EXPECT_EQ(srcArray[2], 2u);
+
+TEST(TestArrayCopy, test_swift_arrayInitWithCopy) {
+ COPY_POD_TEST(InitWithCopy);
+}
+
+
+namespace {
+struct TestObject : HeapObject {
+ size_t *Addr;
+ size_t Value;
+};
+}
+
+static SWIFT_CC(swift) void destroyTestObject(SWIFT_CONTEXT HeapObject *_object) {
+ auto object = static_cast<TestObject*>(_object);
+ assert(object->Addr && "object already deallocated");
+ *object->Addr = object->Value;
+ object->Addr = nullptr;
+ swift_deallocObject(object, sizeof(TestObject), alignof(TestObject) - 1);
+}
+
+static const FullMetadata<ClassMetadata> TestClassObjectMetadata = {
+ { { &destroyTestObject }, { &VALUE_WITNESS_SYM(Bo) } },
+ { { { MetadataKind::Class } }, 0, /*rodata*/ 1,
+ ClassFlags::UsesSwift1Refcounting, nullptr, 0, 0, 0, 0, 0 }
+};
+
+/// Create an object that, when deallocated, stores the given value to
+/// the given pointer.
+static TestObject *allocTestObject(size_t *addr, size_t value) {
+ auto result =
+ static_cast<TestObject *>(swift_allocObject(&TestClassObjectMetadata,
+ sizeof(TestObject),
+ alignof(TestObject) - 1));
+ result->Addr = addr;
+ result->Value = value;
+ return result;
+}
+
+TEST(TestArrayCopy, test_swift_arrayInitWithCopyNoAliasNonPOD) {
+ size_t object0Val = 0;
+ size_t object1Val = 1;
+ HeapObject *object0 = allocTestObject(&object0Val, 2);
+ HeapObject *object1 = allocTestObject(&object1Val, 3);
+
+ HeapObject *srcArray[2] = {object0, object1};
+ HeapObject *destArray[2] = {(HeapObject *)0x5A5A5A5AU,
+ (HeapObject *)0x5A5A5A5AU};
+ const Metadata *metadata = &TestClassObjectMetadata;
+ swift_arrayInitWithCopy((OpaqueValue *)destArray, (OpaqueValue *)srcArray, 2,
+ metadata);
+ EXPECT_EQ(destArray[0], object0);
+ EXPECT_EQ(destArray[1], object1);
+
+ EXPECT_EQ(srcArray[0], object0);
+ EXPECT_EQ(srcArray[1], object1);
+
+ EXPECT_EQ(swift_retainCount(object0), 2u);
+ EXPECT_EQ(swift_retainCount(object1), 2u);
+
+ swift_release(object0);
+ swift_release(object0);
+ swift_release(object1);
+ swift_release(object1);
+ EXPECT_EQ(object0Val, 2u);
+ EXPECT_EQ(object1Val, 3u);
+}
+
+extern "C" void swift_arrayInitWithTakeNoAlias(OpaqueValue *dest,
+ OpaqueValue *src, size_t count,
+ const Metadata *self);
+extern "C" void swift_arrayInitWithTakeFrontToBack(OpaqueValue *dest,
+ OpaqueValue *src,
+ size_t count,
+ const Metadata *self);
+extern "C" void swift_arrayInitWithTakeBackToFront(OpaqueValue *dest,
+ OpaqueValue *src,
+ size_t count,
+ const Metadata *self);
+TEST(TestArrayCopy, test_swift_arrayInitWithTakeNoAliasPOD) {
+ COPY_POD_TEST(InitWithTakeNoAlias);
+}
+
+TEST(TestArrayCopy, test_swift_arrayInitWithTakeFrontToBackPOD) {
+ COPY_POD_TEST(InitWithTakeFrontToBack);
+}
+
+TEST(TestArrayCopy, test_swift_arrayInitWithTakeBackToFrontPOD) {
+ COPY_POD_TEST(InitWithTakeBackToFront);
+}
+
+#define INITWITHTAKE_NONPOD_TEST(copy) \
+ size_t object0Val = 0; \
+ size_t object1Val = 1; \
+ HeapObject *object0 = allocTestObject(&object0Val, 2); \
+ HeapObject *object1 = allocTestObject(&object1Val, 3); \
+ \
+ HeapObject *srcArray[2] = {object0, object1}; \
+ HeapObject *destArray[2] = {(HeapObject *)0x5A5A5A5AU, \
+ (HeapObject *)0x5A5A5A5AU}; \
+ const Metadata *metadata = &TestClassObjectMetadata; \
+ swift_arrayInitWithTake##copy((OpaqueValue *)destArray, \
+ (OpaqueValue *)srcArray, 2, metadata); \
+ EXPECT_EQ(destArray[0], object0); \
+ EXPECT_EQ(destArray[1], object1); \
+ \
+ EXPECT_EQ(srcArray[0], object0); \
+ EXPECT_EQ(srcArray[1], object1); \
+ \
+ EXPECT_EQ(swift_retainCount(object0), 1u); \
+ EXPECT_EQ(swift_retainCount(object1), 1u); \
+ \
+ swift_release(object0); \
+ swift_release(object1); \
+ EXPECT_EQ(object0Val, 2u); \
+ EXPECT_EQ(object1Val, 3u);
+
+TEST(TestArrayCopy, test_swift_arrayInitWithTakeNoAliasNonPOD) {
+ INITWITHTAKE_NONPOD_TEST(NoAlias);
+}
+
+TEST(TestArrayCopy, test_swift_arrayInitWithTakeFrontToBackNonPOD) {
+ INITWITHTAKE_NONPOD_TEST(FrontToBack);
+}
+
+TEST(TestArrayCopy, test_swift_arrayInitWithTakeBackToFrontNonPOD) {
+ INITWITHTAKE_NONPOD_TEST(BackToFront);
+}
+
+extern "C" void swift_arrayAssignWithCopyNoAlias(OpaqueValue *dest, OpaqueValue *src,
+ size_t count, const Metadata *self);
+extern "C" void swift_arrayAssignWithCopyFrontToBack(OpaqueValue *dest, OpaqueValue *src,
+ size_t count, const Metadata *self);
+extern "C" void swift_arrayAssignWithCopyBackToFront(OpaqueValue *dest, OpaqueValue *src,
+ size_t count, const Metadata *self);
+
+TEST(TestArrayCopy, test_swift_arrayAssignWithCopyNoAliasPOD) {
+ COPY_POD_TEST(AssignWithCopyNoAlias);
+}
+
+TEST(TestArrayCopy, test_swift_arrayAssignWithCopyFrontToBackPOD) {
+ COPY_POD_TEST(AssignWithCopyFrontToBack);
+}
+
+TEST(TestArrayCopy, test_swift_arrayAssignWithCopyBackToFrontPOD) {
+ COPY_POD_TEST(AssignWithCopyBackToFront);
+}
+
+#define ASSIGNWITHCOPY_NONPOD_TEST(copy) \
+ size_t object0Val = 0; \
+ size_t object1Val = 1; \
+ HeapObject *object0 = allocTestObject(&object0Val, 2); \
+ HeapObject *object1 = allocTestObject(&object1Val, 3); \
+ size_t object2Val = 4; \
+ size_t object3Val = 5; \
+ HeapObject *object2 = allocTestObject(&object2Val, 6); \
+ HeapObject *object3 = allocTestObject(&object3Val, 7); \
+ \
+ HeapObject *srcArray[2] = {object0, object1}; \
+ HeapObject *destArray[2] = {object2, object3}; \
+ const Metadata *metadata = &TestClassObjectMetadata; \
+ swift_arrayAssignWithCopy##copy((OpaqueValue *)destArray, \
+ (OpaqueValue *)srcArray, 2, metadata); \
+ EXPECT_EQ(destArray[0], object0); \
+ EXPECT_EQ(destArray[1], object1); \
+ \
+ EXPECT_EQ(srcArray[0], object0); \
+ EXPECT_EQ(srcArray[1], object1); \
+ \
+ EXPECT_EQ(swift_retainCount(object0), 2u); \
+ EXPECT_EQ(swift_retainCount(object1), 2u); \
+ \
+ EXPECT_EQ(object2Val, 6u); \
+ EXPECT_EQ(object3Val, 7u); \
+ \
+ swift_release(object0); \
+ swift_release(object0); \
+ swift_release(object1); \
+ swift_release(object1); \
+ EXPECT_EQ(object0Val, 2u); \
+ EXPECT_EQ(object1Val, 3u);
+
+TEST(TestArrayCopy, test_swift_arrayAssignWithCopyNoAliasNonPOD) {
+ ASSIGNWITHCOPY_NONPOD_TEST(NoAlias);
+}
+
+TEST(TestArrayCopy, test_swift_arrayAssignWithCopyFrontToBackNonPOD) {
+ ASSIGNWITHCOPY_NONPOD_TEST(FrontToBack);
+}
+
+TEST(TestArrayCopy, test_swift_arrayAssignWithCopyBackToFrontNonPOD) {
+ ASSIGNWITHCOPY_NONPOD_TEST(BackToFront);
+}
+
+extern "C" void swift_arrayAssignWithTake(OpaqueValue *dest, OpaqueValue *src,
+ size_t count, const Metadata *self);
+
+TEST(TestArrayCopy, test_swift_arrayAssignWithTakePOD) {
+ COPY_POD_TEST(AssignWithTake);
+}
+
+TEST(TestArrayCopy, test_swift_arrayAssignWithTakeNonPOD) {
+ size_t object0Val = 0;
+ size_t object1Val = 1;
+ HeapObject *object0 = allocTestObject(&object0Val, 2);
+ HeapObject *object1 = allocTestObject(&object1Val, 3);
+ size_t object2Val = 4;
+ size_t object3Val = 5;
+ HeapObject *object2 = allocTestObject(&object2Val, 6);
+ HeapObject *object3 = allocTestObject(&object3Val, 7);
+
+ HeapObject *srcArray[2] = {object0, object1};
+ HeapObject *destArray[2] = {object2, object3};
+ const Metadata *metadata = &TestClassObjectMetadata;
+ swift_arrayAssignWithTake((OpaqueValue *)destArray, (OpaqueValue *)srcArray,
+ 2, metadata);
+ EXPECT_EQ(destArray[0], object0);
+ EXPECT_EQ(destArray[1], object1);
+
+ EXPECT_EQ(srcArray[0], object0);
+ EXPECT_EQ(srcArray[1], object1);
+
+ EXPECT_EQ(swift_retainCount(object0), 1u);
+ EXPECT_EQ(swift_retainCount(object1), 1u);
+
+ EXPECT_EQ(object2Val, 6u);
+ EXPECT_EQ(object3Val, 7u);
+
+ swift_release(object0);
+ swift_release(object1);
+ EXPECT_EQ(object0Val, 2u);
+ EXPECT_EQ(object1Val, 3u);
+}
+
+extern "C" void swift_arrayDestroy(OpaqueValue *begin, size_t count,
+ const Metadata *self);
+
+TEST(TestArrayCopy, test_swift_arrayDestroyPOD) {
+ ValueWitnessTable pod_witnesses;
+ initialize_pod_witness_table_size_uint32_t_stride_uint64_t(pod_witnesses);
+ uint64_t array[3] = {0, 1, 2};
+ FullOpaqueMetadata testMetadata = {{&pod_witnesses},
+ {{MetadataKind::Opaque}}};
+ Metadata *metadata = &testMetadata.base;
+ // Let's make sure this does not crash.
+ swift_arrayDestroy((OpaqueValue *)array, 3, metadata);
+}
+
+TEST(TestArrayCopy, test_swift_arrayDestroyNonPOD) {
+ size_t object0Val = 0;
+ size_t object1Val = 1;
+ HeapObject *object0 = allocTestObject(&object0Val, 2);
+ HeapObject *object1 = allocTestObject(&object1Val, 3);
+ HeapObject *array[2] = {object0, object1};
+ const Metadata *metadata = &TestClassObjectMetadata;
+ swift_arrayDestroy((OpaqueValue *)array, 2, metadata);
+ EXPECT_EQ(object0Val, 2u);
+ EXPECT_EQ(object1Val, 3u);
+}
diff --git a/unittests/runtime/CMakeLists.txt b/unittests/runtime/CMakeLists.txt
index df0c1c4..9ecef9d 100644
--- a/unittests/runtime/CMakeLists.txt
+++ b/unittests/runtime/CMakeLists.txt
@@ -32,6 +32,7 @@
endif()
add_swift_unittest(SwiftRuntimeTests
+ Array.cpp
Exclusivity.cpp
Metadata.cpp
Mutex.cpp
diff --git a/utils/build-script b/utils/build-script
index c998568..d5a634a 100755
--- a/utils/build-script
+++ b/utils/build-script
@@ -40,7 +40,7 @@
SWIFT_REPO_NAME,
SWIFT_SOURCE_ROOT,
get_all_preset_names,
- get_preset_options,
+ get_preset_options,
)
from swift_build_support.swift_build_support.cmake import CMake
@@ -1827,7 +1827,7 @@
"--skip-test-ios-32bit-simulator",
help="skip testing iOS 32 bit simulator targets",
action=arguments.action.optional_bool,
- default=True)
+ default=False)
skip_test_group.add_argument(
"--skip-test-ios-host",
help="skip testing iOS device targets on the host machine (the phone "
diff --git a/utils/build-script-impl b/utils/build-script-impl
index b926bc4..d1b0d0c 100755
--- a/utils/build-script-impl
+++ b/utils/build-script-impl
@@ -377,7 +377,7 @@
# Check if the named action should be run in the given script invocation.
function should_execute_action() {
local name="$1"
-
+
if [[ "${ONLY_EXECUTE}" = "all" ]] ||
[[ "${ONLY_EXECUTE}" = "${name}" ]]; then
echo 1
@@ -413,7 +413,7 @@
# Hosts which can be cross-compiled must specify:
# SWIFT_HOST_TRIPLE and llvm_target_arch (as well as usual HOST_VARIANT flags)
-
+
case ${host} in
freebsd-x86_64)
SWIFT_HOST_VARIANT="freebsd"
@@ -517,7 +517,7 @@
SWIFT_HOST_VARIANT="iphonesimulator"
SWIFT_HOST_VARIANT_SDK="IOS_SIMULATOR"
SWIFT_HOST_VARIANT_ARCH="x86_64"
-
+
cmake_osx_deployment_target=""
cmark_cmake_options=(
-DCMAKE_C_FLAGS="$(cmark_c_flags ${host})"
@@ -535,7 +535,7 @@
SWIFT_HOST_VARIANT="iphoneos"
SWIFT_HOST_VARIANT_SDK="IOS"
SWIFT_HOST_VARIANT_ARCH="armv7"
-
+
cmake_osx_deployment_target=""
cmark_cmake_options=(
-DCMAKE_C_FLAGS="$(cmark_c_flags ${host})"
@@ -589,7 +589,7 @@
SWIFT_HOST_VARIANT="appletvsimulator"
SWIFT_HOST_VARIANT_SDK="TVOS_SIMULATOR"
SWIFT_HOST_VARIANT_ARCH="x86_64"
-
+
cmake_osx_deployment_target=""
cmark_cmake_options=(
-DCMAKE_C_FLAGS="$(cmark_c_flags ${host})"
@@ -1004,8 +1004,8 @@
fi
}
-function join {
- local IFS="$1"; shift; echo "$*";
+function join {
+ local IFS="$1"; shift; echo "$*";
}
function false_true() {
@@ -1091,7 +1091,7 @@
function get_host_install_prefix() {
local host="$1"
-
+
if [[ $(is_cross_tools_host ${host}) ]] && [[ ${#CROSS_COMPILE_INSTALL_PREFIXES[@]} -gt 0 ]]; then
# Find the host's index in CROSS_COMPILE_HOSTS.
@@ -1134,7 +1134,7 @@
function should_include_host_in_lipo() {
local host="$1"
if [[ $(has_cross_compile_hosts) ]] && [[ -z "${SKIP_MERGE_LIPO_CROSS_COMPILE_TOOLS}" ]]; then
- case ${host} in
+ case ${host} in
iphone* | appletv* | watch* )
echo 1
;;
@@ -1144,7 +1144,7 @@
function host_has_darwin_symbols() {
local host="$1"
- case ${host} in
+ case ${host} in
macosx* | iphone* | appletv* | watch* )
echo 1
;;
@@ -1156,11 +1156,11 @@
# FIXME: STDLIB_DEPLOYMENT_TARGETS argument assumed to apply when Host == Build
# Cross-compile Hosts are only built with their native standard libraries.
# To fix this, we would need to pass in a list of stdlib targets _per host_,
-# and the SWIFT_SDKS parameters would need to be able to capture both the SDK
+# and the SWIFT_SDKS parameters would need to be able to capture both the SDK
# and architecture of each stdlib target -- currently it only captures the SDK.
#
# We turn these targets in to SWIFT_SDKS in `calculate_targets_for_host()`
-
+
if [[ $(is_cross_tools_host $1) ]] ; then
echo "$1"
else
@@ -1299,7 +1299,7 @@
function calculate_targets_for_host() {
local host=$1
-
+
SWIFT_STDLIB_TARGETS=()
SWIFT_SDKS=()
SWIFT_BENCHMARK_TARGETS=()
@@ -1696,7 +1696,7 @@
;;
foundation)
echo "--config ${FOUNDATION_BUILD_TYPE}"
- ;;
+ ;;
libdispatch)
;;
libicu)
@@ -2019,7 +2019,7 @@
-DCLANG_TOOL_CLANG_FORMAT_BUILD=NO
)
fi
-
+
if [[ $(true_false "${LLVM_INCLUDE_TESTS}") == "FALSE" ]]; then
cmake_options+=(
-DLLVM_INCLUDE_TESTS=NO
@@ -2362,7 +2362,7 @@
swiftpm)
set_swiftpm_bootstrap_command
call "${swiftpm_bootstrap_command[@]}"
-
+
# swiftpm installs itself with a bootstrap method. No further cmake building is performed.
continue
;;
@@ -2370,13 +2370,13 @@
SWIFTC_BIN="$(build_directory_bin ${LOCAL_HOST} swift)/swiftc"
XCTEST_BUILD_DIR=$(build_directory ${host} xctest)
FOUNDATION_BUILD_DIR=$(build_directory ${host} foundation)
-
+
# Staging: require opt-in for building with dispatch
if [[ ! "${SKIP_BUILD_LIBDISPATCH}" ]] ; then
LIBDISPATCH_BUILD_DIR="$(build_directory ${host} libdispatch)"
LIBDISPATCH_BUILD_ARGS="--libdispatch-src-dir=${LIBDISPATCH_SOURCE_DIR} --libdispatch-build-dir=${LIBDISPATCH_BUILD_DIR}"
fi
-
+
# Use XCTEST_BUILD_TYPE to build either --debug or --release.
if [[ "${XCTEST_BUILD_TYPE}" == "Debug" ]] ; then
XCTEST_BUILD_ARGS="--debug"
@@ -2414,7 +2414,7 @@
SWIFT_USE_LINKER="-fuse-ld=gold"
fi
- # FIXME CROSSCOMPILING:
+ # FIXME CROSSCOMPILING:
# Foundation is a target library (like the Swift standard library),
# so technically we should build it for all stdlib_targets, not just for the host.
# However, we only have the triple and sysroot for the host.
@@ -2431,7 +2431,7 @@
echo "Skipping Foundation on OS X -- use the Xcode project instead"
continue
fi
-
+
with_pushd "${FOUNDATION_SOURCE_DIR}" \
call env SWIFTC="${SWIFTC_BIN}" CLANG="${LLVM_BIN}"/clang SWIFT="${SWIFT_BIN}" \
SDKROOT="${SWIFT_BUILD_PATH}" BUILD_DIR="${build_dir}" DSTROOT="$(get_host_install_destdir ${host})" PREFIX="$(get_host_install_prefix ${host})" ./configure "${FOUNDATION_BUILD_TYPE}" ${FOUNDATION_BUILD_ARGS[@]} -DXCTEST_BUILD_DIR=${XCTEST_BUILD_DIR} $LIBDISPATCH_BUILD_ARGS
@@ -2762,7 +2762,7 @@
# Use the clang that was just built in the tree.
LLDB_DOTEST_CC_OPTS="-C $(build_directory $LOCAL_HOST llvm)"/bin/clang
fi
-
+
call mkdir -p "${results_dir}"
with_pushd "${results_dir}" \
call env SWIFTCC="$(build_directory $LOCAL_HOST swift)/bin/swiftc" \
@@ -2954,7 +2954,7 @@
# Calculate the directory to install products in to.
host_install_destdir=$(get_host_install_destdir ${host})
host_install_prefix=$(get_host_install_prefix ${host})
-
+
if [[ $(should_include_host_in_lipo ${host}) ]]; then
LIPO_SRC_DIRS+=( "${host_install_destdir}" )
fi
@@ -3264,7 +3264,7 @@
# Get the directory where the products where installed.
# If INSTALL_DESTDIR not given, we couldn't have installed anything.
-
+
if [[ -z "${INSTALL_DESTDIR}" ]] ; then
echo "--install-destdir required to build a package. Skipping."
return
@@ -3316,14 +3316,14 @@
if [[ "${DARWIN_TOOLCHAIN_APPLICATION_CERT}" ]] ; then
echo "-- Codesign xctoolchain --"
- call "${SWIFT_SOURCE_DIR}/utils/toolchain-codesign" "${DARWIN_TOOLCHAIN_APPLICATION_CERT}" "${host_install_destdir}${TOOLCHAIN_PREFIX}/"
+ call "${SWIFT_SOURCE_DIR}/utils/toolchain-codesign" "${DARWIN_TOOLCHAIN_APPLICATION_CERT}" "${host_install_destdir}${TOOLCHAIN_PREFIX}/"
fi
if [[ "${DARWIN_TOOLCHAIN_INSTALLER_PACKAGE}" ]] ; then
echo "-- Create Installer --"
call "${SWIFT_SOURCE_DIR}/utils/toolchain-installer" "${host_install_destdir}${TOOLCHAIN_PREFIX}/" "${DARWIN_TOOLCHAIN_BUNDLE_IDENTIFIER}" \
"${DARWIN_TOOLCHAIN_INSTALLER_CERT}" "${DARWIN_TOOLCHAIN_INSTALLER_PACKAGE}" "${DARWIN_TOOLCHAIN_INSTALL_LOCATION}" \
"${DARWIN_TOOLCHAIN_VERSION}" "${SWIFT_SOURCE_DIR}/utils/darwin-installer-scripts"
- fi
+ fi
# host_install_destdir contains the toolchain prefix.
# We want to create the package in host_install_destdir_nonprefixed.
@@ -3366,32 +3366,32 @@
# Build and test packages.
for host in "${ALL_HOSTS[@]}"; do
-
+
# Check if we should perform this action.
if ! [[ $(should_execute_action "${host}-package") ]]; then
continue
fi
-
+
if [[ $(should_include_host_in_lipo ${host}) ]]; then
continue
- fi
-
+ fi
+
build_and_test_installable_package ${host}
done
# Lipo those products which require it, optionally build and test an installable package.
if [[ ${#LIPO_SRC_DIRS[@]} -gt 0 ]]; then
- # This is from multiple hosts; Which host should we say it is?
+ # This is from multiple hosts; Which host should we say it is?
# Let's call it 'merged-hosts' so that we can identify it.
mergedHost="merged-hosts"
-
+
# Check if we should perform this action.
if ! [[ $(should_execute_action "${mergedHost}-lipo") ]]; then
continue
fi
-
+
echo "--- Merging and running lipo ---"
-
+
# Allow passing lipo with --host-lipo
if [[ -z "${HOST_LIPO}" ]] ; then
LIPO_PATH=$(xcrun_find_tool lipo)
diff --git a/utils/build-toolchain b/utils/build-toolchain
index c355b76..bf9fbbb 100755
--- a/utils/build-toolchain
+++ b/utils/build-toolchain
@@ -14,7 +14,7 @@
SRC_DIR=$PWD
DRY_RUN=
-if [[ "$1" == "-n" || "$1" == "--dry-run" ]] ; then
+if [[ "$2" == "-n" || "$2" == "--dry-run" ]] ; then
DRY_RUN="-n"
shift
fi
@@ -40,7 +40,11 @@
if [[ "$(uname -s)" == "Darwin" ]] ; then
SWIFT_PACKAGE=buildbot_osx_package
else
- SWIFT_PACKAGE=buildbot_linux
+ if [[ "$2" == "-t" || "$2" == "--test" ]] ; then
+ SWIFT_PACKAGE=buildbot_linux
+ else
+ SWIFT_PACKAGE=buildbot_linux,no_test
+ fi
fi
./utils/build-script ${DRY_RUN} --preset="${SWIFT_PACKAGE}" \
diff --git a/utils/jobstats/__init__.py b/utils/jobstats/__init__.py
new file mode 100644
index 0000000..f0dfebd
--- /dev/null
+++ b/utils/jobstats/__init__.py
@@ -0,0 +1,23 @@
+#!/usr/bin/python
+#
+# ==-- jobstats - support for reading the contents of stats dirs --==#
+#
+# This source file is part of the Swift.org open source project
+#
+# Copyright (c) 2014-2017 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
+#
+# ==------------------------------------------------------------------------==#
+#
+# This module contains subroutines for loading object-representations of one or
+# more directories generated by `swiftc -stats-output-dir`.
+
+__author__ = 'Graydon Hoare'
+__email__ = 'ghoare@apple.com'
+__versioninfo__ = (0, 1, 0)
+__version__ = '.'.join(str(v) for v in __versioninfo__)
+
+from .jobstats import JobStats, load_stats_dir, merge_all_jobstats # noqa
diff --git a/utils/jobstats/jobstats.py b/utils/jobstats/jobstats.py
new file mode 100644
index 0000000..ace2994
--- /dev/null
+++ b/utils/jobstats/jobstats.py
@@ -0,0 +1,228 @@
+#!/usr/bin/python
+#
+# ==-- jobstats - support for reading the contents of stats dirs --==#
+#
+# This source file is part of the Swift.org open source project
+#
+# Copyright (c) 2014-2017 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
+#
+# ==------------------------------------------------------------------------==#
+#
+# This file contains subroutines for loading object-representations of one or
+# more directories generated by `swiftc -stats-output-dir`.
+
+import datetime
+import itertools
+import json
+import os
+import random
+import re
+
+
+class JobStats(object):
+ """Object holding the stats of a single job run during a compilation,
+ corresponding to a single JSON file produced by a single job process
+ passed -stats-output-dir."""
+
+ def __init__(self, jobkind, jobid, module, start_usec, dur_usec,
+ jobargs, stats):
+ self.jobkind = jobkind
+ self.jobid = jobid
+ self.module = module
+ self.start_usec = start_usec
+ self.dur_usec = dur_usec
+ self.jobargs = jobargs
+ self.stats = stats
+
+ def is_driver_job(self):
+ """Return true iff self measures a driver job"""
+ return self.jobkind == 'driver'
+
+ def is_frontend_job(self):
+ """Return true iff self measures a frontend job"""
+ return self.jobkind == 'frontend'
+
+ def driver_jobs_ran(self):
+ """Return the count of a driver job's ran sub-jobs"""
+ assert(self.is_driver_job())
+ return self.stats.get("Driver.NumDriverJobsRun", 0)
+
+ def driver_jobs_skipped(self):
+ """Return the count of a driver job's skipped sub-jobs"""
+ assert(self.is_driver_job())
+ return self.stats.get("Driver.NumDriverJobsSkipped", 0)
+
+ def driver_jobs_total(self):
+ """Return the total count of a driver job's ran + skipped sub-jobs"""
+ assert(self.is_driver_job())
+ return self.driver_jobs_ran() + self.driver_jobs_skipped()
+
+ def merged_with(self, other):
+ """Return a new JobStats, holding the merger of self and other"""
+ merged_stats = {}
+ for k, v in self.stats.items() + other.stats.items():
+ merged_stats[k] = v + merged_stats.get(k, 0.0)
+ merged_kind = self.jobkind
+ if other.jobkind != merged_kind:
+ merged_kind = "<merged>"
+ merged_module = self.module
+ if other.module != merged_module:
+ merged_module = "<merged>"
+ merged_start = min(self.start_usec, other.start_usec)
+ merged_end = max(self.start_usec + self.dur_usec,
+ other.start_usec + other.dur_usec)
+ merged_dur = merged_end - merged_start
+ return JobStats(merged_kind, random.randint(0, 1000000000),
+ merged_module, merged_start, merged_dur,
+ self.jobargs + other.jobargs, merged_stats)
+
+ def prefixed_by(self, prefix):
+ prefixed_stats = dict([((prefix + "." + k), v)
+ for (k, v) in self.stats.items()])
+ return JobStats(self.jobkind, random.randint(0, 1000000000),
+ self.module, self.start_usec, self.dur_usec,
+ self.jobargs, prefixed_stats)
+
+ def incrementality_percentage(self):
+ """Assuming the job is a driver job, return the amount of
+ jobs that actually ran, as a percentage of the total number."""
+ assert(self.is_driver_job())
+ ran = self.driver_jobs_ran()
+ total = self.driver_jobs_total()
+ return round((float(ran) / float(total)) * 100.0, 2)
+
+ def to_catapult_trace_obj(self):
+ """Return a JSON-formattable object fitting chrome's
+ 'catapult' trace format"""
+ return {"name": self.module,
+ "cat": self.jobkind,
+ "ph": "X", # "X" == "complete event"
+ "pid": self.jobid,
+ "tid": 1,
+ "ts": self.start_usec,
+ "dur": self.dur_usec,
+ "args": self.jobargs}
+
+ def start_timestr(self):
+ """Return a formatted timestamp of the job's start-time"""
+ t = datetime.datetime.fromtimestamp(self.start_usec / 1000000.0)
+ return t.strftime("%Y-%m-%d %H:%M:%S")
+
+ def end_timestr(self):
+ """Return a formatted timestamp of the job's end-time"""
+ t = datetime.datetime.fromtimestamp((self.start_usec +
+ self.dur_usec) / 1000000.0)
+ return t.strftime("%Y-%m-%d %H:%M:%S")
+
+ def pick_lnt_metric_suffix(self, metric_name):
+ """Guess an appropriate LNT metric type for a given metric name"""
+ if "BytesOutput" in metric_name:
+ return "code_size"
+ if "RSS" in metric_name or "BytesAllocated" in metric_name:
+ return "mem"
+ return "compile"
+
+ def to_lnt_test_obj(self, args):
+ """Return a JSON-formattable object fitting LNT's 'submit' format"""
+ run_info = {
+ "run_order": str(args.lnt_order),
+ "tag": str(args.lnt_tag),
+ }
+ run_info.update(dict(args.lnt_run_info))
+ stats = self.stats
+ return {
+ "Machine":
+ {
+ "Name": args.lnt_machine,
+ "Info": dict(args.lnt_machine_info)
+ },
+ "Run":
+ {
+ "Start Time": self.start_timestr(),
+ "End Time": self.end_timestr(),
+ "Info": run_info
+ },
+ "Tests":
+ [
+ {
+ "Data": [v],
+ "Info": {},
+ "Name": "%s.%s.%s.%s" % (args.lnt_tag, self.module,
+ k, self.pick_lnt_metric_suffix(k))
+ }
+ for (k, v) in stats.items()
+ ]
+ }
+
+
+def load_stats_dir(path, select_module=[]):
+ """Loads all stats-files found in path into a list of JobStats objects"""
+ jobstats = []
+ auxpat = (r"(?P<module>[^-]+)-(?P<input>[^-]+)-(?P<triple>[^-]+)" +
+ r"-(?P<out>[^-]+)-(?P<opt>[^-]+)")
+ fpat = (r"^stats-(?P<start>\d+)-swift-(?P<kind>\w+)-" +
+ auxpat +
+ r"-(?P<pid>\d+)(-.*)?.json$")
+ fre = re.compile(fpat)
+ for root, dirs, files in os.walk(path):
+ for f in files:
+ m = fre.match(f)
+ if not m:
+ continue
+ # NB: "pid" in fpat is a random number, not unix pid.
+ mg = m.groupdict()
+ jobkind = mg['kind']
+ jobid = int(mg['pid'])
+ start_usec = int(mg['start'])
+ module = mg["module"]
+ if len(select_module) != 0 and module not in select_module:
+ continue
+ jobargs = [mg["input"], mg["triple"], mg["out"], mg["opt"]]
+
+ with open(os.path.join(root, f)) as fp:
+ j = json.load(fp)
+ dur_usec = 1
+ patstr = (r"time\.swift-" + jobkind + r"\." + auxpat +
+ r"\.wall$")
+ pat = re.compile(patstr)
+ stats = dict()
+ for (k, v) in j.items():
+ if k.startswith("time."):
+ v = int(1000000.0 * float(v))
+ stats[k] = v
+ tm = re.match(pat, k)
+ if tm:
+ dur_usec = v
+
+ e = JobStats(jobkind=jobkind, jobid=jobid,
+ module=module, start_usec=start_usec,
+ dur_usec=dur_usec, jobargs=jobargs,
+ stats=stats)
+ jobstats.append(e)
+ return jobstats
+
+
+def merge_all_jobstats(jobstats, select_module=[], group_by_module=False):
+ """Does a pairwise merge of the elements of list of jobs"""
+ m = None
+ if len(select_module) > 0:
+ jobstats = filter(lambda j: j.module in select_module, jobstats)
+ if group_by_module:
+ def keyfunc(j):
+ return j.module
+ jobstats.sort(key=keyfunc)
+ prefixed = []
+ for mod, group in itertools.groupby(jobstats, keyfunc):
+ groupmerge = merge_all_jobstats(group)
+ prefixed.append(groupmerge.prefixed_by(mod))
+ jobstats = prefixed
+ for j in jobstats:
+ if m is None:
+ m = j
+ else:
+ m = m.merged_with(j)
+ return m
diff --git a/utils/optimizer_counters_to_sql.py b/utils/optimizer_counters_to_sql.py
new file mode 100755
index 0000000..03bf3de
--- /dev/null
+++ b/utils/optimizer_counters_to_sql.py
@@ -0,0 +1,143 @@
+#!/usr/bin/env python
+# optimizer_counters_to_sql.py - Store CSV counters into SQLite -*- python -*-
+#
+# This source file is part of the Swift.org open source project
+#
+# Copyright (c) 2014 - 2017 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
+
+import sqlite3 as lite
+import sys
+
+
+# A simple class to connect to a DB and store the statistics from a CSV
+# (comma separated values) file with optimizer counters there.
+#
+# See OptimizerCountersAnalysis.md for more details about working with
+# produced SQLite database and analyzing the collected optimizer counters.
+class OptStatsDB(object):
+ def __init__(self, dbname):
+ try:
+ # Establish a connection to a DB.
+ con = lite.connect(dbname)
+ self.con = con
+ cur = con.cursor()
+ self.cur = cur
+ # FIXME: A more efficient representation could be used.
+ # There could be separate tables for all possible Stage names,
+ # Transform names, Kind names, Counter names, Symbol names.
+ # They would get unique integer IDs in their respective tables.
+ # The Counters table would then use those unique integer IDs
+ # as foreign keys.
+ # This way the storage required for Counters may get much
+ # smaller as it would only store integers instead of long repeating
+ # strings.
+ # The drawback of such an approach is that the queries may become
+ # much more complex to write, as they would need to span over
+ # multiple tables.
+
+ # Create the required tables, indices, etc.
+ cur.execute("CREATE TABLE IF NOT EXISTS Counters"
+ "(Id INTEGER PRIMARY KEY AUTOINCREMENT, "
+ "Stage TEXT NOT NULL, "
+ "Transform TEXT NOT NULL, "
+ "Kind TEXT, "
+ "Counter TEXT NOT NULL, "
+ "PassNum INT NOT NULL, "
+ "Delta NUMBER,"
+ "Old INT, "
+ "New INT, "
+ "Duration INT, "
+ "Symbol TEXT NOT NULL DEFAULT '')")
+ cur.execute('CREATE INDEX IF NOT EXISTS StageIndex '
+ 'ON Counters(Stage)')
+ cur.execute('CREATE INDEX IF NOT EXISTS TransformIndex '
+ 'ON Counters(Transform)')
+ cur.execute('CREATE INDEX IF NOT EXISTS KindIndex '
+ 'ON Counters(Kind)')
+ cur.execute('CREATE INDEX IF NOT EXISTS CounterIndex '
+ 'ON Counters(Counter)')
+ cur.execute('CREATE INDEX IF NOT EXISTS SymbolIndex '
+ 'ON Counters(Symbol)')
+ except lite.Error as e:
+ print('Error {}' .format(e.args[0]))
+ sys.exit(1)
+ finally:
+ pass
+
+ def finish(self):
+ try:
+ self.con.commit()
+ self.con.close()
+ finally:
+ pass
+
+ # Store a single statistics record into a DB.
+ def addRecord(self, stage, transform, kind,
+ counter, passnum, delta, old, new, duration, symbol):
+ values = [(stage, transform, kind, counter, passnum,
+ delta, old, new, duration, symbol,), ]
+ self.cur.executemany(
+ 'INSERT INTO Counters VALUES '
+ '(NULL, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)',
+ values)
+
+
+# Read input file line by line, parse the lines and store the stats into
+# the DB.
+def addStatsFromInput(inputFile, db):
+ for line in inputFile:
+ # Read next line
+ # Split into segments
+ segments = line.split(",")
+ if len(segments) < 6 or not (segments[0] in [
+ 'module', 'function', 'function_history']):
+ continue
+ # Trim all values
+ segments = map(str.strip, segments)
+ if segments[0] == 'function_history':
+ # Process history records
+ delta = 0.0
+ (kind, counter, stage, transform, passnum,
+ old, duration, symbol) = segments
+ new = old
+ else:
+ # Process stats records
+ (kind, counter, stage, transform, passnum, delta,
+ old, new, duration, symbol) = segments
+
+ db.addRecord(
+ stage,
+ transform,
+ kind,
+ counter,
+ passnum,
+ delta,
+ old,
+ new,
+ duration,
+ symbol)
+
+
+def processStatsFile(filename, dbname):
+ print(
+ "Copying stats from the file '{}' into database '{}'".format(
+ filename,
+ dbname))
+ db = OptStatsDB(dbname)
+ with open(filename, "rb") as inputFile:
+ addStatsFromInput(inputFile, db)
+ db.finish()
+
+
+def main():
+ filename = sys.argv[1]
+ dbname = sys.argv[2]
+ processStatsFile(filename, dbname)
+
+
+if __name__ == '__main__':
+ main()
diff --git a/utils/process-stats-dir.py b/utils/process-stats-dir.py
index 497c0ab..dc084ce 100755
--- a/utils/process-stats-dir.py
+++ b/utils/process-stats-dir.py
@@ -17,174 +17,14 @@
import argparse
import csv
-import datetime
import json
import os
import platform
-import random
-import re
import sys
import time
import urllib
import urllib2
-
-
-class JobStats:
-
- def __init__(self, jobkind, jobid, module, start_usec, dur_usec,
- jobargs, stats):
- self.jobkind = jobkind
- self.jobid = jobid
- self.module = module
- self.start_usec = start_usec
- self.dur_usec = dur_usec
- self.jobargs = jobargs
- self.stats = stats
-
- def is_driver_job(self):
- return self.jobkind == 'driver'
-
- def is_frontend_job(self):
- return self.jobkind == 'frontend'
-
- def driver_jobs_ran(self):
- assert(self.is_driver_job())
- return self.stats.get("Driver.NumDriverJobsRun", 0)
-
- def driver_jobs_skipped(self):
- assert(self.is_driver_job())
- return self.stats.get("Driver.NumDriverJobsSkipped", 0)
-
- def driver_jobs_total(self):
- assert(self.is_driver_job())
- return self.driver_jobs_ran() + self.driver_jobs_skipped()
-
- def merged_with(self, other):
- merged_stats = {}
- for k, v in self.stats.items() + other.stats.items():
- merged_stats[k] = v + merged_stats.get(k, 0.0)
- merged_kind = self.jobkind
- if other.jobkind != merged_kind:
- merged_kind = "<merged>"
- merged_module = self.module
- if other.module != merged_module:
- merged_module = "<merged>"
- merged_start = min(self.start_usec, other.start_usec)
- merged_end = max(self.start_usec + self.dur_usec,
- other.start_usec + other.dur_usec)
- merged_dur = merged_end - merged_start
- return JobStats(merged_kind, random.randint(0, 1000000000),
- merged_module, merged_start, merged_dur,
- self.jobargs + other.jobargs, merged_stats)
-
- def incrementality_percentage(self):
- assert(self.is_driver_job())
- ran = self.driver_jobs_ran()
- total = self.driver_jobs_total()
- return round((float(ran) / float(total)) * 100.0, 2)
-
- # Return a JSON-formattable object of the form preferred by google chrome's
- # 'catapult' trace-viewer.
- def to_catapult_trace_obj(self):
- return {"name": self.module,
- "cat": self.jobkind,
- "ph": "X", # "X" == "complete event"
- "pid": self.jobid,
- "tid": 1,
- "ts": self.start_usec,
- "dur": self.dur_usec,
- "args": self.jobargs}
-
- def start_timestr(self):
- t = datetime.datetime.fromtimestamp(self.start_usec / 1000000.0)
- return t.strftime("%Y-%m-%d %H:%M:%S")
-
- def end_timestr(self):
- t = datetime.datetime.fromtimestamp((self.start_usec +
- self.dur_usec) / 1000000.0)
- return t.strftime("%Y-%m-%d %H:%M:%S")
-
- def pick_lnt_metric_suffix(self, metric_name):
- if "BytesOutput" in metric_name:
- return "code_size"
- if "RSS" in metric_name or "BytesAllocated" in metric_name:
- return "mem"
- return "compile"
-
- # Return a JSON-formattable object of the form preferred by LNT's
- # 'submit' format.
- def to_lnt_test_obj(self, args):
- run_info = {
- "run_order": str(args.lnt_order),
- "tag": str(args.lnt_tag),
- }
- run_info.update(dict(args.lnt_run_info))
- stats = self.stats
- return {
- "Machine":
- {
- "Name": args.lnt_machine,
- "Info": dict(args.lnt_machine_info)
- },
- "Run":
- {
- "Start Time": self.start_timestr(),
- "End Time": self.end_timestr(),
- "Info": run_info
- },
- "Tests":
- [
- {
- "Data": [v],
- "Info": {},
- "Name": "%s.%s.%s.%s" % (args.lnt_tag, self.module,
- k, self.pick_lnt_metric_suffix(k))
- }
- for (k, v) in stats.items()
- ]
- }
-
-
-# Return an array of JobStats objects
-def load_stats_dir(path):
- jobstats = []
- auxpat = (r"(?P<module>[^-]+)-(?P<input>[^-]+)-(?P<triple>[^-]+)" +
- r"-(?P<out>[^-]+)-(?P<opt>[^-]+)")
- fpat = (r"^stats-(?P<start>\d+)-swift-(?P<kind>\w+)-" +
- auxpat +
- r"-(?P<pid>\d+)(-.*)?.json$")
- for root, dirs, files in os.walk(path):
- for f in files:
- m = re.match(fpat, f)
- if m:
- # NB: "pid" in fpat is a random number, not unix pid.
- mg = m.groupdict()
- jobkind = mg['kind']
- jobid = int(mg['pid'])
- start_usec = int(mg['start'])
- module = mg["module"]
- jobargs = [mg["input"], mg["triple"], mg["out"], mg["opt"]]
-
- j = json.load(open(os.path.join(root, f)))
- dur_usec = 1
- patstr = (r"time\.swift-" + jobkind + r"\." + auxpat +
- r"\.wall$")
- pat = re.compile(patstr)
- stats = dict()
- for (k, v) in j.items():
- if k.startswith("time."):
- v = int(1000000.0 * float(v))
- stats[k] = v
- tm = re.match(pat, k)
- if tm:
- dur_usec = v
-
- e = JobStats(jobkind=jobkind, jobid=jobid,
- module=module, start_usec=start_usec,
- dur_usec=dur_usec, jobargs=jobargs,
- stats=stats)
- jobstats.append(e)
- return jobstats
+from jobstats import load_stats_dir, merge_all_jobstats
# Passed args with 2-element remainder ["old", "new"], return a list of tuples
@@ -194,6 +34,7 @@
def load_paired_stats_dirs(args):
assert(len(args.remainder) == 2)
paired_stats = []
+ sel = args.select_module
(old, new) = args.remainder
for p in sorted(os.listdir(old)):
full_old = os.path.join(old, p)
@@ -201,8 +42,8 @@
if not (os.path.exists(full_old) and os.path.isdir(full_old) and
os.path.exists(full_new) and os.path.isdir(full_new)):
continue
- old_stats = load_stats_dir(full_old)
- new_stats = load_stats_dir(full_new)
+ old_stats = load_stats_dir(full_old, select_module=sel)
+ new_stats = load_stats_dir(full_new, select_module=sel)
if len(old_stats) == 0 or len(new_stats) == 0:
continue
paired_stats.append((p, (old_stats, new_stats)))
@@ -219,7 +60,9 @@
def write_lnt_values(args):
for d in args.remainder:
stats = load_stats_dir(d)
- merged = merge_all_jobstats(stats)
+ merged = merge_all_jobstats(stats,
+ select_module=args.select_module,
+ group_by_module=args.group_by_module)
j = merged.to_lnt_test_obj(args)
if args.lnt_submit is None:
json.dump(j, args.output, indent=4)
@@ -240,16 +83,6 @@
sys.exit(1)
-def merge_all_jobstats(jobstats):
- m = None
- for j in jobstats:
- if m is None:
- m = j
- else:
- m = m.merged_with(j)
- return m
-
-
def show_paired_incrementality(args):
fieldnames = ["old_pct", "old_skip",
"new_pct", "new_skip",
@@ -258,11 +91,16 @@
out = csv.DictWriter(args.output, fieldnames, dialect='excel-tab')
out.writeheader()
+ sel = args.select_module
for (name, (oldstats, newstats)) in load_paired_stats_dirs(args):
- olddriver = merge_all_jobstats([x for x in oldstats
- if x.is_driver_job()])
- newdriver = merge_all_jobstats([x for x in newstats
- if x.is_driver_job()])
+ olddriver = merge_all_jobstats((x for x in oldstats
+ if x.is_driver_job()),
+ select_module=sel,
+ group_by_module=args.group_by_module)
+ newdriver = merge_all_jobstats((x for x in newstats
+ if x.is_driver_job()),
+ select_module=sel,
+ group_by_module=args.group_by_module)
if olddriver is None or newdriver is None:
continue
oldpct = olddriver.incrementality_percentage()
@@ -283,7 +121,7 @@
out.writeheader()
for path in args.remainder:
- stats = load_stats_dir(path)
+ stats = load_stats_dir(path, select_module=args.select_module)
for s in stats:
if s.is_driver_job():
pct = s.incrementality_percentage()
@@ -366,8 +204,11 @@
with open(args.set_csv_baseline, "wb") as f:
out = csv.DictWriter(f, fieldnames, dialect='excel-tab',
quoting=csv.QUOTE_NONNUMERIC)
- m = merge_all_jobstats([s for d in args.remainder
- for s in load_stats_dir(d)])
+ sel = args.select_module
+ m = merge_all_jobstats((s for d in args.remainder
+ for s in load_stats_dir(d, select_module=sel)),
+ select_module=sel,
+ group_by_module=args.group_by_module)
changed = 0
newepoch = int(time.time())
for name in sorted(m.stats.keys()):
@@ -387,19 +228,9 @@
return 0
-def compare_to_csv_baseline(args):
- old_stats = read_stats_dict_from_csv(args.compare_to_csv_baseline)
- m = merge_all_jobstats([s for d in args.remainder
- for s in load_stats_dir(d)])
- new_stats = m.stats
-
- regressions = 0
- outfieldnames = ["old", "new", "delta_pct", "name"]
- out = csv.DictWriter(args.output, outfieldnames, dialect='excel-tab')
- out.writeheader()
-
+def compare_stats(args, old_stats, new_stats):
for stat_name in sorted(old_stats.keys()):
- (_, old) = old_stats[stat_name]
+ old = old_stats[stat_name]
new = new_stats.get(stat_name, 0)
(delta, delta_pct) = diff_and_pct(old, new)
if (stat_name.startswith("time.") and
@@ -407,6 +238,18 @@
continue
if abs(delta_pct) < args.delta_pct_thresh:
continue
+ yield (stat_name, old, new, delta, delta_pct)
+
+
+def write_comparison(args, old_stats, new_stats):
+ regressions = 0
+ outfieldnames = ["old", "new", "delta_pct", "name"]
+ out = csv.DictWriter(args.output, outfieldnames, dialect='excel-tab')
+ out.writeheader()
+
+ for (stat_name, old, new, delta, delta_pct) in compare_stats(args,
+ old_stats,
+ new_stats):
out.writerow(dict(name=stat_name,
old=int(old), new=int(new),
delta_pct=delta_pct))
@@ -415,6 +258,37 @@
return regressions
+def compare_to_csv_baseline(args):
+ old_stats = read_stats_dict_from_csv(args.compare_to_csv_baseline)
+ sel = args.select_module
+ m = merge_all_jobstats((s for d in args.remainder
+ for s in load_stats_dir(d, select_module=sel)),
+ select_module=sel,
+ group_by_module=args.group_by_module)
+ old_stats = dict((k, v) for (k, (_, v)) in old_stats.items())
+ new_stats = m.stats
+
+ return write_comparison(args, old_stats, new_stats)
+
+
+# Summarize immediate difference between two stats-dirs, optionally
+def compare_stats_dirs(args):
+ if len(args.remainder) != 2:
+ raise ValueError("Expected exactly 2 stats-dirs")
+
+ (old, new) = args.remainder
+ old_stats = merge_all_jobstats(
+ load_stats_dir(old, select_module=args.select_module),
+ select_module=args.select_module,
+ group_by_module=args.group_by_module)
+ new_stats = merge_all_jobstats(
+ load_stats_dir(new, select_module=args.select_module),
+ select_module=args.select_module,
+ group_by_module=args.group_by_module)
+
+ return write_comparison(args, old_stats.stats, new_stats.stats)
+
+
def main():
parser = argparse.ArgumentParser()
parser.add_argument("--verbose", action="store_true",
@@ -443,6 +317,14 @@
help="Tag for LNT submission")
parser.add_argument("--lnt-submit", type=str, default=None,
help="URL to submit LNT data to (rather than print)")
+ parser.add_argument("--select-module",
+ default=[],
+ action="append",
+ help="Select specific modules")
+ parser.add_argument("--group-by-module",
+ default=False,
+ action="store_true",
+ help="Group stats by module")
modes = parser.add_mutually_exclusive_group(required=True)
modes.add_argument("--catapult", action="store_true",
help="emit a 'catapult'-compatible trace of events")
@@ -454,6 +336,9 @@
type=argparse.FileType('rb', 0), default=None,
metavar="BASELINE.csv",
help="Compare stats dir to named CSV baseline")
+ modes.add_argument("--compare-stats-dirs",
+ action="store_true",
+ help="Compare two stats dirs directly")
modes.add_argument("--lnt", action="store_true",
help="Emit an LNT-compatible test summary")
parser.add_argument('remainder', nargs=argparse.REMAINDER,
@@ -465,6 +350,8 @@
return 1
if args.catapult:
write_catapult_trace(args)
+ elif args.compare_stats_dirs:
+ return compare_stats_dirs(args)
elif args.set_csv_baseline is not None:
return set_csv_baseline(args)
elif args.compare_to_csv_baseline is not None:
diff --git a/validation-test/Sema/rdar34333874.swift b/validation-test/Sema/rdar34333874.swift
new file mode 100644
index 0000000..7b1f5f6
--- /dev/null
+++ b/validation-test/Sema/rdar34333874.swift
@@ -0,0 +1,42 @@
+// RUN: %target-run-simple-swift
+// REQUIRES: executable_test
+
+class C {
+ var a: Int = 0
+ var b: Int = 0
+}
+
+@inline(never)
+func foo<T>(_ item: T, update: (inout T) throws -> Void) rethrows -> T {
+ var this = item
+ try update(&this)
+ return this
+}
+
+// Test single statement closure because it's type-checked
+// together with the call to `foo`
+
+let rdar34333874_1 = foo(C()) {
+ $0.a = 42
+}
+
+// The multi-statement closure which is type-checked
+// separately from call to `foo`
+
+let rdar34333874_2 = foo(C()) {
+ $0.a = 42
+ $0.b = 0
+}
+
+print(rdar34333874_1)
+print(rdar34333874_2)
+
+// Example which avoids mutating fields of the class
+
+@inline(never)
+func bar(_ o : C) {
+ let _ = foo(o) { (item) in
+ }
+}
+
+bar(C())
diff --git a/validation-test/Sema/type_checker_perf/fast/rdar19738292.swift.gyb b/validation-test/Sema/type_checker_perf/fast/rdar19738292.swift.gyb
index 23cb130..3310736 100644
--- a/validation-test/Sema/type_checker_perf/fast/rdar19738292.swift.gyb
+++ b/validation-test/Sema/type_checker_perf/fast/rdar19738292.swift.gyb
@@ -1,4 +1,4 @@
-// RUN: %scale-test --begin 1 --end 5 --step 1 --select incrementScopeCounter %s
+// RUN: %scale-test --begin 7 --end 12 --step 1 --select incrementScopeCounter %s
// REQUIRES: OS=macosx
// REQUIRES: asserts
diff --git a/validation-test/Sema/type_checker_perf/fast/rdar19915443.swift.gyb b/validation-test/Sema/type_checker_perf/fast/rdar19915443.swift.gyb
index 8a1d67f..dfb0cb8 100644
--- a/validation-test/Sema/type_checker_perf/fast/rdar19915443.swift.gyb
+++ b/validation-test/Sema/type_checker_perf/fast/rdar19915443.swift.gyb
@@ -1,4 +1,4 @@
-// RUN: %scale-test --begin 1 --end 5 --step 1 --select incrementScopeCounter %s
+// RUN: %scale-test --begin 7 --end 15 --step 1 --select incrementScopeCounter %s
// REQUIRES: OS=macosx
// REQUIRES: asserts
let a = [0]
diff --git a/validation-test/Sema/type_checker_perf/fast/rdar23327871.swift.gyb b/validation-test/Sema/type_checker_perf/fast/rdar23327871.swift.gyb
index e9f241e..059e405 100644
--- a/validation-test/Sema/type_checker_perf/fast/rdar23327871.swift.gyb
+++ b/validation-test/Sema/type_checker_perf/fast/rdar23327871.swift.gyb
@@ -1,4 +1,4 @@
-// RUN: %scale-test --begin 5 --end 10 --step 1 --select incrementScopeCounter %s
+// RUN: %scale-test --begin 8 --end 16 --step 1 --select incrementScopeCounter %s
// REQUIRES: OS=macosx
// REQUIRES: asserts
diff --git a/validation-test/Sema/type_checker_perf/slow/rdar32999041.swift.gyb b/validation-test/Sema/type_checker_perf/slow/rdar32999041.swift.gyb
index c8fcd96..08335a5 100644
--- a/validation-test/Sema/type_checker_perf/slow/rdar32999041.swift.gyb
+++ b/validation-test/Sema/type_checker_perf/slow/rdar32999041.swift.gyb
@@ -1,4 +1,4 @@
-// RUN: %scale-test --invert-result --begin 1 --end 5 --step 1 --select incrementScopeCounter %s
+// RUN: %scale-test -Xfrontend=-propagate-constraints --invert-result --begin 1 --end 5 --step 1 --select incrementScopeCounter %s
// REQUIRES: OS=macosx
// REQUIRES: asserts