diff options
author | Benjamin Kramer <benny.kra@googlemail.com> | 2020-01-10 14:58:07 +0100 |
---|---|---|
committer | Benjamin Kramer <benny.kra@googlemail.com> | 2020-01-10 14:59:24 +0100 |
commit | e49c3c8f2ef97bdf256ca76f3d001eeb79361d56 (patch) | |
tree | a4daa941c9cb41fc083684ce0520d95dfbd32b58 | |
parent | b1bb5ce96d349689085eab38121c85737de1fcaa (diff) | |
download | bcm5719-llvm-e49c3c8f2ef97bdf256ca76f3d001eeb79361d56.tar.gz bcm5719-llvm-e49c3c8f2ef97bdf256ca76f3d001eeb79361d56.zip |
Sprinkle some constexpr on default ctors so the compiler can diagnose unused instances. NFCI.
-rw-r--r-- | mlir/include/mlir/IR/Attributes.h | 2 | ||||
-rw-r--r-- | mlir/include/mlir/IR/Types.h | 2 | ||||
-rw-r--r-- | mlir/include/mlir/IR/Value.h | 2 | ||||
-rw-r--r-- | mlir/lib/Dialect/SPIRV/SPIRVOps.cpp | 1 | ||||
-rw-r--r-- | mlir/lib/Dialect/VectorOps/VectorOps.cpp | 1 |
5 files changed, 3 insertions, 5 deletions
diff --git a/mlir/include/mlir/IR/Attributes.h b/mlir/include/mlir/IR/Attributes.h index 64b8063bdcb..49f42affb56 100644 --- a/mlir/include/mlir/IR/Attributes.h +++ b/mlir/include/mlir/IR/Attributes.h @@ -69,7 +69,7 @@ public: using ImplType = AttributeStorage; using ValueType = void; - Attribute() : impl(nullptr) {} + constexpr Attribute() : impl(nullptr) {} /* implicit */ Attribute(const ImplType *impl) : impl(const_cast<ImplType *>(impl)) {} diff --git a/mlir/include/mlir/IR/Types.h b/mlir/include/mlir/IR/Types.h index 6246e9bedd0..21d6493a417 100644 --- a/mlir/include/mlir/IR/Types.h +++ b/mlir/include/mlir/IR/Types.h @@ -108,7 +108,7 @@ public: using ImplType = TypeStorage; - Type() : impl(nullptr) {} + constexpr Type() : impl(nullptr) {} /* implicit */ Type(const ImplType *impl) : impl(const_cast<ImplType *>(impl)) {} diff --git a/mlir/include/mlir/IR/Value.h b/mlir/include/mlir/IR/Value.h index d4869f242c0..3fb5a91c73a 100644 --- a/mlir/include/mlir/IR/Value.h +++ b/mlir/include/mlir/IR/Value.h @@ -70,7 +70,7 @@ public: using ImplType = llvm::PointerIntPair<void *, 2, Kind, ImplTypeTraits>; public: - Value(std::nullptr_t) : ownerAndKind() {} + constexpr Value(std::nullptr_t) : ownerAndKind() {} Value(ImplType ownerAndKind = {}) : ownerAndKind(ownerAndKind) {} Value(const Value &) = default; Value &operator=(const Value &) = default; diff --git a/mlir/lib/Dialect/SPIRV/SPIRVOps.cpp b/mlir/lib/Dialect/SPIRV/SPIRVOps.cpp index 1de7bceaf23..ff20e091f91 100644 --- a/mlir/lib/Dialect/SPIRV/SPIRVOps.cpp +++ b/mlir/lib/Dialect/SPIRV/SPIRVOps.cpp @@ -1470,7 +1470,6 @@ spirv::ConstantOp spirv::ConstantOp::getZero(Type type, Location loc, OpBuilder *builder) { if (auto intType = type.dyn_cast<IntegerType>()) { unsigned width = intType.getWidth(); - Attribute val; if (width == 1) return builder->create<spirv::ConstantOp>(loc, type, builder->getBoolAttr(false)); diff --git a/mlir/lib/Dialect/VectorOps/VectorOps.cpp b/mlir/lib/Dialect/VectorOps/VectorOps.cpp index 4afd05758ed..92a230eb5d1 100644 --- a/mlir/lib/Dialect/VectorOps/VectorOps.cpp +++ b/mlir/lib/Dialect/VectorOps/VectorOps.cpp @@ -1650,7 +1650,6 @@ static ParseResult parseTupleGetOp(OpAsmParser &parser, StringRef indexAttrName = TupleGetOp::getIndexAttrName(); Type indexType = parser.getBuilder().getIndexType(); TupleType tupleType; - VectorType resultVectorType; if (parser.parseOperand(operandInfo) || parser.parseComma() || parser.parseAttribute(indexAttr, indexType, indexAttrName, result.attributes) || |