[PATCH] D43244: Check that Symbol types are trivially destructible
Phabricator via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Feb 13 09:34:36 PST 2018
This revision was automatically updated to reflect the committed changes.
Closed by commit rL325025: Check that Symbol types are trivially destructible (authored by sbc, committed by ).
Repository:
rL LLVM
https://reviews.llvm.org/D43244
Files:
lld/trunk/COFF/Symbols.h
lld/trunk/ELF/Symbols.h
Index: lld/trunk/COFF/Symbols.h
===================================================================
--- lld/trunk/COFF/Symbols.h
+++ lld/trunk/COFF/Symbols.h
@@ -416,6 +416,8 @@
template <typename T, typename... ArgT>
void replaceSymbol(Symbol *S, ArgT &&... Arg) {
+ static_assert(std::is_trivially_destructible<T>(),
+ "Symbol types must be trivially destructible");
static_assert(sizeof(T) <= sizeof(SymbolUnion), "Symbol too small");
static_assert(alignof(T) <= alignof(SymbolUnion),
"SymbolUnion not aligned enough");
Index: lld/trunk/ELF/Symbols.h
===================================================================
--- lld/trunk/ELF/Symbols.h
+++ lld/trunk/ELF/Symbols.h
@@ -350,6 +350,8 @@
template <typename T, typename... ArgT>
void replaceSymbol(Symbol *S, ArgT &&... Arg) {
+ static_assert(std::is_trivially_destructible<T>(),
+ "Symbol types must be trivially destructible");
static_assert(sizeof(T) <= sizeof(SymbolUnion), "SymbolUnion too small");
static_assert(alignof(T) <= alignof(SymbolUnion),
"SymbolUnion not aligned enough");
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D43244.134063.patch
Type: text/x-patch
Size: 1134 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180213/3c45b3a4/attachment.bin>
More information about the llvm-commits
mailing list