Skip to content
Snippets Groups Projects
Commit d96c7f41 authored by Andrew Browne's avatar Andrew Browne
Browse files

Revert "Revert "[ADT] Fix SmallVector unused template instantiation on 32-bit systems.""

This reverts commit ac2635e4.

Revert was too hasty, build was already broken.
parent 6a1ad76d
No related branches found
No related tags found
No related merge requests found
......@@ -78,4 +78,18 @@ void SmallVectorBase<Size_T>::grow_pod(void *FirstEl, size_t MinCapacity,
}
template class llvm::SmallVectorBase<uint32_t>;
// Disable the uint64_t instantiation for 32-bit builds.
// Both uint32_t and uint64_t instantations are needed for 64-bit builds.
// This instantiation will never be used in 32-bit builds, and will cause
// warnings when sizeof(Size_T) > sizeof(size_t).
#if SIZE_MAX > UINT32_MAX
template class llvm::SmallVectorBase<uint64_t>;
// Assertions to ensure this #if stays in sync with SmallVectorSizeType.
static_assert(sizeof(SmallVectorSizeType<char>) == sizeof(uint64_t),
"Expected SmallVectorBase<uint64_t> variant to be in use.");
#else
static_assert(sizeof(SmallVectorSizeType<char>) == sizeof(uint32_t),
"Expected SmallVectorBase<uint32_t> variant to be in use.");
#endif
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment