File tree Expand file tree Collapse file tree 2 files changed +35
-1
lines changed Expand file tree Collapse file tree 2 files changed +35
-1
lines changed Original file line number Diff line number Diff line change 2222#include " swift/SIL/AbstractionPattern.h"
2323#include " swift/SIL/SILFunctionConventions.h"
2424#include " swift/SIL/SILModule.h"
25+ #include " swift/SIL/Test.h"
2526#include " swift/SIL/TypeLowering.h"
2627#include < tuple>
2728
@@ -1287,3 +1288,21 @@ SILType SILType::removingMoveOnlyWrapperToBoxedType(const SILFunction *fn) {
12871288bool SILType::isSendable (SILFunction *fn) const {
12881289 return getASTType ()->isSendableType ();
12891290}
1291+
1292+ namespace swift ::test {
1293+ // Arguments:
1294+ // - SILValue: value
1295+ // Dumps:
1296+ // - message
1297+ static FunctionTest IsSILTrivial (" is-sil-trivial" , [](auto &function,
1298+ auto &arguments,
1299+ auto &test) {
1300+ SILValue value = arguments.takeValue ();
1301+ llvm::outs () << value;
1302+ if (value->getType ().isTrivial (value->getFunction ())) {
1303+ llvm::outs () << " is trivial\n " ;
1304+ } else {
1305+ llvm::outs () << " is not trivial\n " ;
1306+ }
1307+ });
1308+ } // end namespace swift::test
Original file line number Diff line number Diff line change 1010//
1111// ===----------------------------------------------------------------------===//
1212
13- #include " swift/SIL/SILVisitor.h"
1413#include " swift/SIL/SILBuiltinVisitor.h"
1514#include " swift/SIL/SILModule.h"
15+ #include " swift/SIL/SILVisitor.h"
16+ #include " swift/SIL/Test.h"
1617
1718using namespace swift ;
1819
@@ -690,3 +691,17 @@ ValueOwnershipKind ValueBase::getOwnershipKind() const {
690691 assert (result && " Returned ownership kind invalid on values" );
691692 return result;
692693}
694+
695+ namespace swift ::test {
696+ // Arguments:
697+ // - SILValue: value
698+ // Dumps:
699+ // - message
700+ static FunctionTest GetOwnershipKind (" get-ownership-kind" , [](auto &function,
701+ auto &arguments,
702+ auto &test) {
703+ SILValue value = arguments.takeValue ();
704+ llvm::outs () << value;
705+ llvm::outs () << " OwnershipKind: " << value->getOwnershipKind () << " \n " ;
706+ });
707+ } // end namespace swift::test
You can’t perform that action at this time.
0 commit comments