Swift Bridging: use C++ instead of C bridging for the optimizer

This commit is contained in:
Erik Eckstein
2023-03-21 13:50:22 +01:00
parent a092ecb5c2
commit 010efc1ca6
18 changed files with 554 additions and 671 deletions

View File

@@ -104,6 +104,22 @@ public:
}
}
size_t getCount() const {
switch (kind) {
case Kind::empty: return 0;
case Kind::singleFunction: return 1;
case Kind::multipleCallees: return ((Callees *)functionOrCallees)->size();
}
}
SILFunction *get(unsigned index) const {
switch (kind) {
case Kind::empty: llvm_unreachable("empty callee list");
case Kind::singleFunction: return (SILFunction *)functionOrCallees;
case Kind::multipleCallees: return ((Callees *)functionOrCallees)->operator[](index);
}
}
bool isIncomplete() const { return incomplete; }
/// Returns true if all callees are known and not external.