[lld] r234729 - [Mips] Explicitly instantiate MipsELFFile template class
Simon Atanasyan
simon at atanasyan.com
Mon Apr 13 01:35:04 PDT 2015
Author: atanasyan
Date: Mon Apr 13 03:35:04 2015
New Revision: 234729
URL: http://llvm.org/viewvc/llvm-project?rev=234729&view=rev
Log:
[Mips] Explicitly instantiate MipsELFFile template class
Use explicit instantiation to reduce object files size.
Added:
lld/trunk/lib/ReaderWriter/ELF/Mips/MipsELFFile.cpp
Modified:
lld/trunk/lib/ReaderWriter/ELF/Mips/CMakeLists.txt
lld/trunk/lib/ReaderWriter/ELF/Mips/MipsELFFile.h
Modified: lld/trunk/lib/ReaderWriter/ELF/Mips/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/Mips/CMakeLists.txt?rev=234729&r1=234728&r2=234729&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/ELF/Mips/CMakeLists.txt (original)
+++ lld/trunk/lib/ReaderWriter/ELF/Mips/CMakeLists.txt Mon Apr 13 03:35:04 2015
@@ -1,5 +1,6 @@
add_llvm_library(lldMipsELFTarget
MipsCtorsOrderPass.cpp
+ MipsELFFile.cpp
MipsELFFlagsMerger.cpp
MipsLinkingContext.cpp
MipsRelocationHandler.cpp
Added: lld/trunk/lib/ReaderWriter/ELF/Mips/MipsELFFile.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/Mips/MipsELFFile.cpp?rev=234729&view=auto
==============================================================================
--- lld/trunk/lib/ReaderWriter/ELF/Mips/MipsELFFile.cpp (added)
+++ lld/trunk/lib/ReaderWriter/ELF/Mips/MipsELFFile.cpp Mon Apr 13 03:35:04 2015
@@ -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)
+
+}
+}
Modified: lld/trunk/lib/ReaderWriter/ELF/Mips/MipsELFFile.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/Mips/MipsELFFile.h?rev=234729&r1=234728&r2=234729&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/ELF/Mips/MipsELFFile.h (original)
+++ lld/trunk/lib/ReaderWriter/ELF/Mips/MipsELFFile.h Mon Apr 13 03:35:04 2015
@@ -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
More information about the llvm-commits
mailing list