mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2025-01-31 06:04:58 +00:00
Sprinkle some constexpr on default ctors so the compiler can diagnose unused instances. NFCI.
This commit is contained in:
parent
b1bb5ce96d
commit
e49c3c8f2e
@ -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)) {}
|
||||
|
||||
|
@ -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)) {}
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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));
|
||||
|
@ -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) ||
|
||||
|
Loading…
x
Reference in New Issue
Block a user