Add central registration for type ranges.

pull/1/head
Stella Laurenzo 2020-05-05 14:16:39 -07:00
parent f8cedd8656
commit bfd5fedba7
3 changed files with 31 additions and 5 deletions

View File

@ -10,6 +10,7 @@
#define NPCOMP_DIALECT_BASICPY_BASICPY_DIALECT_H #define NPCOMP_DIALECT_BASICPY_BASICPY_DIALECT_H
#include "mlir/IR/Dialect.h" #include "mlir/IR/Dialect.h"
#include "npcomp/Dialect/Common.h"
namespace mlir { namespace mlir {
namespace NPCOMP { namespace NPCOMP {
@ -17,7 +18,7 @@ namespace Basicpy {
namespace BasicpyTypes { namespace BasicpyTypes {
enum Kind { enum Kind {
PlaceholderType = Type::FIRST_PRIVATE_EXPERIMENTAL_8_TYPE, PlaceholderType = TypeRanges::Basicpy,
LAST_BASICPY_TYPE = PlaceholderType LAST_BASICPY_TYPE = PlaceholderType
}; };
} // namespace BasicpyTypes } // namespace BasicpyTypes

View File

@ -0,0 +1,27 @@
//===- Common.h - Common definitions for all dialects -----------*- C++ -*-===//
//
// This file is licensed under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#ifndef NPCOMP_DIALECT_COMMON_H
#define NPCOMP_DIALECT_COMMON_H
#include "mlir/IR/Types.h"
namespace mlir {
namespace NPCOMP {
namespace TypeRanges {
enum {
Basicpy = Type::FIRST_PRIVATE_EXPERIMENTAL_3_TYPE,
Numpy = Basicpy + 50,
};
}
} // namespace NPCOMP
} // namespace mlir
#endif // NPCOMP_DIALECT_COMMON_H

View File

@ -10,16 +10,14 @@
#define NPCOMP_DIALECT_NUMPY_NUMPY_DIALECT_H #define NPCOMP_DIALECT_NUMPY_NUMPY_DIALECT_H
#include "mlir/IR/Dialect.h" #include "mlir/IR/Dialect.h"
#include "npcomp/Dialect/Common.h"
namespace mlir { namespace mlir {
namespace NPCOMP { namespace NPCOMP {
namespace Numpy { namespace Numpy {
namespace NumpyTypes { namespace NumpyTypes {
enum Kind { enum Kind { AnyDtypeType = TypeRanges::Numpy, LAST_NUMPY_TYPE = AnyDtypeType };
AnyDtypeType = Type::FIRST_PRIVATE_EXPERIMENTAL_9_TYPE,
LAST_NUMPY_TYPE = AnyDtypeType
};
} // namespace NumpyTypes } // namespace NumpyTypes
// The singleton type representing an unknown dtype. // The singleton type representing an unknown dtype.