summaryrefslogtreecommitdiffstats
path: root/llvm/tools
diff options
context:
space:
mode:
authorJonas Devlieghere <jonas@devlieghere.com>2018-02-08 16:31:42 +0000
committerJonas Devlieghere <jonas@devlieghere.com>2018-02-08 16:31:42 +0000
commit8db9361f3d1ed8f5ca94261f8d4ec7f840fe2cc7 (patch)
tree8edde1a6b61fdc983a002f8bf5a438ad380db7f9 /llvm/tools
parentfba754a946cda80c2ab850d4128bfa522e1bfa99 (diff)
downloadbcm5719-llvm-8db9361f3d1ed8f5ca94261f8d4ec7f840fe2cc7.tar.gz
bcm5719-llvm-8db9361f3d1ed8f5ca94261f8d4ec7f840fe2cc7.zip
[dsymutil] Use llvm::sys::path to join bundle path.
When processing a dSYM bundle, use llvm::sys::path to join the different path components instead of using a string with hard coded forward slashes as separators. llvm-svn: 324622
Diffstat (limited to 'llvm/tools')
-rw-r--r--llvm/tools/dsymutil/dsymutil.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/llvm/tools/dsymutil/dsymutil.cpp b/llvm/tools/dsymutil/dsymutil.cpp
index dae872fe165..adc2e859438 100644
--- a/llvm/tools/dsymutil/dsymutil.cpp
+++ b/llvm/tools/dsymutil/dsymutil.cpp
@@ -329,8 +329,9 @@ static Expected<std::vector<std::string>> getInputs(bool DsymAsInput) {
}
// Make sure that we're dealing with a dSYM bundle.
- std::string dSYMDir = Input + "/Contents/Resources/DWARF";
- if (!llvm::sys::fs::is_directory(dSYMDir))
+ SmallString<256> BundlePath(Input);
+ sys::path::append(BundlePath, "Contents", "Resources", "DWARF");
+ if (!llvm::sys::fs::is_directory(BundlePath))
return make_error<StringError>(
Input + " is a directory, but doesn't look like a dSYM bundle.",
inconvertibleErrorCode());
@@ -338,7 +339,7 @@ static Expected<std::vector<std::string>> getInputs(bool DsymAsInput) {
// Create a directory iterator to iterate over all the entries in the
// bundle.
std::error_code EC;
- llvm::sys::fs::directory_iterator DirIt(dSYMDir, EC);
+ llvm::sys::fs::directory_iterator DirIt(BundlePath, EC);
llvm::sys::fs::directory_iterator DirEnd;
if (EC)
return errorCodeToError(EC);
OpenPOWER on IntegriCloud