1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 11:02:59 +02:00

[llvm] Add default constructor of llvm::ElementCount.

This patch prevents failures like those reported in
http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast/builds/34173.

We have enabled the default constructor for
`llvm::ElementCount` to make sure the code compiles on Windows.

Reviewed By: ormris

Differential Revision: https://reviews.llvm.org/D86240
This commit is contained in:
Francesco Petrogalli 2020-08-19 19:50:24 +00:00
parent eb716376d3
commit 5fbee91974
2 changed files with 3 additions and 7 deletions

View File

@ -134,9 +134,7 @@ namespace Intrinsic {
unsigned Pointer_AddressSpace;
unsigned Struct_NumElements;
unsigned Argument_Info;
// There is no default constructor in `ElementCount`, so we need
// to explicitly initialize this field with a value.
ElementCount Vector_Width = ElementCount::getFixed(0);
ElementCount Vector_Width;
};
enum ArgKind {

View File

@ -35,14 +35,12 @@ private:
ElementCount(unsigned Min, bool Scalable) : Min(Min), Scalable(Scalable) {}
public:
/// No default constructor. Users should use one of the `get*`
/// static methods below, as they should always make a conscious
/// choice on the type of `ElementCount` they are requesting.
ElementCount() = delete;
unsigned Min; // Minimum number of vector elements.
bool Scalable; // If true, NumElements is a multiple of 'Min' determined
// at runtime rather than compile time.
ElementCount() = default;
ElementCount operator*(unsigned RHS) {
return { Min * RHS, Scalable };
}