aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2008-05-21 21:20:07 +0000
committerBill Wendling <isanbard@gmail.com>2008-05-21 21:20:07 +0000
commit40db5d4539144aa086b60685a4dae324972fb23f (patch)
treec4d684905a158ee5e6b820fc94621f43931cb4ca
parent0263140c9e28c204b13455512b98214b3051510c (diff)
downloadexternal_llvm-40db5d4539144aa086b60685a4dae324972fb23f.tar.gz
external_llvm-40db5d4539144aa086b60685a4dae324972fb23f.tar.bz2
external_llvm-40db5d4539144aa086b60685a4dae324972fb23f.zip
Follow-up to the reverting of r51218. This puts the checks out-of-line. Because
they aren't in the header file, systems with a <string> header file that isn't 64-bit clean shouldn't warn if #including Path.h and specifying -Wshorten-64-to-32. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51393 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--include/llvm/System/Path.h12
-rw-r--r--lib/System/Path.cpp12
2 files changed, 15 insertions, 9 deletions
diff --git a/include/llvm/System/Path.h b/include/llvm/System/Path.h
index ba251a9dbb..ac0c6cbca2 100644
--- a/include/llvm/System/Path.h
+++ b/include/llvm/System/Path.h
@@ -205,16 +205,12 @@ namespace sys {
/// Compares \p this Path with \p that Path for equality.
/// @returns true if \p this and \p that refer to the same thing.
/// @brief Equality Operator
- bool operator==(const Path &that) const {
- return path == that.path;
- }
+ bool operator==(const Path &that) const;
/// Compares \p this Path with \p that Path for inequality.
/// @returns true if \p this and \p that refer to different things.
/// @brief Inequality Operator
- bool operator!=(const Path &that) const {
- return path != that.path;
- }
+ bool operator!=(const Path &that) const;
/// Determines if \p this Path is less than \p that Path. This is required
/// so that Path objects can be placed into ordered collections (e.g.
@@ -222,9 +218,7 @@ namespace sys {
/// the std::string::compare method.
/// @returns true if \p this path is lexicographically less than \p that.
/// @brief Less Than Operator
- bool operator<(const Path& that) const {
- return path < that.path;
- }
+ bool operator<(const Path& that) const;
/// @}
/// @name Path Accessors
diff --git a/lib/System/Path.cpp b/lib/System/Path.cpp
index 086c9f0238..03cdbf7764 100644
--- a/lib/System/Path.cpp
+++ b/lib/System/Path.cpp
@@ -24,6 +24,18 @@ using namespace sys;
//=== independent code.
//===----------------------------------------------------------------------===//
+bool Path::operator==(const Path &that) const {
+ return path == that.path;
+}
+
+bool Path::operator!=(const Path &that) const {
+ return path != that.path;
+}
+
+bool Path::operator<(const Path& that) const {
+ return path < that.path;
+}
+
std::ostream& llvm::operator<<(std::ostream &strm, const sys::Path &aPath) {
strm << aPath.toString();
return strm;