diff options
author | Danil Malyshev <dmalyshev@accesssoftek.com> | 2012-04-10 01:54:44 +0000 |
---|---|---|
committer | Danil Malyshev <dmalyshev@accesssoftek.com> | 2012-04-10 01:54:44 +0000 |
commit | 3fd9b8422328a60664a5c631ec9519b58017fcbc (patch) | |
tree | 391c4d503ab2df503b390f5c6720a71426edd9d3 /include/llvm/Object/ObjectFile.h | |
parent | bf010eb9110009d745382bf15131fbe556562ffe (diff) |
Add a constructor for DataRefImpl and remove excess initialization.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@154371 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Object/ObjectFile.h')
-rw-r--r-- | include/llvm/Object/ObjectFile.h | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/include/llvm/Object/ObjectFile.h b/include/llvm/Object/ObjectFile.h index 09eb7fc75e..d8cda81533 100644 --- a/include/llvm/Object/ObjectFile.h +++ b/include/llvm/Object/ObjectFile.h @@ -38,6 +38,9 @@ union DataRefImpl { uint32_t a, b; } d; uintptr_t p; + DataRefImpl() { + std::memset(this, 0, sizeof(DataRefImpl)); + } }; template<class content_type> @@ -94,9 +97,7 @@ class RelocationRef { const ObjectFile *OwningObject; public: - RelocationRef() : OwningObject(NULL) { - std::memset(&RelocationPimpl, 0, sizeof(RelocationPimpl)); - } + RelocationRef() : OwningObject(NULL) { } RelocationRef(DataRefImpl RelocationP, const ObjectFile *Owner); @@ -136,9 +137,7 @@ class SectionRef { const ObjectFile *OwningObject; public: - SectionRef() : OwningObject(NULL) { - std::memset(&SectionPimpl, 0, sizeof(SectionPimpl)); - } + SectionRef() : OwningObject(NULL) { } SectionRef(DataRefImpl SectionP, const ObjectFile *Owner); @@ -175,9 +174,7 @@ class SymbolRef { const ObjectFile *OwningObject; public: - SymbolRef() : OwningObject(NULL) { - std::memset(&SymbolPimpl, 0, sizeof(SymbolPimpl)); - } + SymbolRef() : OwningObject(NULL) { } enum Type { ST_Unknown, // Type not specified @@ -236,9 +233,7 @@ class LibraryRef { const ObjectFile *OwningObject; public: - LibraryRef() : OwningObject(NULL) { - std::memset(&LibraryPimpl, 0, sizeof(LibraryPimpl)); - } + LibraryRef() : OwningObject(NULL) { } LibraryRef(DataRefImpl LibraryP, const ObjectFile *Owner); |