Bug 1506756 - Remove the use of real_path added in bug 1501903. r=andi, a=NPOTB
authorMike Hommey <mh+mozilla@glandium.org>
Tue, 13 Nov 2018 08:22:25 +0000
changeset 501237 6b3e88486ae17007d89f1b4925104f6d9f33886d
parent 501236 5054b80f1878eaacd75e5226a4cd3b295e001834
child 501238 7473fdd1c21c00299314892ad74b10aa5af67179
push id1864
push userffxbld-merge
push dateMon, 03 Dec 2018 15:51:40 +0000
treeherdermozilla-release@f040763d99ad [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersandi, NPOTB
bugs1506756, 1501903
milestone64.0
Bug 1506756 - Remove the use of real_path added in bug 1501903. r=andi, a=NPOTB In the first part of bug 1501903, paths were canonicalized in inThirdPartyPath. For some reason, this seems to add a non-negligible overhead on Windows. OTOH, most include paths handed by the build system are absolute, and most paths that contains .. are for system headers, which don't matter for the inThirdPartyPath test. Considering the inThirdPartyPath has been using non-canonicalized paths for the longest, we'll assume it's fine to come back to that mode. Differential Revision: https://phabricator.services.mozilla.com/D11725
build/clang-plugin/Utils.h
--- a/build/clang-plugin/Utils.h
+++ b/build/clang-plugin/Utils.h
@@ -351,20 +351,18 @@ inline bool inThirdPartyPath(SourceLocat
   Loc = SM.getFileLoc(Loc);
 
   unsigned id = SM.getFileID(Loc).getHashValue();
   auto pair = InThirdPartyPathCache.find(id);
   if (pair != InThirdPartyPathCache.end()) {
     return pair->second;
   }
 
-  SmallString<1024> RawFileName = SM.getFilename(Loc);
-  llvm::sys::fs::make_absolute(RawFileName);
-  SmallString<1024> FileName;
-  llvm::sys::fs::real_path(RawFileName, FileName);
+  SmallString<1024> FileName = SM.getFilename(Loc);
+  llvm::sys::fs::make_absolute(FileName);
 
   for (uint32_t i = 0; i < MOZ_THIRD_PARTY_PATHS_COUNT; ++i) {
     auto PathB = sys::path::begin(FileName);
     auto PathE = sys::path::end(FileName);
 
     auto ThirdPartyB = sys::path::begin(MOZ_THIRD_PARTY_PATHS[i]);
     auto ThirdPartyE = sys::path::end(MOZ_THIRD_PARTY_PATHS[i]);