aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm/Object
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2013-07-09 12:22:05 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2013-07-09 12:22:05 +0000
commitc5f8757c727975e9a9d6247cc68fb79d7f4cff8f (patch)
tree7851ece1a9029e1367e60920d06a3cdbab3d5fee /include/llvm/Object
parent12f45c3782c0d01bcf9973bbc23dba2b17ce54cb (diff)
downloadexternal_llvm-c5f8757c727975e9a9d6247cc68fb79d7f4cff8f.zip
external_llvm-c5f8757c727975e9a9d6247cc68fb79d7f4cff8f.tar.gz
external_llvm-c5f8757c727975e9a9d6247cc68fb79d7f4cff8f.tar.bz2
Add getHeader helper and move ToHeader to the cpp file.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185933 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Object')
-rw-r--r--include/llvm/Object/Archive.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/include/llvm/Object/Archive.h b/include/llvm/Object/Archive.h
index aac978c..0cd1867 100644
--- a/include/llvm/Object/Archive.h
+++ b/include/llvm/Object/Archive.h
@@ -36,10 +36,6 @@ struct ArchiveMemberHeader {
uint64_t getSize() const;
};
-static const ArchiveMemberHeader *ToHeader(const char *base) {
- return reinterpret_cast<const ArchiveMemberHeader *>(base);
-}
-
class Archive : public Binary {
virtual void anchor();
public:
@@ -50,6 +46,10 @@ public:
/// \brief Offset from Data to the start of the file.
uint16_t StartOfFile;
+ const ArchiveMemberHeader *getHeader() const {
+ return reinterpret_cast<const ArchiveMemberHeader *>(Data.data());
+ }
+
public:
Child(const Archive *Parent, const char *Start);
@@ -64,7 +64,7 @@ public:
Child getNext() const;
error_code getName(StringRef &Result) const;
- StringRef getRawName() const { return ToHeader(Data.data())->getName(); }
+ StringRef getRawName() const { return getHeader()->getName(); }
/// \return the size of the archive member without the header or padding.
uint64_t getSize() const { return Data.size() - StartOfFile; }