[Mips] Explicitly instantiate MipsELFFile template class

Use explicit instantiation to reduce object files size.

llvm-svn: 234729
This commit is contained in:
Simon Atanasyan 2015-04-13 08:35:04 +00:00
parent aaf3df3a00
commit da46480c4d
3 changed files with 37 additions and 0 deletions

View File

@ -1,5 +1,6 @@
add_llvm_library(lldMipsELFTarget
MipsCtorsOrderPass.cpp
MipsELFFile.cpp
MipsELFFlagsMerger.cpp
MipsLinkingContext.cpp
MipsRelocationHandler.cpp

View File

@ -0,0 +1,21 @@
//===- lib/ReaderWriter/ELF/Mips/MipsELFFile.cpp --------------------------===//
//
// The LLVM Linker
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
#include "MipsELFFile.h"
namespace lld {
namespace elf {
MIPSFILE_INSTANTIATION(Mips32ELType)
MIPSFILE_INSTANTIATION(Mips64ELType)
MIPSFILE_INSTANTIATION(Mips32BEType)
MIPSFILE_INSTANTIATION(Mips64BEType)
}
}

View File

@ -289,6 +289,21 @@ private:
}
};
#define EXTERN_MIPSFILE_INSTANTIATION(T) \
EXTERN_TEMPLATE_INSTANTIATION(class MipsELFDefinedAtom<T>); \
EXTERN_TEMPLATE_INSTANTIATION(class MipsELFReference<T>); \
EXTERN_TEMPLATE_INSTANTIATION(class MipsELFFile<T>);
#define MIPSFILE_INSTANTIATION(T) \
TEMPLATE_INSTANTIATION(class MipsELFDefinedAtom<T>); \
TEMPLATE_INSTANTIATION(class MipsELFReference<T>); \
TEMPLATE_INSTANTIATION(class MipsELFFile<T>);
EXTERN_MIPSFILE_INSTANTIATION(Mips32ELType)
EXTERN_MIPSFILE_INSTANTIATION(Mips64ELType)
EXTERN_MIPSFILE_INSTANTIATION(Mips32BEType)
EXTERN_MIPSFILE_INSTANTIATION(Mips64BEType)
} // elf
} // lld