summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNAKAMURA Takumi <geek4civic@gmail.com>2013-10-16 01:42:33 +0000
committerNAKAMURA Takumi <geek4civic@gmail.com>2013-10-16 01:42:33 +0000
commitbf5391d2ef27b3956ed63e981eb5dae561b43c4d (patch)
treeac27347c03b67d94e88a6883ea3a8dcfd66bf4bc
parent002667c32ba09940b899edf78bbb93d8137a87e3 (diff)
downloadbcm5719-llvm-bf5391d2ef27b3956ed63e981eb5dae561b43c4d.tar.gz
bcm5719-llvm-bf5391d2ef27b3956ed63e981eb5dae561b43c4d.zip
clang-tools-extra/modularize: Compare Paths to Prefix as natively-canonicalized form.
On Win32, paths are not expected to be canonicalized. llvm-svn: 192763
-rw-r--r--clang-tools-extra/modularize/ModuleAssistant.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/clang-tools-extra/modularize/ModuleAssistant.cpp b/clang-tools-extra/modularize/ModuleAssistant.cpp
index 45641cb943e..36e899a39e3 100644
--- a/clang-tools-extra/modularize/ModuleAssistant.cpp
+++ b/clang-tools-extra/modularize/ModuleAssistant.cpp
@@ -162,8 +162,12 @@ static bool addModuleDescription(Module *RootModule,
DependentsVector &FileDependents = Dependencies[HeaderFilePath];
std::string FilePath;
// Strip prefix.
- if (HeaderFilePath.startswith(HeaderPrefix))
- FilePath = HeaderFilePath.substr(HeaderPrefix.size() + 1);
+ // HeaderFilePath should be compared to natively-canonicalized Prefix.
+ llvm::SmallString<256> NativePath, NativePrefix;
+ llvm::sys::path::native(HeaderFilePath, NativePath);
+ llvm::sys::path::native(HeaderPrefix, NativePrefix);
+ if (NativePath.startswith(NativePrefix))
+ FilePath = NativePath.substr(NativePrefix.size() + 1);
else
FilePath = HeaderFilePath;
int Count = FileDependents.size();
OpenPOWER on IntegriCloud