[dsymutil] Use rfind for paths with parentheses

Dsymutil gets library member information is through the ambiguous
/path/to/archive.a(member.o). The current logic we use would get
confused by additional parentheses. Using rfind mitigates this issue.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355114 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Jonas Devlieghere 2019-02-28 18:46:04 +00:00
parent f71ec6c9f1
commit abce0e8bf5

View File

@ -21,7 +21,7 @@ namespace dsymutil {
static std::pair<StringRef, StringRef>
getArchiveAndObjectName(StringRef Filename) {
StringRef Archive = Filename.substr(0, Filename.find('('));
StringRef Archive = Filename.substr(0, Filename.rfind('('));
StringRef Object = Filename.substr(Archive.size() + 1).drop_back();
return {Archive, Object};
}