From 05b96447ab27c394c6cc161ff9b2515ad673d74f Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Wed, 10 Apr 2013 15:18:39 +0000 Subject: Simplify the templating a bit. Since we only ever instantiate with a type that is a MachOType instantiation, we don't need to pass template argument. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179178 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/Object/MachO.h | 43 +++++++++++++++++++------------------------ 1 file changed, 19 insertions(+), 24 deletions(-) diff --git a/include/llvm/Object/MachO.h b/include/llvm/Object/MachO.h index 2eb094af4c..f08b3b5257 100644 --- a/include/llvm/Object/MachO.h +++ b/include/llvm/Object/MachO.h @@ -53,14 +53,14 @@ typedef typename MachODataTypeTypedefHelperCommon::MachOInt64 MachOInt64; template struct MachODataTypeTypedefHelper; -template class MachOT, endianness TargetEndianness> -struct MachODataTypeTypedefHelper > { +template +struct MachODataTypeTypedefHelper > { typedef MachODataTypeTypedefHelperCommon Base; typedef typename Base::MachOInt32 MachOIntPtr; }; -template class MachOT, endianness TargetEndianness> -struct MachODataTypeTypedefHelper > { +template +struct MachODataTypeTypedefHelper > { typedef MachODataTypeTypedefHelperCommon Base; typedef typename Base::MachOInt64 MachOIntPtr; }; @@ -79,8 +79,8 @@ namespace MachOFormat { template struct Section; - template class MachOT, endianness TargetEndianness> - struct Section > { + template + struct Section > { LLVM_MACHOB_IMPORT_TYPES(TargetEndianness) char Name[16]; char SegmentName[16]; @@ -95,9 +95,8 @@ namespace MachOFormat { MachOInt32 Reserved2; }; - template class MachOT, - endianness TargetEndianness> - struct Section > { + template + struct Section > { LLVM_MACHOB_IMPORT_TYPES(TargetEndianness) char Name[16]; char SegmentName[16]; @@ -132,10 +131,9 @@ namespace MachOFormat { template struct SymbolTableEntry; - template class MachOT, endianness TargetEndianness, - bool Is64Bits> - struct SymbolTableEntry > { - LLVM_MACHO_IMPORT_TYPES(MachOT, TargetEndianness, Is64Bits) + template + struct SymbolTableEntry > { + LLVM_MACHO_IMPORT_TYPES(MachOType, TargetEndianness, Is64Bits) MachOInt32 StringIndex; uint8_t Type; uint8_t SectionIndex; @@ -164,10 +162,9 @@ namespace MachOFormat { template struct SegmentLoadCommand; - template class MachOT, endianness TargetEndianness, - bool Is64Bits> - struct SegmentLoadCommand > { - LLVM_MACHO_IMPORT_TYPES(MachOT, TargetEndianness, Is64Bits) + template + struct SegmentLoadCommand > { + LLVM_MACHO_IMPORT_TYPES(MachOType, TargetEndianness, Is64Bits) MachOInt32 Type; MachOInt32 Size; char Name[16]; @@ -319,13 +316,11 @@ struct MachOObjectFileHelper : template class MachOObjectFile : public MachOObjectFileBase { public: - static const macho::LoadCommandType SegmentLoadType = - MachOObjectFileHelper::SegmentLoadType; - typedef typename MachOObjectFileHelper::SegmentLoadCommand - SegmentLoadCommand; - typedef typename MachOObjectFileHelper::SymbolTableEntry - SymbolTableEntry; - typedef typename MachOObjectFileHelper::Section Section; + typedef MachOObjectFileHelper Helper; + static const macho::LoadCommandType SegmentLoadType = Helper::SegmentLoadType; + typedef typename Helper::SegmentLoadCommand SegmentLoadCommand; + typedef typename Helper::SymbolTableEntry SymbolTableEntry; + typedef typename Helper::Section Section; MachOObjectFile(MemoryBuffer *Object, error_code &ec); static bool classof(const Binary *v); -- cgit v1.2.3