[llvm] r324621 - [dwarfdump] Normalize input path.

Jonas Devlieghere via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 8 08:31:02 PST 2018


Author: jdevlieghere
Date: Thu Feb  8 08:31:01 2018
New Revision: 324621

URL: http://llvm.org/viewvc/llvm-project?rev=324621&view=rev
Log:
[dwarfdump] Normalize input path.

Before this patch, llvm-dwarfdump would reject `bundel.dSYM/` as input,
while `bundel.dSYM` was accepted. The reason is that `path::extension()`
returns an empty string for the former, leading to the argument not
being recognized as a dSYM bundle.

Modified:
    llvm/trunk/tools/llvm-dwarfdump/llvm-dwarfdump.cpp

Modified: llvm/trunk/tools/llvm-dwarfdump/llvm-dwarfdump.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-dwarfdump/llvm-dwarfdump.cpp?rev=324621&r1=324620&r2=324621&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-dwarfdump/llvm-dwarfdump.cpp (original)
+++ llvm/trunk/tools/llvm-dwarfdump/llvm-dwarfdump.cpp Thu Feb  8 08:31:01 2018
@@ -478,6 +478,8 @@ static bool handleFile(StringRef Filenam
 static std::vector<std::string> expandBundle(const std::string &InputPath) {
   std::vector<std::string> BundlePaths;
   SmallString<256> BundlePath(InputPath);
+  // Normalize input path. This is necessary to accept `bundle.dSYM/`.
+  sys::path::remove_dots(BundlePath);
   // Manually open up the bundle to avoid introducing additional dependencies.
   if (sys::fs::is_directory(BundlePath) &&
       sys::path::extension(BundlePath) == ".dSYM") {




More information about the llvm-commits mailing list