[llvm-commits] [llvm] r156864 - /llvm/trunk/include/llvm/Support/FileSystem.h

Daniel Dunbar daniel at zuster.org
Tue May 15 15:07:14 PDT 2012


Author: ddunbar
Date: Tue May 15 17:07:14 2012
New Revision: 156864

URL: http://llvm.org/viewvc/llvm-project?rev=156864&view=rev
Log:
[Support] Add a version of sys::fs::equivalent() that treats errors as false.

Modified:
    llvm/trunk/include/llvm/Support/FileSystem.h

Modified: llvm/trunk/include/llvm/Support/FileSystem.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/FileSystem.h?rev=156864&r1=156863&r2=156864&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Support/FileSystem.h (original)
+++ llvm/trunk/include/llvm/Support/FileSystem.h Tue May 15 17:07:14 2012
@@ -309,6 +309,13 @@
 ///          platform specific error_code.
 error_code equivalent(const Twine &A, const Twine &B, bool &result);
 
+/// @brief Simpler version of equivalent for clients that don't need to
+///        differentiate between an error and false.
+inline bool equivalent(const Twine &A, const Twine &B) {
+  bool result;
+  return !equivalent(A, B, result) && result;
+}
+
 /// @brief Get file size.
 ///
 /// @param path Input path.





More information about the llvm-commits mailing list