int swift::Demangle::getManglingPrefixLength(llvm::StringRef mangledName) { if (mangledName.empty()) return 0; llvm::StringRef prefixes[] = { /*Swift 4*/ "_T0", /*Swift 4.x*/ "$S", "_$S", /*Swift 5+*/ "$s", "_$s"}; // Look for any of the known prefixes for (auto prefix : prefixes) { if (mangledName.startswith(prefix)) return prefix.size(); } return 0; }
bool swift::Demangle::isOldFunctionTypeMangling(llvm::StringRef mangledName) { return mangledName.startswith("_T"); }
_T
, _T0
, $S
, $s
の 4つがこれまでにあるっぽい$s
から代わる事は今後無いと・・・#define MANGLING_PREFIX $s
になるってことは