mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[Demangler] Implement isObjCSymbol().
This function can be queried to find out whether the passed mangled name is an Objective-C symbol. This will be used in the debugger to replace an hardcoded check that would break if the mangling prefix changed. <rdar://problem/44467875>
This commit is contained in:
@@ -23,3 +23,10 @@ TEST(Demangle, DemangleWrappers) {
|
||||
demangleSymbolAsString(MangledName));
|
||||
}
|
||||
|
||||
TEST(Demangle, IsObjCSymbol) {
|
||||
EXPECT_EQ("type metadata accessor for __C.NSNumber",
|
||||
demangleSymbolAsString(llvm::StringRef("_$SSo8NSNumberCMa")));
|
||||
EXPECT_EQ(true, isObjCSymbol(llvm::StringRef("_$SSo8NSNumberCMa")));
|
||||
EXPECT_EQ(false,
|
||||
isObjCSymbol(llvm::StringRef("_$S3pat7inlinedSo8NSNumberCvp")));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user