Preserve debug info during iSel by keeping DanglingDebugInfoMap live until end of...
[oota-llvm.git] / lib / Support / PathV2.cpp
index 346387630465c33ace3a8c65b8bf4527143b7a0f..896c94c071bcaa6acf792daca6498b43eccabd30 100644 (file)
 
 namespace {
   using llvm::StringRef;
-
-  bool is_separator(const char value) {
-    switch(value) {
-#ifdef LLVM_ON_WIN32
-    case '\\': // fall through
-#endif
-    case '/': return true;
-    default: return false;
-    }
-  }
+  using llvm::sys::path::is_separator;
 
 #ifdef LLVM_ON_WIN32
   const StringRef separators = "\\/";
@@ -154,7 +145,7 @@ namespace {
 
     return end_pos;
   }
-}
+} // end unnamed namespace
 
 namespace llvm {
 namespace sys  {
@@ -400,6 +391,12 @@ void append(SmallVectorImpl<char> &path, const Twine &a,
   }
 }
 
+void append(SmallVectorImpl<char> &path,
+            const_iterator begin, const_iterator end) {
+  for (; begin != end; ++begin)
+    path::append(path, *begin);
+}
+
 const StringRef parent_path(StringRef path) {
   size_t end_pos = parent_path_end(path);
   if (end_pos == StringRef::npos)
@@ -483,6 +480,16 @@ const StringRef extension(StringRef path) {
       return fname.substr(pos);
 }
 
+bool is_separator(char value) {
+  switch(value) {
+#ifdef LLVM_ON_WIN32
+    case '\\': // fall through
+#endif
+    case '/': return true;
+    default: return false;
+  }
+}
+
 bool has_root_name(const Twine &path) {
   SmallString<128> path_storage;
   StringRef p = path.toStringRef(path_storage);
@@ -737,7 +744,7 @@ error_code remove_all_r(StringRef path, file_type ft, uint32_t &count) {
 
   return success;
 }
-}
+} // end unnamed namespace
 
 error_code remove_all(const Twine &path, uint32_t &num_removed) {
   SmallString<128> path_storage;