r265621 - [CrashReproducer] Move ModuleDependencyCollector method around. NFC

Bruno Cardoso Lopes via cfe-commits cfe-commits at lists.llvm.org
Wed Apr 6 17:00:42 PDT 2016


Author: bruno
Date: Wed Apr  6 19:00:42 2016
New Revision: 265621

URL: http://llvm.org/viewvc/llvm-project?rev=265621&view=rev
Log:
[CrashReproducer] Move ModuleDependencyCollector method around. NFC

Modified:
    cfe/trunk/lib/Frontend/ModuleDependencyCollector.cpp

Modified: cfe/trunk/lib/Frontend/ModuleDependencyCollector.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/ModuleDependencyCollector.cpp?rev=265621&r1=265620&r2=265621&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/ModuleDependencyCollector.cpp (original)
+++ cfe/trunk/lib/Frontend/ModuleDependencyCollector.cpp Wed Apr  6 19:00:42 2016
@@ -52,6 +52,24 @@ struct ModuleDependencyMMCallbacks : pub
 
 }
 
+// TODO: move this to Support/Path.h and check for HAVE_REALPATH?
+static bool real_path(StringRef SrcPath, SmallVectorImpl<char> &RealPath) {
+#ifdef LLVM_ON_UNIX
+  char CanonicalPath[PATH_MAX];
+
+  // TODO: emit a warning in case this fails...?
+  if (!realpath(SrcPath.str().c_str(), CanonicalPath))
+    return false;
+
+  SmallString<256> RPath(CanonicalPath);
+  RealPath.swap(RPath);
+  return true;
+#else
+  // FIXME: Add support for systems without realpath.
+  return false;
+#endif
+}
+
 void ModuleDependencyCollector::attachToASTReader(ASTReader &R) {
   R.addListener(llvm::make_unique<ModuleDependencyListener>(*this));
 }
@@ -81,24 +99,6 @@ void ModuleDependencyCollector::writeFil
   VFSWriter.write(OS);
 }
 
-// TODO: move this to Support/Path.h and check for HAVE_REALPATH?
-static bool real_path(StringRef SrcPath, SmallVectorImpl<char> &RealPath) {
-#ifdef LLVM_ON_UNIX
-  char CanonicalPath[PATH_MAX];
-
-  // TODO: emit a warning in case this fails...?
-  if (!realpath(SrcPath.str().c_str(), CanonicalPath))
-    return false;
-
-  SmallString<256> RPath(CanonicalPath);
-  RealPath.swap(RPath);
-  return true;
-#else
-  // FIXME: Add support for systems without realpath.
-  return false;
-#endif
-}
-
 bool ModuleDependencyCollector::getRealPath(StringRef SrcPath,
                                             SmallVectorImpl<char> &Result) {
   using namespace llvm::sys;




More information about the cfe-commits mailing list