aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Support/Path.cpp
diff options
context:
space:
mode:
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>2021-04-09 11:48:40 -0700
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>2021-04-09 11:49:40 -0700
commit365053d2a55b5e045354f3c3d0d0cc7f5810f457 (patch)
tree75e24e74b9999f8964cfb140b510e917b05e1c1a /llvm/lib/Support/Path.cpp
parent1e5f68d80a42ad0e377f6a3197034995bd7a2e16 (diff)
downloadllvm-365053d2a55b5e045354f3c3d0d0cc7f5810f457.zip
llvm-365053d2a55b5e045354f3c3d0d0cc7f5810f457.tar.gz
llvm-365053d2a55b5e045354f3c3d0d0cc7f5810f457.tar.bz2
Support: Remove code duplication for mapped_file_region accessors, NFC
Diffstat (limited to 'llvm/lib/Support/Path.cpp')
-rw-r--r--llvm/lib/Support/Path.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/llvm/lib/Support/Path.cpp b/llvm/lib/Support/Path.cpp
index f49affb..005c27c3 100644
--- a/llvm/lib/Support/Path.cpp
+++ b/llvm/lib/Support/Path.cpp
@@ -1152,6 +1152,21 @@ ErrorOr<perms> getPermissions(const Twine &Path) {
return Status.permissions();
}
+size_t mapped_file_region::size() const {
+ assert(Mapping && "Mapping failed but used anyway!");
+ return Size;
+}
+
+char *mapped_file_region::data() const {
+ assert(Mapping && "Mapping failed but used anyway!");
+ return reinterpret_cast<char *>(Mapping);
+}
+
+const char *mapped_file_region::const_data() const {
+ assert(Mapping && "Mapping failed but used anyway!");
+ return reinterpret_cast<const char *>(Mapping);
+}
+
} // end namespace fs
} // end namespace sys
} // end namespace llvm